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