Class DefaultTokenizer
- java.lang.Object
-
- org.deeplearning4j.text.tokenization.tokenizer.DefaultTokenizer
-
-
Constructor Summary
Constructors Constructor Description DefaultTokenizer(String tokens)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countTokens()
The number of tokens in the tokenizerList<String>
getTokens()
Returns a list of all the tokensboolean
hasMoreTokens()
An iterator for tracking whether more tokens are left in the iterator notString
nextToken()
The next token (word usually) in the stringvoid
setTokenPreProcessor(TokenPreProcess tokenPreProcessor)
Set the token pre process
-
-
-
Constructor Detail
-
DefaultTokenizer
public DefaultTokenizer(String tokens)
-
-
Method Detail
-
hasMoreTokens
public boolean hasMoreTokens()
Description copied from interface:Tokenizer
An iterator for tracking whether more tokens are left in the iterator not- Specified by:
hasMoreTokens
in interfaceTokenizer
- Returns:
- whether there is anymore tokens to iterate over
-
countTokens
public int countTokens()
Description copied from interface:Tokenizer
The number of tokens in the tokenizer- Specified by:
countTokens
in interfaceTokenizer
- Returns:
- the number of tokens
-
nextToken
public String nextToken()
Description copied from interface:Tokenizer
The next token (word usually) in the string
-
getTokens
public List<String> getTokens()
Description copied from interface:Tokenizer
Returns a list of all the tokens
-
setTokenPreProcessor
public void setTokenPreProcessor(TokenPreProcess tokenPreProcessor)
Description copied from interface:Tokenizer
Set the token pre process- Specified by:
setTokenPreProcessor
in interfaceTokenizer
- Parameters:
tokenPreProcessor
- the token pre processor to set
-
-