IFELanguage2::GetMorphResult Method

This method is used to get morphological analysis results. Before you use this function, call IFELanguage2::Open Method once for initialization.

Parameter Description

DWORD dwRequest

(IN) A request for conversion
FELANG_REQ_CONV
FELANG_REQ_RECONV
FELANG_REQ_REV

DWORD dwCMode

(IN) Any combination of the values below is possible, which determines the conversion output characters and some conversion options:

FELANG_CMODE_MONORUBY
FELANG_CMODE_NOPRUNING
FELANG_CMODE_KATAKANAOUT
FELANG_CMODE_HIRAGANAOUT
FELANG_CMODE_HALFWIDTHOUT
FELANG_CMODE_FULLWIDTHOUT
FELANG_CMODE_BOPOMOFO
FELANG_CMODE_HANGUL
FELANG_CMODE_PINYIN
FELANG_CMODE_PRECONV
FELANG_CMODE_RADICAL
FELANG_CMODE_UNKNOWNREADING
FELANG_CMODE_MARGECAND
FELANG_CMODE_ROMAN
FELANG_CMODE_BESTFIRST
FELANG_CMODE_USENOREVWORDS
FELANG_CMODE_NONE
FELANG_CMODE_PLAURALCLAUSE
FELANG_CMODE_SINGLECONVERT
FELANG_CMODE_AUTOMATIC
FELANG_CMODE_PHRASEPREDICT
FELANG_CMODE_CONVERSATION
FELANG_CMODE_NAME
FELANG_CMODE_NOINVISIBLECHAR

INT cwchInput

(IN) Number of characters of ptchInput

WCHAR *pwchInput

(IN) Original input characters to be converted by morphology engine
NULL means to get the next entry for the previously given string, with the next rank
This must be a UNICODE string
The order in which next entries are returned is defined by an implementation

DWORD *pfCInfo

(IN) Means the information for each column (ptchInput[x]); pfCInfo[x] (column info) can be a combination of the flags below:

FELANG_CLMN_WBREAK
FELANG_CLMN_NOWBREAK
FELANG_CLMN_PBREAK
FELANG_CLMN_NOPBREAK
FELANG_CLMN_FIXR
FELANG_CLMN_FIXDNULL can be used, which means all pfCInfo[] are FALSE (no request from client)

MORRSLT **ppResult

(OUT) Address of an MORRSLT structure that receives morphology result data
GetJMorphResult() allocates memory (using the OLE task allocator) for the returned data, and sets the pResult to point to the memory
The application must free the memory pointed to by pResult, by using the CoTaskMemFree function

Return

Values

HRESULT

S_OK:
More candidates exist (if you call this function with ptch
Input NULL, it will get the next best candidate for the previous ptchInput)S_FALSE: Fails to create result
E_NOCAND: No more candidates
E_LARGEINPUT: Too large input
ERROR_SEM_TIMEOUT: Mutex timeout is happened.

dwRequest—Request for Conversion

FELANG_REQ_CONV is used to get a composition string from a string with Japanese phonetic characters. This request requires that the input string is a string with Japanese phonetic characters that doesn't have any ideographic character.

FELANG_REQ_RECONV is used to get a composition string from a composition string. This request is to get a re-conversion result from a conversion result.

FELANG_REQ_REV is used to get a string with Japanese phonetic characters from a composition string. On this request, the contents of WDD[n].wDispPos and WDD[n].wReadPos are exchanged.

MORRSLT.pwchRead is used as the source of reverse conversion.

pfCInfo is information relating to an input in each column.

Any combination of the flags below can be set for each column of an input string:

FELANG_CLMN_WBREAK

PwchInput[x] is forced to be the start of the word in analysis.

FELANG_CLMN_NOWBREAK

The result must not be divided here when IFELanguage makes a word. FELANG_CLMN_NOWBREAK always includes FELANG_CLMN_NOPBREAK.

FELANG_CLMN_PBREAK

PwchInput[x] is forced to be the start of a phrase in analysis. FELANG_CLMN_PBREAK always includes FELANG_CLMN_WBREAK.

FELANG_CLMN_NOPBREAK

The result must not be divided here when IFELanguage makes a PHRASE.

FELANG_CLMN_FIXR

PwchInput[x] is used as a Japanese phonetic character in a conversion result on a FELANG_REQ_REV request. That is, the Japanese phonetic character of the conversion result is fixed to be ptchInput[x].

FELANG_CLMN_FIXD

PwchInput[x] is used as a display character in a conversion result on a FELANG_REQ_CONV request. That is, the display character of the conversion result is fixed to be ptchInput[x].

dwCMode—Conversion Mode

  • Any combination of the values below is possible. This determines the conversion mode.

  • FELANG_CMODE_MONORUBY: Makes a string with Japanese phonetic characters for mono-ruby wherever possible. If this flag is set, the returned result is put at paMonoBubyPos. This mode is valid when FELANG_REQ_REV is specified.

  • FELANG_CMODE_NOPRUNING: No pruning (filtering) in morphology analysis.

  • On input of Figure 1, it may return, for example, Figure 2(Figure 3 is the body part of Figure 4). This result is impossible grammatically, but with FELANG_CMODE_NOPRUNING, one can obtain this candidate.

  • FELANG_CMODE_KATAKANAOUT: Output is in Katakana (Japanese phonetic) characters when IFELANG_REQ_REV is specified.

  • FELANG_CMODE_HIRAGANAOUT: Output is in Hiragana (Japanese phonetic) characters when IFELANG_REQ_REV is specified.

  • FELANG_CMODE_ROMAN: Output is in Roman characters when IFELANG_REQ_REV is specified.

  • FELANG_CMODE_HALFWIDTHOUT: Output is in half-width characters.

  • FELANG_CMODE_FULLWIDTHOUT: Output is in full-width characters (default).

  • FELANG_CMODE_BOPOMOFO: Output is in Bopomofo (Taiwan phonetic) characters when IFELANG_REQ_REV is specified.

  • FELANG_CMODE_HANGUL: Output is in Hangul (Korean phonetic) characters when IFELANG_REQ_REV is specified.

  • FELANG_CMODE_PINYIN: Output is in Pinyin (Chinese phonetic) characters when IFELANG_REQ_REV is specified.

  • FELANG_CMODE_PRECONV: Performs the following conversion before the actual conversion. These are implementation defined:

  • ROMAN to phonetic characters, for example: [a] to [Figure 5]

    1. The auto collect before the conversion, for example: [Figure 7] to [-]

    2. The conversion of the punctuation mark and the brackets, for example: [Figure 6] to [,]

  • FELANG_CMODE_RADICAL: Japanese phonetic characters are returned in radical (CHN).

  • FELANG_CMODE_UNKNOWNREADING: Japanese phonetic characters are returned in unknown format. (CHN)

  • FELANG_CMODE_MERGECAND: The result strings (candidates) are merged when the strings are the same.

  • FELANG_CMODE_ROMAN (JPN): Enables the romaji-kana conversion.

  • FELANG_CMODE_BESTFIRST: Forces simple conversion to get better performance time rather than conversion accuracy.

  • FELANG_CMODE_USENOREVWORDS(JPN): Optional conversion using additional words (for example, reverse conversion from address to ZIP code)

  • FELANG_CMODE_NONE: Corresponds to the analysis in IME_SMODE_NONE

  • FELANG_CMODE_PLAURALCLAUSE: Corresponds to the analysis in IME_SMODE_ PLAURALCLAUSE

  • FELANG_CMODE_SINGLECONVERT: Corresponds to the analysis in IME_SMODE_SINGLECONVERT

  • FELANG_CMODE_AUTOMATIC: Corresponds to the analysis in IME_SMODE_AUTOMATIC

  • FELANG_CMODE_PHRASEPREDICT: Corresponds to the analysis in IME_SMODE_PHRASEPREDICT

  • FELANG_CMODE_CONVERSATION: Corresponds to the analysis in IME_SMODE_CONVERSATION

  • FELANG_CMODE_NAME(JPN): Name mode (same as FELANG_CMODE_PLAURALCLAUSE)

  • FELANG_CMODE_NOINVISIBLECHAR: When specified, remove invisible characters in output string. This flag is usually used for display purpose. Both CHN and TWN IME will return some spaces and invisible characters. (For example, First tone mark, U+02c9, in Bopomofo.) For these, however, invisible characters should be removed upon displaying.

NoteNote:

This function should not fail on any input (except memory full, and so on). In the worst case, this function returns a result with an unknown word.