Chidori is a Python dictionary for Plover that enables Japanese input with a steno keyboard in a Plover-like way.
It translates steno chords into romaji strings, which can then be used as input to a Japanese Input Method Editor (IME), like:
It is not necessarily built for speed like other Japanese steno theories, but just as a convenience for those who know Plover, have a steno keyboard, and want to input Japanese without having to switch keyboards. I hope that it can be at least a bit faster than using QWERTY with an IME.
In order to use this dictionary, you will need to install the Plover Python Dictionary plugin. This should be available from the Plugins Manager in your Plover dictionaries window.
Once you have installed Plover Python Dictionary, you should be able to add the
chidori.py
file to your Plover dictionaries in the same way you would a
JSON or Rich Text Format (RTF) dictionary.
In my dictionary stack, Chidori is disabled by default. I use Google IME-specific dictionary entries to toggle both the IME and Chidori at the same time whenever I want to write in JaPaNese:
"SKWR-PB": "{:COMMAND:TOGGLE_DICT:+chidori.py}{#CONTROL(SHIFT(J))}" # toggle JaPaNese on
"SKWR*PB": "{:COMMAND:TOGGLE_DICT:-chidori.py}{#CONTROL(SHIFT(SEMICOLON))}" # toggle JaPaNese off
The chords above use both the Plover Dict Commands plugin to toggle the
chidori.py
dictionary and Google IME commands to switch between its
Alphanumeric and Hiragana modes.
Feel free to use Chidori the way I do, or customise the switch from "English mode" to "Japanese mode" to your liking.
The romaji chords are intended to feel instinctive to those with a working knowledge of Plover and Japanese (I currently only have myself as a basis for these instincts, so I am happy to receive any feedback).
As a general rule, the romaji output uses Hepburn romanization, but Kunrei-shiki romanization is used if the number of characters output is less than Hepburn.
Uppercase chords are transformed into lowercase letters so they can be used as inputs to IMEs.
As per Plover fingerspelling conventions, vowels "A"
, "O"
, "E"
, "U"
are output as-is, and the "EU"
chord is transformed into "i"
.
Since Japanese does not have single-character long vowels (chōonpu), though, chording multiple vowels together just outputs the vowels in succession (which also allows for volitional form verb endings):
"AE": "ae"
"AO": "ao"
"AOEU": "aoi"
"AOU": "aou"
"AU": "au"
"OE": "oe"
"OEU": "oi"
"OU": "ou"
Any vowel sound can be stretched into a long vowel by using the prolong vowel
chord, -DZ
:
"ADZ": "aa"
"EDZ": "ee"
"EUDZ": "ii"
"ODZ": "oo"
"UDZ": "uu"
The initial consonant of a chord, stroked by the left half of the keyboard,
generally follows Plover fingerspelling conventions, and the specific
mappings for consonants that require more than one letter can be found
in the INITIAL_ROMAJI
constant.
"KA": "ka"
"TPHA": "na"
"PWA": "ba"
- etc...
Note that although "TPHA"
outputs "na"
, just stroking "TPH"
will output
"nn" for ん, and is considered a "standalone" chord for mapping to romaji.
Standalone mappings can be found in the STANDALONE_OUTPUT
constant.
Before checking for fingerspelling chords, there are a limited amount of "exception" chords that are matched against when determining an initial chord:
- Z-Chord: Since
"STKPW"
can be a bit heavy to stroke for characters beginning with "z" (eg"STKPWA": "za"
), theS*
chord is also accepted (eg"SA*": "za"
) - We and Wi (ゐ/ヰ, ゑ/ヱ): These characters might be nearly
obsolete, but since they are still seen around, we need a way to stroke them.
Their mappings are
"WE": "wye"
and"WEU": "wyi"
so that they can be used as input to IMEs - "Ti" compound character (てぃ/ティ): Input "ti" into an IME and you get
the output for "chi" (ち) as per Kunrei-shiki romanization. Since we
already have the Hepburn romanization-based chord
"KHEU"
for"chi"
, I think it makes sense to have the"TEU"
chord as a convenience chord to output"texi"
Yōon are two-character compounds typically ending with a small "ya", "yu", or "yo" (eg "kya" [きゃ], "shu" [しゅ], "cho" [ちょ] etc).
The fingerspelling chord for "y" is "KWR"
, which makes it impossible to
combine with some of the fingerspelling chords for characters that can be used
to form a yōon. So, taking some inspiration from plover_japanese_kana, I
decided to also use the R
key to indicate a small character (the key's
position on the steno keyboard also makes me think of the placement of the small
character at the bottom-right of the compound):
"KRA": "kya"
"TPHRU": "nyu"
"PHRO": "myo"
In order to stroke characters beginning with "ry"
, W
was added to make
"WRA": "rya"
.
In the intial chord, devoicing can be used in a limited way to naturally add an extra character in the chord, and hence a bit of efficiency, while still keeping with steno order:
"K": "ku"
(eg"KWA": "kuwa"
)"S": "su"
(eg"SKEU": "suki"
)"TP": "fu"
(eg"TPRAEU": "furai"
)
The mappings for any potential characters that could be made as a result of
strokes on the right-hand side of the keyboard can be found in the
FINAL_ROMAJI
constant.
Their allocations are arbitrary to the closest character for how I pronounced the Plover chord (or how they sound devoiced in my head), as well as some more inspiration from plover_japanese_kana:
"FPL": "-"
"FP": "ti"
"RB": "si"
"PBLG": "ji"
"PB": "nn"
"PL": "ma"
"BG": "ku"
"TS": "tu"
"F": "fu"
"R": "ru"
"P": "pu"
"B": "bu"
"L": "xtu"
"G": "gu"
"T": "ta"
"S": "su"
The D
and Z
keys are used in convenience chords for use cases that can occur
in Japanese.
The -D
chord is used to output a repeat of the chord stroked, rather than have
to stroke the chord twice.
For a singular vowel, it has the same effect as prolonging the vowel sound, but becomes more of a convenience when using it with one or more characters in a single chord:
"AD": "aa"
"EUD": "ii"
"KAD": "kaka"
"KAEUD": "kaikai"
The *D
chord works the same way as the Repeat Character chord, but it will add
a diacritic (dakuten) to the first character of the repetition to
indicate it should be "voiced" or a "harder" sound. Or, if the chord already has
a diacritic, the repetition will remove the diacritic sound.
"KA*D": "kaga"
"KA*EUD": "kaigai"
"TKPWA*EUD": "gaikai"
Note that going from dakuten to handakuten is prioritised over going from
dakuten to no diacritic, which means the following diacritic reversals are not
possible: "b": "h", "by": "hy"
The -Z
chord is used to modify the final vowel character in a chord into a
small character (sokuon):
"AZ": "xa"
"EUZ": "xi"
"KAZ": "xka"
"TUZ": "xtu"
The -DZ
chord is used to prolong the final vowel sound in a chord:
"ADZ": "aa"
"EUDZ": "ii"
"KADZ": "kaa"
"KAEUDZ": "kaii"
The *DZ
chord prolongs the final vowel sound in a chord with a sokuon:
"A*DZ": "axa"
"KA*DZ": "kaxa"
"KA*EUDZ": "kaixi"
-
Since Japanese does not have spaces between words, and kanji conversions via an IME can change the number of characters output, the
*
key's job is made harder, if not impossible(?). So, the dictionary simply maps it to the keyboard Backspace key. -
There is not a way to input handakuten on ka, ki, ku, ke, or ko using an IME to form the phonetic shift "nga" (か゚) etc sounds. There isn't even a way to input a dakuten or handakuten in isolation, so there is a set of strokes in Chidori that does this:
"TKABGT": "{^゙^}", # DAKuTen "TKHABGT": "{^゚^}" # HanDAKuTen
Given that the tests consist of making sure that chords are transformed into the expected romaji strings, Python subtests are heavily used.
Run tests:
python -m unittest