net.sourceforge.wohenchan.convert
Interface ConverterEntryInterface

All Known Implementing Classes:
CedictEntry, DefaultConverterEntry

public interface ConverterEntryInterface

Represents one entry in a dictionary/encoding table/etc. In the future, it might be a good idea to add other methods, for the animated gifs found at ocrat.com, or the synthesized pronunciations from bell labs.

Instances of this object are normalized. For instance, if I had a table with the following entry:

 [ren3 shou4] /bear/endure/
 

this would be represented as two separate instances of ConverterEntryInterface:

Similarly, if I had the following entry:

 U+53AD  kMandarin       1 YAN4 2 YA1 3 YAN1
 

This would again be represented as separate instances (three) of ConverterEntryInterface:

Version:
$Name: $ $Date: 2003/06/22 18:10:48 $
Author:
$Author: wtanaka $
See Also:
ConverterTableInterface

Method Summary
 java.lang.String getChinese()
          Gets the unicode character string for this entry.
 java.lang.String getEnglishDefinition()
          Gets the English Definition for this character.
 java.lang.String getPinyin()
          Gets the Pinyin for this entry.
 java.lang.String getSource()
          Gets the source dictionary where this entry came from.
 

Method Detail

getChinese

public java.lang.String getChinese()
                            throws UnknownOutputException,
                                   NoRepresentationException
Gets the unicode character string for this entry.

Returns:
WHERE (self != null) the string (of unicode chars) for this entry.
Throws:
UnknownOutputException - if the particular dictionary or character table does have unicode information.
NoRepresentationException - if there is no Unicode representation for this character in this converter.

getEnglishDefinition

public java.lang.String getEnglishDefinition()
                                      throws UnknownOutputException,
                                             NoRepresentationException
Gets the English Definition for this character.

Returns:
WHERE (self != null) the english definition for this entry.
Throws:
UnknownOutputException - if the particular dictionary or character table does not have english information
NoRepresentationException - if there is no english definition for this entry.

getPinyin

public java.lang.String getPinyin()
                           throws UnknownOutputException,
                                  NoRepresentationException
Gets the Pinyin for this entry. 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.

Returns:
WHERE (self != null) the pinyin romanization for this entry.
Throws:
UnknownOutputException - if the particular dictionary or character table does not have pinyin information
NoRepresentationException - if there is no pinyin information for this entry.

getSource

public java.lang.String getSource()
Gets the source dictionary where this entry came from.

Returns:
WHERE (self != null) a human visible name for this entry's source (e.g. "CEDICT", "unicode.org", "Sunrain").