|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is a generalization of different transformations. Currently, the parameter being passed into the different methods is not very well defined. It seems like there are two main possibilities:
class AndLookup { ConverterTableInterface[] m_converterTables = (initialized somehow); public ConverterEntryInterface[] lookupEnglishPhrase (String english) { String[] words = (split english by spaces); Vector uniqueEntries = new Vector(); for (int i = 0; i < m_converterTables.length; ++i) { Vector[] entriesPerWord = new Vector[words.length]; // also initialize elements of entriesPerWord for (int wordNum = 0; wordNum < words.length; ++wordNum) { add the return value of m_converterTables.lookupEnglishBySubstring(words[wordNum]) to entriesPerWord[wordNum] ; } // if any words appear in every single vector in // entriesPerWord, then we know that the entry contains all // words searched for, so we add it to uniqueEntries } // convert uniqueEntries to an array and return that. } }We could get more complicated, removing words such as "and" and "the" stemming words might not work.. Hmm.
Method Summary | |
void |
lookupByEnglishSubstring(java.lang.String str,
ConverterListener listener)
Deprecated. use lookup(String, LanguageInfoInterface, ConverterListener) |
void |
lookupByPinyin(java.lang.String pinyin,
ConverterListener listener)
Deprecated. use lookup(String, LanguageInfoInterface, ConverterListener) |
void |
lookupBySimplifiedChinese(java.lang.String chinese,
ConverterListener listener)
Deprecated. use lookup(String, LanguageInfoInterface, ConverterListener) |
void |
lookupByTraditionalChinese(java.lang.String chinese,
ConverterListener listener)
Deprecated. use lookup(String, LanguageInfoInterface, ConverterListener) |
Method Detail |
public void lookupByPinyin(java.lang.String pinyin, ConverterListener listener)
pinyin
- The input string is specified in pinyin.
The string may be composed of the letters 'a'-'z' (lower case
only), the numbers '1'-'5' and space (' ').
The string is composed of at least 1 space-separated pinyin
syllables. Syllables are separated with exactly one space.
There is no leading or trailing space.
Each syllable is composed of at least two letters followed by
exactly one digit. The neutral tone is expicitly specified with
'5'.
u w/ umlaut (as in luu2 (donkey, palm tree), or luu3 (drizzle)
is specified with uu.listener
- the ConverterListener to which this object
should send its resultspublic void lookupBySimplifiedChinese(java.lang.String chinese, ConverterListener listener)
public void lookupByTraditionalChinese(java.lang.String chinese, ConverterListener listener)
public void lookupByEnglishSubstring(java.lang.String str, ConverterListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |