ca.uottawa.balie
Class LanguageIdentification

java.lang.Object
  extended by ca.uottawa.balie.LanguageIdentification

public class LanguageIdentification
extends java.lang.Object

Methods for training, testing and using language identification.

Author:
nadeaud

Constructor Summary
LanguageIdentification()
          The latest LangID model (if found) is loaded upon construction.
 
Method Summary
 java.lang.String DetectLanguage(java.lang.String pi_Text)
          Gives the language with the highest likelihood.
 LanguageIdentificationGuess[] GetLanguageLikelihood(java.lang.String pi_Text)
          Gives the likelihood of every language given a text.
static void main(java.lang.String[] args)
          Execute TrainLanguageIdentification()
static void TrainLanguageIdentification()
          Trains and Tests the language identification model.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LanguageIdentification

public LanguageIdentification()
The latest LangID model (if found) is loaded upon construction. Language guesser will only work if a model is found.

Method Detail

GetLanguageLikelihood

public LanguageIdentificationGuess[] GetLanguageLikelihood(java.lang.String pi_Text)
Gives the likelihood of every language given a text.

Parameters:
pi_Text - A text for which we want to guess the language
Returns:
Array of LanguageIdentificationGuess (one per supported language)

DetectLanguage

public java.lang.String DetectLanguage(java.lang.String pi_Text)
Gives the language with the highest likelihood.

Parameters:
pi_Text - A text for which we want to guess the language
Returns:
String that represent the most probable language (see Balie for enumeration)
See Also:
Balie

TrainLanguageIdentification

public static void TrainLanguageIdentification()
Trains and Tests the language identification model.


main

public static void main(java.lang.String[] args)
Execute TrainLanguageIdentification()

Parameters:
args -