Class UserDictionary
java.lang.Object
org.apache.lucene.analysis.ja.dict.UserDictionary
- All Implemented Interfaces:
Dictionary<UserMorphData>
Class for building a User Dictionary. This class allows for custom segmentation of phrases.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intprivate static final int[][]private final TokenInfoFSTstatic final Stringprivate static final Patternprivate final UserMorphDataprivate final int[][]private static final Patternprivate static final Pattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFST()int[][]lookup(char[] chars, int off, int len) Lookup words in textint[]lookupSegmentation(int phraseID) static UserDictionaryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.analysis.morph.Dictionary
getLeftId, getRightId, getWordCost
-
Field Details
-
INTERNAL_SEPARATOR
- See Also:
-
LINE_COMMENT
-
WHITESPACE
-
SPACES
-
fst
-
segmentations
private final int[][] segmentations -
morphAtts
-
CUSTOM_DICTIONARY_WORD_ID_OFFSET
static final int CUSTOM_DICTIONARY_WORD_ID_OFFSET- See Also:
-
EMPTY_RESULT
private static final int[][] EMPTY_RESULT
-
-
Constructor Details
-
UserDictionary
- Throws:
IOException
-
-
Method Details
-
open
- Throws:
IOException
-
getMorphAttributes
- Specified by:
getMorphAttributesin interfaceDictionary<UserMorphData>
-
lookup
Lookup words in text- Parameters:
chars- textoff- offset into textlen- length of text- Returns:
- array of {wordId, position, length}
- Throws:
IOException
-
getFST
-
lookupSegmentation
public int[] lookupSegmentation(int phraseID)
-