Commit Graph

23 Commits

Author SHA1 Message Date
zonble 8de659f50b Adds an example for a symbol table in tree structure. 2022-12-17 14:03:10 +08:00
Lukhnos Liu 4aaef97296 Remove the Terminal.app workaround
It was needed in the early days of McBopomofo, but is no longer so.
2022-02-14 21:07:24 -08:00
zonble e85a33ce15 Fixes an Swift type conversion issue which happens while typing in Terminal app.
Fixes #288.
2022-02-15 10:57:06 +08:00
Lukhnos Liu c2f45c2060 Make the half-width punctuations toggle work again 2022-02-13 19:22:45 -08:00
Lukhnos Liu ec98acc0b6 UI strings copyediting 2022-02-13 19:02:06 -08:00
Lukhnos Liu 02a475197d Move the Preferences menu item to the last group
So that it's closer to Check for Updates and About McBopomofo.
2022-02-13 18:40:46 -08:00
zonble 4d94bb0cd2 Automatically uses vertical candidate list if there is a long candidate. 2022-02-14 01:01:03 +08:00
zonble 08b92ae53b Fixes a typo. 2022-02-04 21:39:31 +08:00
Lukhnos Liu c18f497a55 Use backward-compatible Swift in certain places
Older Swift compiler does not allow declaring certain variables that
have the same names with those outside of their scope, even though the
scoping rules should allow them. This makes the code buildable with
Xcode 12.4 again.
2022-02-02 09:32:02 -08:00
zonble cac954a00b Updates test cases. 2022-02-02 20:29:23 +08:00
zonble bd291be340 Removes a log. 2022-02-02 01:33:22 +08:00
zonble cbdbfa2518 Prevents the key handler to see reserved keys like page up/down as BPMF keys. 2022-02-02 01:31:53 +08:00
zonble 5afc5defdd Shows a tooltip when then cursor in a phrase whose length and count of readings do not match.
McBopomofo allows users to input pheases with a different length of the
characters and Bopomofo readings, for example, users can input ∴ with ㄙㄨㄛˇ-ㄧˇ.
When the cursor if between ㄙㄨㄛˇ and ㄧˇ, the users have no clue where
the cursor exactly is. The tooltip is to tell the users the cursor is
now betwen ㄙㄨㄛˇ and ㄧˇ.
2022-02-02 01:04:49 +08:00
zonble 74509ce3cb Corrects the selection range while using Shift + Arrow keys to add new phrases. 2022-02-01 06:18:40 +08:00
zonble 169d03ab9b Minor changes on the associated phrases.
1. Removes the tooltip on the candidate window to make the exprience
   looks like OpenVanilla.
2. Adds a Shift key symbol on the key label.
2022-01-31 14:16:16 +08:00
zonble 2ebc789030 Implements the associated phrases function.
Since we use states manage the input flow in McBopomofo, implementing this function becomes easy. What I did is to create a new state, Associated Phrases state, and let the key handler to emit such a state just after emitting a Committing state.

When the input method controller is under Associated Phrase state, it shows the candidate window with a tooltip, and only accept candidate keys with the shift key. The key handler uses the characters without modifiers in an NSEvent object to find if there is any matching candidate label, so I added a new member "inputTextIgnoringModifiers" to KeyHandlerInput.

I use KeyValueBlobReader to read the associated phrases. I use the cin file from OpenVanilla project but removed the head and tail of the file to pass KeyValueBlobReader's validation.
2022-01-31 13:23:49 +08:00
zonble 1c339c622e Loads the user phrases just after the files are changes.
The revision uses a FSEventStream to monitor the change of the folder
that stores user phrases.
2022-01-31 04:29:53 +08:00
zonble 4681465a68 Fixes a typo. 2022-01-30 08:53:59 +08:00
zonble 5e19e70c70 Fixes a typo. 2022-01-30 08:07:34 +08:00
zonble 2c0a12f43f Lazy loads language models. 2022-01-30 08:06:22 +08:00
zonble c3d953c618 Converts input mode into a typed enum. 2022-01-30 08:06:22 +08:00
zonble 0b1975bfeb Converts test cases to Swift. 2022-01-30 08:06:22 +08:00
zonble 4c358c1c1d Converts InputMethodController to Swift. 2022-01-30 08:06:22 +08:00