Commit Graph

12 Commits

Author SHA1 Message Date
zonble cb05937478 Fixes the order of the keyboard layouts.
Fixes #250.
2022-01-20 14:20:10 +08:00
Weizhong Yang a.k.a zonble 777994edcc Merge pull request #245 from lukhnos/update-copyright-headers
Update copyright headers (fixes #213)
2022-01-19 13:29:23 +08:00
Lukhnos Liu 75f321f088 Update copyright headers (fixes #213) 2022-01-18 14:21:55 -08:00
zonble 0d80d28e0e Formats Swift code. 2022-01-18 21:16:07 +08:00
zonble 29813f93e5 Adds test cases. 2022-01-18 17:05:51 +08:00
zonble 8249c612ff Adds a validator for candidate keys in the preference window. 2022-01-16 23:33:35 +08:00
zonble b627e8e3b6 Adds an option to let users to choose Chinse conversion style.
Option 0: converts the output.
Option 1: converts the models.
2022-01-16 15:04:20 +08:00
zonble 136ac34f22 Introduces in-place phrase replacement.
Since we have implemented the functions to add and exlcude phrases, the
commit allows users to use a table to change the output of a phrase
without changing its BPMF reading and score, when the "phrase replacement"
mode is on.

It could help users to switch a specific input scenario and the ordinary
one. For example, if a user wants to work on financial Chinese numbers
like 壹、貳、參, he or she may want the characters to have higher score
as the normal numbers like 一、二、三. The commit can let the users to
temporarily replace 一、二、三 to 壹、貳、參 by just turn on "phrase
replacement" mode and prepare a custom table.

The conversion is not done on the output phase like how we do
Traditional/Simplified Chinese conversion. What the phrase replacement
table does is to slightly modify the language model. The replacement
takes place on walking the nodes and candidates list.

A user can enable the mode and edit the table from the input menu. Since
the function is quite advanced, the menu items are hidden until the user
holds the option key.

The table is a plain text file. Each line contains a "from" and "to".
For example

```
一 壹
```

However, if the user also want all other phrase contain 一 to become 壹,
all of the phrases have to be built into the table

```
一百 壹佰
一千 壹仟
一萬 壹萬
一百萬 壹百萬
```
2022-01-15 06:23:09 +08:00
zonble 5ce581e0c6 Brings back VXHanConvert. 2022-01-14 22:15:17 +08:00
zonble 7a5cb635e9 Fixes the bugs in the preferences like typos. 2022-01-14 20:31:39 +08:00
zonble d11daacbd2 Refactors the keyboard layout enum. 2022-01-14 19:47:53 +08:00
zonble 9faed2153f Uses property wrappers to manage preferences. 2022-01-14 18:06:26 +08:00