|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.trees.international.pennchinese.ChineseEnglishWordMap
public class ChineseEnglishWordMap
A class for mapping Chinese words to English. Uses CEDict free Lexicon.
Constructor Summary | |
---|---|
ChineseEnglishWordMap()
Make a ChineseEnglishWordMap with the default CEDict path ("cedict_ts.u8") |
|
ChineseEnglishWordMap(String dictPath)
Make a ChineseEnglishWordMap |
|
ChineseEnglishWordMap(String dictPath,
String pattern,
String delimiter,
String charset)
|
Method Summary | |
---|---|
void |
addMap(Map<String,Set<String>> addM)
Add all of the mappings from the specified map to the current map. |
boolean |
containsKey(String key)
Does the word exist in the dictionary? |
Set<String> |
getAllTranslations(String key)
|
String |
getFirstTranslation(String key)
|
Map<String,Set<String>> |
getReverseMap()
return a reversed map of the current map |
static ChineseEnglishWordMap |
getStaticMap()
A method for getting the one static copy of the map. |
static void |
main(String[] args)
The main method reads (segmented, whitespace delimited) words from a file and prints them with their English translation(s). |
void |
readCEDict(String dictPath)
|
void |
readCEDict(String dictPath,
String pattern,
String delimiter,
String charset)
|
int |
size()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChineseEnglishWordMap()
public ChineseEnglishWordMap(String dictPath)
dictPath
- the path/filename of the CEDictpublic ChineseEnglishWordMap(String dictPath, String pattern, String delimiter, String charset)
Method Detail |
---|
public static ChineseEnglishWordMap getStaticMap()
public boolean containsKey(String key)
public Set<String> getAllTranslations(String key)
key
- a Chinese word
public String getFirstTranslation(String key)
key
- a Chinese word
public void readCEDict(String dictPath)
public void readCEDict(String dictPath, String pattern, String delimiter, String charset)
public Map<String,Set<String>> getReverseMap()
public void addMap(Map<String,Set<String>> addM)
public String toString()
toString
in class Object
public int size()
public static void main(String[] args) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |