|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.wcohen.ss.tokens.SimpleTokenizer
public class SimpleTokenizer
Simple implementation of a Tokenizer. Tokens are sequences of alphanumerics, optionally including single punctuation characters.
Field Summary | |
---|---|
static SimpleTokenizer |
DEFAULT_TOKENIZER
|
Constructor Summary | |
---|---|
SimpleTokenizer(boolean ignorePunctuation,
boolean ignoreCase)
|
Method Summary | |
---|---|
Token |
intern(java.lang.String s)
Convert a given string into a token. |
static void |
main(java.lang.String[] argv)
Test routine |
int |
maxTokenIndex()
Return the higest index of any interned token |
void |
setIgnoreCase(boolean flag)
|
void |
setIgnorePunctuation(boolean flag)
|
java.util.Iterator<Token> |
tokenIterator()
Return an iterator over interned tokens |
Token[] |
tokenize(java.lang.String input)
Return tokenized version of a string. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final SimpleTokenizer DEFAULT_TOKENIZER
Constructor Detail |
---|
public SimpleTokenizer(boolean ignorePunctuation, boolean ignoreCase)
Method Detail |
---|
public void setIgnorePunctuation(boolean flag)
public void setIgnoreCase(boolean flag)
public java.lang.String toString()
toString
in class java.lang.Object
public Token[] tokenize(java.lang.String input)
tokenize
in interface Tokenizer
public Token intern(java.lang.String s)
Tokenizer
intern
in interface Tokenizer
public java.util.Iterator<Token> tokenIterator()
Tokenizer
tokenIterator
in interface Tokenizer
public int maxTokenIndex()
Tokenizer
maxTokenIndex
in interface Tokenizer
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |