Class TrigramAutomaton
- java.lang.Object
-
- org.apache.lucene.analysis.hunspell.TrigramAutomaton
-
class TrigramAutomaton extends java.lang.ObjectAn automaton allowing to achieve the same results as non-weightedGeneratingSuggester.ngramScore(int, java.lang.String, java.lang.String, boolean), but faster (in O(s2.length) time).
-
-
Field Summary
Fields Modifier and Type Field Description private CharacterRunAutomatonautomatonprivate FixedBitSetcountedSubstringsprivate charminCharprivate static intNprivate int[]state2Score
-
Constructor Summary
Constructors Constructor Description TrigramAutomaton(java.lang.String s1)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intngramScore(CharsRef s2)private intrunAutomatonOnStringChars(java.lang.String s)private intsubstringScore(int state, FixedBitSet countedSubstrings)(package private) chartransformChar(char c)
-
-
-
Field Detail
-
N
private static final int N
- See Also:
- Constant Field Values
-
automaton
private final CharacterRunAutomaton automaton
-
state2Score
private final int[] state2Score
-
countedSubstrings
private final FixedBitSet countedSubstrings
-
minChar
private final char minChar
-
-
Method Detail
-
runAutomatonOnStringChars
private int runAutomatonOnStringChars(java.lang.String s)
-
ngramScore
int ngramScore(CharsRef s2)
-
transformChar
char transformChar(char c)
-
substringScore
private int substringScore(int state, FixedBitSet countedSubstrings)
-
-