Package opennlp.tools.tokenize
Class DictionaryDetokenizer
- java.lang.Object
-
- opennlp.tools.tokenize.DictionaryDetokenizer
-
- All Implemented Interfaces:
Detokenizer
public class DictionaryDetokenizer extends Object implements Detokenizer
A rule based detokenizer. Simple rules which indicate in which direction a token should be moved are looked up in adictionary.- See Also:
Detokenizer,DetokenizationDictionary
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface opennlp.tools.tokenize.Detokenizer
Detokenizer.DetokenizationOperation
-
-
Constructor Summary
Constructors Constructor Description DictionaryDetokenizer(DetokenizationDictionary dict)Initializes aDictionaryDetokenizerinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Detokenizer.DetokenizationOperation[]detokenize(String[] tokens)Detokenizes the collection of tokens.Stringdetokenize(String[] tokens, String splitMarker)Detokenizes the inputtokensinto a String.
-
-
-
Constructor Detail
-
DictionaryDetokenizer
public DictionaryDetokenizer(DetokenizationDictionary dict)
Initializes aDictionaryDetokenizerinstance.- Parameters:
dict- TheDetokenizationDictionaryto be used.
-
-
Method Detail
-
detokenize
public Detokenizer.DetokenizationOperation[] detokenize(String[] tokens)
Description copied from interface:DetokenizerDetokenizes the collection of tokens.- Specified by:
detokenizein interfaceDetokenizer- Parameters:
tokens- The elements which should be detokenized.- Returns:
- The
merge operationsto handle giventokens.
-
detokenize
public String detokenize(String[] tokens, String splitMarker)
Description copied from interface:DetokenizerDetokenizes the inputtokensinto a String. Tokens which are connected without awhitespacecharacter in between can be separated by a givensplitMarker.- Specified by:
detokenizein interfaceDetokenizer- Parameters:
tokens- The elements which should be concatenated.splitMarker- The split marker ornull.- Returns:
- The concatenated tokens as a single string.
-
-