|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knallgrau.utils.textcat.TextCategorizer
public class TextCategorizer
Constructor Summary | |
---|---|
TextCategorizer()
|
|
TextCategorizer(java.lang.String confFile)
creates a new TextCategorizer with the given configuration file. the configuration file maps paths to FingerPrint files to categories which are used to categorize the texts passed to the TextCategorizer. |
Method Summary | |
---|---|
java.lang.String |
categorize(java.lang.String text)
categorizes the text passed to it |
java.lang.String |
categorize(java.lang.String text,
int limit)
categorizes only a certain amount of characters in the text. recommended when categorizing large texts in order to increase performance. |
java.util.Map<java.lang.String,java.lang.Integer> |
getCategoryDistances(java.lang.String text)
categorizes a text but returns a map containing all categories and their distances to the text. |
static void |
main(java.lang.String[] args)
reads from stdin til EOF is read. prints the determined category of the input and terminates afterwards. |
void |
setConfFile(java.lang.String confFile)
sets the configuration file path. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextCategorizer()
public TextCategorizer(java.lang.String confFile)
confFile
- the path to the configuration fileMethod Detail |
---|
public void setConfFile(java.lang.String confFile)
confFile
- the path to the configuration filepublic java.lang.String categorize(java.lang.String text)
text
- text to be categorized
public java.lang.String categorize(java.lang.String text, int limit)
text
- text to be analysedlimit
- number of characters to be analysed
public java.util.Map<java.lang.String,java.lang.Integer> getCategoryDistances(java.lang.String text)
text
- text to be categorized
public static void main(java.lang.String[] args)
args
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |