Skip to content
  • Jarkko Koivikko's avatar
    Add PinyinInputMethod · 4a66c529
    Jarkko Koivikko authored
    Added new PinyinInputMethod which is using the PinyinIME engine as
    backend. The PinyinIME is Apache 2.0 licensed.
    
    https://android.googlesource.com/platform/packages/inputmethods/PinyinIME/
    
    
    
    The pinyin input method is enabled by using CONFIG+=pinyin
    configuration flag on the qmake command line.
    
    Dictionaries
    ============
    
    The pinyin engine uses two kinds of dictionaries: sys_dict and usr_dict.
    
    The sys_dict is a pre-built dictionary containing a search model for
    Chinese words. The sys_dict is built using the dictionary tool included
    in the source tree.
    
    The sys_dict is deployed in to the
    $$[QT_INSTALL_DATA]/qtvirtualkeyboard/pinyin directory on the target
    system. This path will become the default location where the dictionary
    is searched in. The default location can be overridden by specifying
    an alternative path to the dictionary file in an environment variable
    QT_VIRTUALKEYBOARD_PINYIN_DICTIONARY.
    
    The usr_dict contains custom lemmas which the user is most frequently
    using. Initially, the usr_dict may not exist, in which case it is
    automatically created.
    
    The usr_dict is located at subdirectory qtvirtualkeyboard/pinyin
    under the location returned by
    QStandardPaths::writableLocation(QStandardPaths::ConfigLocation).
    
    Usage
    =====
    
    The pinyin input mode is activated by changing the input locale to
    zh_CN.
    
    Chinese words are entered by typing the phonetic form of the Chinese
    words and then selecting words from the selection list.
    
    The first item in the selection list always contains the complete
    phrase. By selecting the first item, the pinyin completes the entire
    phrase and ends the current input. The user can also select the
    entire phrase by pressing the space key.
    
    The subsequent items in the selection list are the segments comprising
    one or more Chinese words. By selecting segments of previously unknown
    lemma, the input method learns this by adding a new entry to the
    usr_dict. Once the user enters the same pinyin sequence again, the
    input method can suggest the same phrase as the first or the second
    item in the selection list.
    
    The characters sequences, which are not valid pinyin spellings,
    are displayed in lower case letters. The user can either delete
    these characters by pressing the backspace key, or select and accept
    them as input from the selection list.
    
    After the user completes the phrase, or moves the cursor in the
    text, the pinyin input can predict words by looking at text up to
    3 characters in history. In prediction mode the user is not
    required to select any items from the prediction list.
    
    The user can enter plain latin characters by accepting the input
    sequence with the return key.
    
    Change-Id: I46bfc0df112a4d9c892222916cb7455132dd5059
    Reviewed-by: default avatarMitch Curtis <mitch.curtis@digia.com>
    Reviewed-by: default avatarLiang Qi <liang.qi@digia.com>
    4a66c529