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 aDictionaryDetokenizer
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Detokenizer.DetokenizationOperation[]
detokenize(String[] tokens)
Detokenizes the collection of tokens.String
detokenize(String[] tokens, String splitMarker)
Detokenizes the inputtokens
into a String.
-
-
-
Constructor Detail
-
DictionaryDetokenizer
public DictionaryDetokenizer(DetokenizationDictionary dict)
Initializes aDictionaryDetokenizer
instance.- Parameters:
dict
- TheDetokenizationDictionary
to be used.
-
-
Method Detail
-
detokenize
public Detokenizer.DetokenizationOperation[] detokenize(String[] tokens)
Description copied from interface:Detokenizer
Detokenizes the collection of tokens.- Specified by:
detokenize
in interfaceDetokenizer
- Parameters:
tokens
- The elements which should be detokenized.- Returns:
- The
merge operations
to handle giventokens
.
-
detokenize
public String detokenize(String[] tokens, String splitMarker)
Description copied from interface:Detokenizer
Detokenizes the inputtokens
into a String. Tokens which are connected without awhitespace
character in between can be separated by a givensplitMarker
.- Specified by:
detokenize
in interfaceDetokenizer
- Parameters:
tokens
- The elements which should be concatenated.splitMarker
- The split marker ornull
.- Returns:
- The concatenated tokens as a single string.
-
-