Package org.languagetool.rules
Class DictionarySpellMatchFilter
java.lang.Object
org.languagetool.rules.DictionarySpellMatchFilter
- All Implemented Interfaces:
RuleMatchFilter
Filter spelling error with phrases the users wants to have accepted.
Needed so words with spaces (i.e. phrases) can be added to a user's dictionary
without LT creating internal anti patterns for each phrase.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final longprivate static final com.google.common.cache.LoadingCache<UserConfig, com.hankcs.algorithm.AhoCorasickDoubleArrayTrie<String>> private final UserConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilter(List<RuleMatch> ruleMatches, AnnotatedText text) getPhrases(List<RuleMatch> ruleMatches, AnnotatedText text) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.languagetool.rules.RuleMatchFilter
filter
-
Field Details
-
userConfig
-
CACHE_SIZE
private static final int CACHE_SIZE- See Also:
-
CACHE_TTL_SECONDS
private static final long CACHE_TTL_SECONDS- See Also:
-
phraseSearcher
private static final com.google.common.cache.LoadingCache<UserConfig,com.hankcs.algorithm.AhoCorasickDoubleArrayTrie<String>> phraseSearcher
-
-
Constructor Details
-
DictionarySpellMatchFilter
-
-
Method Details
-
filter
- Specified by:
filterin interfaceRuleMatchFilter- Parameters:
ruleMatches- matches to transform/filtertext- corresponding text- Returns:
- transformed matches
-
getPhrases
-