Skip to content

Double Pinyin Flypy ^2024.07

Understanding Xiaohe Phonetics

Xiaohe Phonetics (小鹤音形) is a complete Chinese character input scheme consisting of two core parts:

ComponentDescriptionInput Method
Double PinyinEach initial and final is represented by one letter, expressing the sound of a Chinese character in two letters2 keys for sound
Double ShapeAccording to splitting rules, a Chinese character is split into two parts by radicals to distinguish homophones2 keys for shape

For example (referenced from Xiaohe Official Documentation):

Single CharacterFull PinyinDouble PinyinDouble ShapeFull Code
xiaoxnld丨丶xnld
hehedn丶鸟hedn
yinyblo立日yblo
xingxkkp开丿xkkp

Traditional Xiaohe Phonetics uses "four-code character determination": Double Pinyin 2 codes + Double Shape 2 codes = 4 codes for input. This method provides precise positioning but requires memorizing shape code rules, making the learning curve steeper.

Mint's Design Philosophy

Mint Input Method adopts a "Double Pinyin primarily, Shape Code auxiliarily" design approach:

Why not use Phonetics directly?

You might not believe it—the author doesn't know shape codes 😅

So I introduced it as auxiliary code, allowing users to experience the benefits of shape codes without being "held hostage" by four-code input. Conveniently, this design also:

  1. Lower learning curve: Regular users can use Double Pinyin normally without memorizing shape codes
  2. Use on demand: Shape codes serve as auxiliary positioning when encountering many homophones
  3. Flexible freedom: Use it when you want, ignore it completely when you don't

This design allows Mint to maintain Double Pinyin's efficiency while preserving shape code's precise positioning capability, while lowering the entry barrier.

Scheme Switching

Use the hotkey (Ctrl/Control + ~ or F4) to switch to "Xiaohe Double Pinyin - Mint Customization":

Switch and use Double Pinyin Flypy

After switching, you can use Xiaohe's Double Pinyin key layout for input. The dictionary is the same as "Mint Pinyin - Full Pinyin Input" (see the translator configuration in double_pinyin_flypy.schema.yaml).

Auxiliary Code Feature Details

What is Auxiliary Code?

Auxiliary code is an "optional" Chinese character positioning mechanism. After Double Pinyin input, enter auxiliary code mode through a specific activation key (default ;), then input shape codes to filter candidates.

Auxiliary Code

How Auxiliary Code Works

Mint implements auxiliary code functionality through a Lua filter. Core workflow:

User inputs Double Pinyin → Display candidates → Input ; to activate → Input shape code → Filter matching candidates

Configuration Interpretation (double_pinyin_flypy.schema.yaml):

yaml
filters:
  # ... other filters ...
  - lua_filter@*auxCode_filter@flypy_full   # Xiaohe Double Pinyin Auxiliary Code (Phonetic Shape)

This configuration means:

  • lua_filter: Use Lua filter
  • *auxCode_filter: Filter name (corresponds to lua/auxCode_filter.lua)
  • @flypy_full: Auxiliary code data file (corresponds to lua/aux_code/flypy_full.txt)

Auxiliary Code Data Files

Auxiliary code files are located in the lua/aux_code/ directory, format is Character=ShapeCode:

啊=kk
阿=ek
爱=py
安=bn

Mint includes three auxiliary code schemes:

FilenameApplicable SchemeDescription
flypy_full.txtXiaohe Double PinyinXiaohe Shape Code
ZRM_Aux-code_4.3.txtNatural CodeNatural Code Shape Code (default)
moqi_aux_code.txtOther Double PinyinMoqi Shape Code

Auxiliary Code Configuration

yaml
# Xiaohe Phonetic Shape Configuration
aux_code:
  # Activation code
  trigger_word: ";"
  # Mode to display auxiliary code
  # always:   Always display (default)
  # trigger:  Activate auxiliary code after entering activation code
  # none:     Never display auxiliary code
  show_aux_notice: "trigger"
ConfigurationOptionsDescription
trigger_wordAny character (default ;)Key to activate auxiliary code mode
show_aux_noticealwaysAlways display shape code hints for candidates
triggerDisplay shape code hints only after entering activation code
noneNever display shape code hints

Customizing Activation Key

If the default ; key is inconvenient (e.g., Android Little Penguin Input Method's symbol keyboard doesn't process through Rime), you can override via custom.yaml:

yaml
# double_pinyin_flypy.custom.yaml
# Rime schema
# encoding: utf-8

patch:
  # Set activation key to comma
  "aux_code/trigger_word": ","
  # Let comma participate in input (add to alphabet)
  "speller/alphabet": zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA~,

Effect after customizing the trigger key

Core Code

Shape Code Hints (OpenCC Character Splitting)

Besides auxiliary code positioning, Mint also supports displaying shape code hints through OpenCC character splitting filter:

yaml
# Crane Shape Splitting Auxiliary Filter
chaifen_cc:
  opencc_config: fly_Chaifen.json
  option_name: chaifen
  show_in_comment: true  # Whether to only display the conversion result in the comment
  comment_format:
    - "xform/ / /"
  tags:                  # Set its scope
    - abc
    - storkfly
    - reverse_lookup
  tips: char             # Add filter to single character: char; All: all

Use Ctrl+Shift+C to toggle this feature.

Auxiliary Code VS aux_code Shape Code

Note

OpenCC character splitting filter is for hint purposes only. Shape codes do not participate in actual candidate filtering. To position candidates via shape codes, please use the auxiliary code feature.

Scheme Comparison Summary

FeatureXiaohe Phonetics (Original)Mint Xiaohe Double Pinyin
Input MethodFour-code character determination (must input shape code)Double Pinyin + Optional auxiliary code
Shape Code RoleRequired, for positioningOptional, for auxiliary positioning
Learning CurveHigher (need to memorize shape codes)Lower (progressive learning possible)
Input EfficiencyHigh (precise positioning)Flexible (use on demand)

Mint's design allows users to:

  1. Beginner Stage: Use only Double Pinyin, completely ignore shape codes
  2. Intermediate Stage: Use auxiliary code for quick positioning when encountering homophones
  3. Advanced Stage: Efficient input with proficiency