Package edu.stanford.nlp.process
Class WordTokenFactory
- java.lang.Object
-
- edu.stanford.nlp.process.WordTokenFactory
-
- All Implemented Interfaces:
LexedTokenFactory<Word>
public class WordTokenFactory extends Object implements LexedTokenFactory<Word>
Constructs a Word from a String. This is the default TokenFactory for PTBLexer. It discards the positional information.- Author:
- Jenny Finkel
-
-
Constructor Summary
Constructors Constructor Description WordTokenFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WordmakeToken(String str, int begin, int length)Constructs a token (of arbitrary type) from a String and its position in the underlying text.
-
-
-
Method Detail
-
makeToken
public Word makeToken(String str, int begin, int length)
Description copied from interface:LexedTokenFactoryConstructs a token (of arbitrary type) from a String and its position in the underlying text. The int arguments are used just to record token character offsets in an underlying text. This method does not take a substring ofstr.- Specified by:
makeTokenin interfaceLexedTokenFactory<Word>- Parameters:
str- The String extracted by the lexer.begin- The offset in the document of the first character in this string.length- The number of characters the string takes up in the document.- Returns:
- The token of type T.
-
-