net.sourceforge.wohenchan.convert
Interface ConverterTableInterface

All Known Implementing Classes:
AbstractConverterTable, CompositeConverterTable, ConverterComposite, SunrainConverterTable, SystranConverterTable

public interface ConverterTableInterface

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:

I prefer the first possibility, because it seems more modular. Also, in the second possibility, it's not clear which of the behaviors is desired. We wouldn't support it on this level, to keep the interface simple, easy to implement, and consistent. In this proposal, we would support phrase lookup on a higher level. As an example of doing this, let's define:
 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.

Version:
$Name: $ $Date: 2003/06/23 06:16:40 $
Author:
$Author: wtanaka $

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

lookupByPinyin

public void lookupByPinyin(java.lang.String pinyin,
                           ConverterListener listener)
Deprecated. use lookup(String, LanguageInfoInterface, ConverterListener)

Looks up a dictionary entry by pinyin.

Parameters:
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 results

lookupBySimplifiedChinese

public void lookupBySimplifiedChinese(java.lang.String chinese,
                                      ConverterListener listener)
Deprecated. use lookup(String, LanguageInfoInterface, ConverterListener)

Looks up a converter table entry by simplified chinese characters.

Returns:
a non-null, possibly empty, array of results for this search.

lookupByTraditionalChinese

public void lookupByTraditionalChinese(java.lang.String chinese,
                                       ConverterListener listener)
Deprecated. use lookup(String, LanguageInfoInterface, ConverterListener)

Looks up a converter table entry by traditional chinese characters.

Returns:
a non-null, possibly empty, array of results for this search.

lookupByEnglishSubstring

public void lookupByEnglishSubstring(java.lang.String str,
                                     ConverterListener listener)
Deprecated. use lookup(String, LanguageInfoInterface, ConverterListener)

Locates ConverterEntryInterface objects corresponding to a given case insensitive English substring.

Returns:
a non-null, possibly empty, array of results for this search.