|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdatapreparation.language.LanguageDecider
public class LanguageDecider
A class that decides the Language of a document (news)
Field Summary | |
---|---|
static int |
ENGLISH
A static integer for the English most common words |
static int |
NORWEGIAN
A static integer for the French most common words |
static int |
UNDECIDED
A static integer if the language is undecided |
Constructor Summary | |
---|---|
LanguageDecider()
A constructor for the class. |
Method Summary | |
---|---|
int |
checkSentenceInLanguage(java.lang.String sentence)
A method that checks which language a given sentence is. |
java.lang.String |
getEngDefaultName()
Retrieves the filname of the most common words in English. |
java.lang.String |
getNorDefaultName()
Retrieves the filname of the most common words in Norwegian. |
boolean |
loadEng(java.lang.String filename)
A method that loads a file of the most common English words, and puts them in the HashMap |
boolean |
loadNor(java.lang.String filename)
A method that loads a file of the most common French words, and puts them in the HashMap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ENGLISH
public static final int NORWEGIAN
public static final int UNDECIDED
Constructor Detail |
---|
public LanguageDecider()
Method Detail |
---|
public java.lang.String getEngDefaultName()
public java.lang.String getNorDefaultName()
public boolean loadEng(java.lang.String filename)
filename
- the filename of the most common words in English
public boolean loadNor(java.lang.String filename)
filename
- the filename of the most common words in French
public int checkSentenceInLanguage(java.lang.String sentence)
sentence
- the sentence
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |