IFELanguage Data Structure
August 2003
Microsoft Corporation
Summary: This document describes the IFELanguage data structure for the Microsoft IME 2003, Japanese version. (3 printed pages)
Contents
WDD (Word Descriptor)
MORRSLT (Sentence Descriptor)
WDD (Word Descriptor)
One WDD describes one word. All strings are assumed to be encoded in UNICODE. Part of Speech (POS) is dependent on an implementation of an IME that exports this interface. The POS of the Japanese version is defined in Parts of Speech.
// Word Descriptor
typedef struct tagWDD{
WORD wDispPos; // Offset to output string. To get actual string,
PMORRSLT->pwchOutput[wDispPos].
union {
WORD wReadPos; // Offset to reading string. To get actual string,
PMORRSLT->pwchRead[wReadPos].
WORD wCompPos;
};
WORD cchDisp; // Number of display characters
union {
WORD cchRead; // Number of reading characters
WORD cchComp;
};
DWORD nReserve; // Reserved
WORD nPos; // Part of speech, defined by IME implementations
WORD fPhrase : 1; // This word is the start of a phrase
WORD fAutoCorrect: 1; // Auto-corrected word
WORD fNumericPrefix: 1; // Numeric prefix word (Japanese only)
WORD fUserRegistered: 1; // This is from the user dictionary
WORD fUnknown: 1; // This is an unknown word to IME
WORD fRecentUsed: 1; // This is a recently used word
WORD :10; // Reserved
VOID *pReserved; // Reserved
} WDD;
MORRSLT (Sentence Descriptor)
The caller of
GetJMorphResult()
is always responsible for releasing the memory of this block using
CoTaskMemFree(). All strings are assumed to be encoded in UNICODE.
typedef struct tagMORRSLT {
DWORD dwSize; // Total size of this block
WCHAR *pwchOutput; // Conversion result string
WORD cchOutput; // Length of result string
union {
WCHAR *pwchRead; // Reading string
WCHAR *pwchComp;
};
union {
WORD cchRead; // Length of reading string
WORD cchComp;
};
WORD *pchInputPos; // index array of reading to input character
WORD *pchOutputIdxWDD; // index array of output character to WDD
union {
WORD *pchReadIdxWDD; // index array of reading character to WDD
WORD *pchCompIdxWDD;
};
WORD *paMonoRubyPos;
WDD *pWDD;
INT cWDD;
VOID *pPrivate;
WCHAR BLKBuff[];
}MORRSLT;
WORD*pchInputPos;
—Index of strings with Japanese phonetic characters to input characters; used only if the implementation needs a mapping of the input key character sequence and a phonetic character symbol sequence.
Example: "" Reading
chInputPos[] 0 X 3 4 6 8 9 1 3 wchInput[] |kyo|u|ha|te|n|ki|de|su|
Input characters of GetJMorphResult method call
|012|3|45|67|8|90|12|34|
Input character positions
'X' means the reading doesn't have a corresponding input character.
X:[FELANG_INVALD_PO]
WORD*paMonoRubyPos;
—Index of monoruby
Used if FELANG_CMODE_MONORUBY
is on; otherwise paMonoDubyPos
is NULL