Class UnknownDictionary
java.lang.Object
org.apache.lucene.analysis.morph.BinaryDictionary<UnknownMorphData>
org.apache.lucene.analysis.ja.dict.UnknownDictionary
- All Implemented Interfaces:
Dictionary<UnknownMorphData>
Dictionary for unknown-word handling.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CharacterDefinition
private final UnknownMorphData
Fields inherited from class org.apache.lucene.analysis.morph.BinaryDictionary
buffer, DICT_FILENAME_SUFFIX, POSDICT_FILENAME_SUFFIX, TARGETMAP_FILENAME_SUFFIX
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
UnknownDictionary
(URL targetMapUrl, URL posDictUrl, URL dictUrl) Create aUnknownDictionary
from an external resource URL (e.g.UnknownDictionary
(Path targetMapFile, Path posDictFile, Path dictFile) Create aUnknownDictionary
from an external resource path.private
UnknownDictionary
(IOSupplier<InputStream> targetMapResource, IOSupplier<InputStream> posResource, IOSupplier<InputStream> dictResource) -
Method Summary
Modifier and TypeMethodDescriptionprivate static InputStream
getClassResource
(String suffix) static UnknownDictionary
int
lookup
(char[] text, int offset, int len) Methods inherited from class org.apache.lucene.analysis.morph.BinaryDictionary
lookupWordIds
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.analysis.morph.Dictionary
getLeftId, getRightId, getWordCost
-
Field Details
-
characterDefinition
-
morphAtts
-
-
Constructor Details
-
UnknownDictionary
Create aUnknownDictionary
from an external resource path.- Parameters:
targetMapFile
- where to load target map resourceposDictFile
- where to load POS dictionary resourcedictFile
- where to load dictionary entries resource- Throws:
IOException
- if resource was not found or broken
-
UnknownDictionary
Create aUnknownDictionary
from an external resource URL (e.g. from Classpath withClassLoader.getResource(String)
).- Parameters:
targetMapUrl
- where to load target map resourceposDictUrl
- where to load POS dictionary resourcedictUrl
- where to load dictionary entries resource- Throws:
IOException
- if resource was not found or broken
-
UnknownDictionary
- Throws:
IOException
-
UnknownDictionary
private UnknownDictionary(IOSupplier<InputStream> targetMapResource, IOSupplier<InputStream> posResource, IOSupplier<InputStream> dictResource) throws IOException - Throws:
IOException
-
-
Method Details
-
getClassResource
- Throws:
IOException
-
getMorphAttributes
-
lookup
public int lookup(char[] text, int offset, int len) -
getCharacterDefinition
-
getInstance
-