Package org.lionsoul.jcseg
Interface IDictionary
-
- All Known Implementing Classes:
ADictionary,HashMapDictionary
public interface IDictionaryCommon interface for Dictionary- Author:
- lionsoul
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIDictionary.Type
-
Field Summary
Fields Modifier and Type Field Description static IDictionary.TypeHASHMAPSegmentation type constants
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IWordadd(int t, String key, int type)add a new word to the dictionaryIWordadd(int t, String key, int fre, int type)add a new word to the dictionaryIWordadd(int t, String key, int fre, int type, String[] entity)add a new word to the dictionary with its statistics frequencyIWordadd(int t, String key, int type, String[] entity)add a new word to the dictionaryIWordadd(int t, IWord word)directly add a IWord item to the dictionaryIWordget(int t, String key)return the IWord associate with the given key.booleanmatch(int t, String key)loop up the dictionary, check the given key is in the dictionary or notvoidremove(int t, String key)remove the mapping associate with the given keyintsize(int t)return the size of the dictionary
-
-
-
Field Detail
-
HASHMAP
static final IDictionary.Type HASHMAP
Segmentation type constants
-
-
Method Detail
-
match
boolean match(int t, String key)loop up the dictionary, check the given key is in the dictionary or not
-
add
IWord add(int t, String key, int fre, int type, String[] entity)
add a new word to the dictionary with its statistics frequency
-
get
IWord get(int t, String key)
return the IWord associate with the given key. if there is not mapping for the key null will be return
-
remove
void remove(int t, String key)remove the mapping associate with the given key
-
size
int size(int t)
return the size of the dictionary
-
-