|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cvut.felk.newsgroup.preprocess.StringUtils
public abstract class StringUtils
Different string-processing utilities.
Constructor Summary | |
---|---|
StringUtils()
|
Method Summary | |
---|---|
static String |
processWord(String word)
Converts a raw word read from a file into a normalized form. |
private static String |
simplify(String word)
Removes all characters, which are not letters. |
private static String |
stem(String word)
Returns the "stem" of a word. |
static String[] |
tokenize(String lineWithWords)
Tokenizer splits a line into words. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringUtils()
Method Detail |
---|
public static String[] tokenize(String lineWithWords)
lineWithWords
- a line in a document
public static String processWord(String word)
word
- the word read from a file.
private static String stem(String word)
A stemmer for English should identify the string "cats" (and possibly "catlike", "catty" etc.) as based on the root "cat", and "stemmer", "stemming", "stemmed" as based on "stem". A stemming algorithm reduces the words "fishing", "fished", "fish", and "fisher" to the root word, "fish".
You can read and consult article on wikipedia.
word
- an English word in lower-case
private static String simplify(String word)
word
- a lower-case string
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |