Package opennlp.tools.tokenize
Class DetokenizationDictionary
- java.lang.Object
-
- opennlp.tools.tokenize.DetokenizationDictionary
-
public class DetokenizationDictionary extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DetokenizationDictionary.Operation
-
Constructor Summary
Constructors Constructor Description DetokenizationDictionary(File file)
Initializes aDetokenizationDictionary
instance via a validFile
.DetokenizationDictionary(InputStream in)
Initializes aDetokenizationDictionary
instance via a validInputStream
.DetokenizationDictionary(String[] tokens, DetokenizationDictionary.Operation[] operations)
Initializes aDetokenizationDictionary
instance.DetokenizationDictionary(Path path)
Initializes aDetokenizationDictionary
instance via a validPath
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
serialize(OutputStream out)
Serializes the current state of aDetokenizationDictionary
via anoutput stream
.
-
-
-
Constructor Detail
-
DetokenizationDictionary
public DetokenizationDictionary(String[] tokens, DetokenizationDictionary.Operation[] operations)
Initializes aDetokenizationDictionary
instance.- Parameters:
tokens
- An array of tokens that should be de-tokenized according tooperations
.operations
- An array of operations which specifies which operation should be used for the providedtokens
.
-
DetokenizationDictionary
public DetokenizationDictionary(InputStream in) throws IOException
Initializes aDetokenizationDictionary
instance via a validInputStream
.- Parameters:
in
- TheInputStream
used for loading the dictionary.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
DetokenizationDictionary
public DetokenizationDictionary(File file) throws IOException
Initializes aDetokenizationDictionary
instance via a validFile
.- Parameters:
file
- TheFile
used for loading the dictionary.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
DetokenizationDictionary
public DetokenizationDictionary(Path path) throws IOException
Initializes aDetokenizationDictionary
instance via a validPath
.- Parameters:
path
- ThePath
used for loading the dictionary.- Throws:
IOException
- Thrown if IO errors occurred during initialization.
-
-
Method Detail
-
serialize
public void serialize(OutputStream out) throws IOException
Serializes the current state of aDetokenizationDictionary
via anoutput stream
.- Parameters:
out
- A valid, openOutputStream
ready to be used for serialization.- Throws:
IOException
- Thrown if IO errors occurred during serialization.
-
-