Class TrigramAutomaton
- java.lang.Object
-
- org.apache.lucene.analysis.hunspell.TrigramAutomaton
-
class TrigramAutomaton extends java.lang.Object
An 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 CharacterRunAutomaton
automaton
private FixedBitSet
countedSubstrings
private char
maxChar
private char
minChar
private static int
N
private 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) int
ngramScore(CharsRef s2)
private int
runAutomatonOnStringChars(java.lang.String s)
private int
substringScore(int state, FixedBitSet countedSubstrings)
(package private) char
transformChar(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
-
maxChar
private final char maxChar
-
-
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)
-
-