boolean termCountBelowLimit(String term) {
            String lowerCasedTerm = toLowerCase(term);
            int occurrences = termOccurrences.getOrDefault(lowerCasedTerm, 0);
            if (occurrences >= maxOccurrences) return false;

            termOccurrences.put(lowerCasedTerm, occurrences + 1);
            return true;
        }
This annotates strings that are to be indexed with the tokens to index,
as produced by the give linguistics implementation.
Using annotations lets us provide the tokens to index without mutating
the original string which we need to store.
The annotations are placed in an annotation tree named "linguistics".

@author Simon Thoresen Hult
indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/linguistics/LinguisticsAnnotator.java