|
|||||||||
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 a default CEDict path. |
|
ChineseEnglishWordMap(String dictPath)
Make a ChineseEnglishWordMap |
|
ChineseEnglishWordMap(String dictPath,
boolean normalized)
Make a ChineseEnglishWordMap |
|
ChineseEnglishWordMap(String dictPath,
String pattern,
String delimiter,
String charset)
|
|
ChineseEnglishWordMap(String dictPath,
String pattern,
String delimiter,
String charset,
boolean normalized)
|
Method Summary | |
---|---|
int |
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)
|
static ChineseEnglishWordMap |
getInstance()
A method for getting a singleton instance of this class. |
Map<String,Set<String>> |
getReverseMap()
Returns a reversed map of the current 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, boolean normalized)
dictPath
- the path/filename of the CEDictnormalized
- whether the entries in dictionary are normalized or notpublic ChineseEnglishWordMap(String dictPath, String pattern, String delimiter, String charset)
public ChineseEnglishWordMap(String dictPath, String pattern, String delimiter, String charset, boolean normalized)
Method Detail |
---|
public static ChineseEnglishWordMap getInstance()
public boolean containsKey(String key)
key
- The word in Chinese
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 int 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 |