|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsg.edu.nus.comp.nlp.ims.lexelt.CStatistic
public class CStatistic
statistic of all training instances of a lexelt.
Field Summary | |
---|---|
protected java.lang.String |
m_Default
|
protected java.lang.String |
m_Encoding
|
protected java.util.Hashtable<java.lang.String,java.lang.Integer> |
m_KeyMap
|
protected java.util.ArrayList<java.lang.String> |
m_Keys
|
protected int |
m_M2
|
protected int |
m_Size
|
protected java.util.regex.Pattern |
m_SplitPattern
|
protected boolean |
m_Status
|
protected java.util.ArrayList<java.lang.Integer> |
m_TagCount
|
protected java.util.Hashtable<java.lang.String,java.lang.Integer> |
m_TagMap
|
protected java.util.ArrayList<java.lang.String> |
m_Tags
|
protected java.util.ArrayList<java.lang.Class<? extends IFeature>> |
m_TypeEnum
|
protected java.util.ArrayList<java.lang.Integer> |
m_Types
|
protected java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> |
m_ValueCount
|
protected java.util.ArrayList<java.util.Hashtable<java.lang.String,java.lang.Integer>> |
m_Values
|
protected java.util.ArrayList<java.util.ArrayList<java.util.ArrayList<java.lang.Integer>>> |
m_ValueTagCount
|
protected static java.lang.String |
SEPARATOR
|
Constructor Summary | |
---|---|
CStatistic()
default constructor |
|
CStatistic(java.lang.String p_Encoding)
constructor with file encoding |
Method Summary | |
---|---|
boolean |
addInstance(IInstance p_Instance)
add one instance into the statistic. |
protected void |
check()
check the status |
void |
clear()
clear the statistic |
java.lang.Object |
clone()
|
boolean |
contains(int p_KeyIndex,
java.lang.String p_Value)
check whether feature p_Index contains value p_Value |
int |
getCount(int p_Index,
java.lang.String p_Value)
get the count of value p_Value of feature p_Index |
int |
getCount(int p_KeyIndex,
java.lang.String p_Value,
java.lang.String p_Tag)
get the count of value p_Value of feature p_Key with p_Tag |
int |
getCount(java.lang.String p_Key,
java.lang.String p_Value)
get the count of value p_Value of feature p_Key |
int |
getCount(java.lang.String p_Key,
java.lang.String p_Value,
java.lang.String p_Tag)
get the count of value p_Value of feature p_Key with p_Tag |
java.lang.String |
getDefaultValue()
get the default value of feature |
int |
getIndex(java.lang.String p_Key)
get the feature index of feature p_Key |
java.lang.String |
getKey(int p_Index)
get the feature name of feature p_Index |
java.util.List<java.lang.String> |
getKeys()
get the list of feature names in the statistic |
int |
getParameter(java.lang.String p_Parameter)
get the value of p_Parameter |
int |
getTagCount(java.lang.String p_Tag)
get count of tag |
java.util.Set<java.lang.String> |
getTags()
get the tag list |
java.util.List<java.lang.String> |
getTagsInOrder()
get the tags in order |
java.lang.String |
getType(int p_Index)
get the feature type of feature p_Index |
java.lang.String |
getType(java.lang.String p_Key)
get feature type of feature p_Key |
java.util.List<java.lang.String> |
getValue(int p_Index)
get the value list of feature p_Index |
java.util.List<java.lang.String> |
getValue(java.lang.String p_Key)
get the value list of feature p_key |
boolean |
isProcessed()
check whether the statistic object has been processed like filtering and some others |
boolean |
loadFromFile(java.lang.String p_FileName)
load the statistic information from file |
protected void |
remove(int p_FeatureIndex)
remove a feature |
protected void |
remove(int p_FeatureIndex,
java.lang.String p_Value)
remove a value of a feature |
boolean |
removeInstance(IInstance p_iInstance)
remove one instance from the statistic |
void |
select(IFeatureSelector p_Selector)
select features |
boolean |
setParameter(java.lang.String p_Parameter,
int p_Value)
set parameter of the statistic information |
int |
size()
get the number of instances |
boolean |
writeToFile(java.lang.String p_FileName)
write the statistic information into file |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.String m_Default
protected boolean m_Status
protected int m_Size
protected java.util.ArrayList<java.lang.String> m_Keys
protected java.util.Hashtable<java.lang.String,java.lang.Integer> m_KeyMap
protected java.util.ArrayList<java.lang.Class<? extends IFeature>> m_TypeEnum
protected java.util.ArrayList<java.lang.Integer> m_Types
protected java.util.ArrayList<java.util.Hashtable<java.lang.String,java.lang.Integer>> m_Values
protected java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> m_ValueCount
protected java.util.ArrayList<java.util.ArrayList<java.util.ArrayList<java.lang.Integer>>> m_ValueTagCount
protected java.util.Hashtable<java.lang.String,java.lang.Integer> m_TagMap
protected java.util.ArrayList<java.lang.String> m_Tags
protected java.util.ArrayList<java.lang.Integer> m_TagCount
protected int m_M2
protected static final java.lang.String SEPARATOR
protected java.util.regex.Pattern m_SplitPattern
protected java.lang.String m_Encoding
Constructor Detail |
---|
public CStatistic()
public CStatistic(java.lang.String p_Encoding)
p_Encoding
- file encodingMethod Detail |
---|
public boolean addInstance(IInstance p_Instance)
IStatistic
addInstance
in interface IStatistic
p_Instance
- instance
public boolean removeInstance(IInstance p_iInstance)
IStatistic
removeInstance
in interface IStatistic
p_iInstance
- instance
public java.util.List<java.lang.String> getKeys()
IStatistic
getKeys
in interface IStatistic
public int getParameter(java.lang.String p_Parameter)
IStatistic
getParameter
in interface IStatistic
p_Parameter
- parameter name
public boolean loadFromFile(java.lang.String p_FileName)
IStatistic
loadFromFile
in interface IStatistic
p_FileName
- statistic file
public boolean setParameter(java.lang.String p_Parameter, int p_Value)
IStatistic
setParameter
in interface IStatistic
p_Parameter
- parameter namep_Value
- parameter value
public boolean writeToFile(java.lang.String p_FileName)
IStatistic
writeToFile
in interface IStatistic
p_FileName
- file to be written
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean contains(int p_KeyIndex, java.lang.String p_Value)
IStatistic
contains
in interface IStatistic
p_KeyIndex
- feature indexp_Value
- feature value
public int getCount(java.lang.String p_Key, java.lang.String p_Value)
IStatistic
getCount
in interface IStatistic
p_Key
- feature namep_Value
- feature value
public int getCount(int p_Index, java.lang.String p_Value)
IStatistic
getCount
in interface IStatistic
p_Index
- feature indexp_Value
- feature value
public int getIndex(java.lang.String p_Key)
IStatistic
getIndex
in interface IStatistic
p_Key
- feature name
public java.lang.String getKey(int p_Index)
IStatistic
getKey
in interface IStatistic
p_Index
- feature index
public int size()
IStatistic
size
in interface IStatistic
public java.lang.String getType(int p_Index)
IStatistic
getType
in interface IStatistic
p_Index
- feature index
public java.lang.String getType(java.lang.String p_Key)
IStatistic
getType
in interface IStatistic
p_Key
- feature name
public java.util.List<java.lang.String> getValue(int p_Index)
IStatistic
getValue
in interface IStatistic
p_Index
- feature index
public java.util.List<java.lang.String> getValue(java.lang.String p_Key)
IStatistic
getValue
in interface IStatistic
p_Key
- feature name
public void clear()
IStatistic
clear
in interface IStatistic
public java.util.Set<java.lang.String> getTags()
IStatistic
getTags
in interface IStatistic
public java.util.List<java.lang.String> getTagsInOrder()
IStatistic
getTagsInOrder
in interface IStatistic
public int getTagCount(java.lang.String p_Tag)
IStatistic
getTagCount
in interface IStatistic
p_Tag
- tag name
public java.lang.String getDefaultValue()
IStatistic
getDefaultValue
in interface IStatistic
public int getCount(java.lang.String p_Key, java.lang.String p_Value, java.lang.String p_Tag)
IStatistic
getCount
in interface IStatistic
p_Key
- feature namep_Value
- feature valuep_Tag
- tag
public int getCount(int p_KeyIndex, java.lang.String p_Value, java.lang.String p_Tag)
IStatistic
getCount
in interface IStatistic
p_KeyIndex
- feature indexp_Value
- feature valuep_Tag
- tag
public boolean isProcessed()
IStatistic
isProcessed
in interface IStatistic
public void select(IFeatureSelector p_Selector)
IStatistic
select
in interface IStatistic
p_Selector
- feature selectorprotected void check()
protected void remove(int p_FeatureIndex)
p_FeatureIndex
- feature indexprotected void remove(int p_FeatureIndex, java.lang.String p_Value)
p_FeatureIndex
- feature indexp_Value
- feature value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |