Package opennlp.uima.normalizer
Class StringDictionary
- java.lang.Object
-
- opennlp.uima.normalizer.StringDictionary
-
public class StringDictionary extends Object
-
-
Constructor Summary
Constructors Constructor Description StringDictionary()
StringDictionary(InputStream in)
InitializesStringDictionary
via a specifiedInputStream
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
get(StringList key)
Retrieves a value from a dictionary via itskey
.void
put(StringList key, String value)
Adds a new entry to the dictionary.void
serialize(OutputStream out)
Writes the dictionary to the givenOutputStream
.
-
-
-
Constructor Detail
-
StringDictionary
public StringDictionary()
-
StringDictionary
public StringDictionary(InputStream in) throws IOException
InitializesStringDictionary
via a specifiedInputStream
.- Parameters:
in
- A valid, openInputStream
to initialize with.- Throws:
IOException
- Thrown if IO errors occurred.
-
-
Method Detail
-
get
public String get(StringList key)
Retrieves a value from a dictionary via itskey
.- Parameters:
key
- Thekey
to get value with.- Returns:
- Retrieves a corresponding String value or
null
if not found.
-
put
public void put(StringList key, String value)
Adds a new entry to the dictionary.- Parameters:
key
- Thekey
under which to put thevalue
.value
- The value to put.
-
serialize
public void serialize(OutputStream out) throws IOException
Writes the dictionary to the givenOutputStream
.- Parameters:
out
- A valid, openOutputStream
to serialize to.- Throws:
IOException
- Thrown if IO errors occurred during serialization.
-
-