com.cybozu.labs.langdetect.util
Class LangProfile

java.lang.Object
  extended by com.cybozu.labs.langdetect.util.LangProfile

public class LangProfile
extends Object

LangProfile is a Language Profile Class. Users don't use this class directly.

Author:
Nakatani Shuyo

Field Summary
 HashMap<String,Integer> freq
           
 int[] n_words
           
 String name
           
 
Constructor Summary
LangProfile()
          Constructor for JSONIC
LangProfile(String name)
          Normal Constructor
 
Method Summary
 void add(String gram)
          Add n-gram to profile
 void omitLessFreq()
          Eliminate below less frequency n-grams and noise Latin alphabets
 void update(String text)
          Update the language profile with (fragmented) text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public String name

freq

public HashMap<String,Integer> freq

n_words

public int[] n_words
Constructor Detail

LangProfile

public LangProfile()
Constructor for JSONIC


LangProfile

public LangProfile(String name)
Normal Constructor

Parameters:
name - language name
Method Detail

add

public void add(String gram)
Add n-gram to profile

Parameters:
gram -

omitLessFreq

public void omitLessFreq()
Eliminate below less frequency n-grams and noise Latin alphabets


update

public void update(String text)
Update the language profile with (fragmented) text. Extract n-grams from text and add their frequency into the profile.

Parameters:
text - (fragmented) text to extract n-grams


Copyright © 2012. All Rights Reserved.