Commit Graph

473 Commits

Author SHA1 Message Date
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 b348a05735 Filters duplicated unigram values properly. 2022-01-16 15:04:18 +08:00
Lukhnos Liu d064f420e4 Use a parseless phrase db to speed up LM loading
We take advantage of the fact that no one is able to modify the phrase
databases shipped with the binary (guranteed by macOS's integrity check
for notarized apps), and we can simply pre-sort the phrases in the
database files.

With this change, we can speed up McBopomofo's language model loading
during the app initialization by about 500-800x on a 2018 Intel MacBook
Pro. The LM loading used to take 300-400 ms, but now it's done within a
sub-millisecond range (0.5-0.6 ms). Microbenchmarking shows that
ParselessLM is about 16000x faster than FastLM. We amortize the latency
during the query time, and even by deferring the parsing, ParselessLM is
only ~1.5x slower than FastLM, and both LM classes serve queries unedr 6
microseconds (that's 0.006 ms), which means the tradeoff only
contributes to neglible overall latency.

This PR requires some small changes to the phrase db cooking scripts.
Python 3 is now used and the (value, reading, score) tuples are
rearranged to (reading, value, score) and sorted by reading ("key"). A
header is added to the phrase databases to call out the fact that these
are pre-sorted.

clang-format is used to apply WebKit C++ style to the new code. This
also applies to KeyValueBlobReader that was added recently.

Microbenchmark result below:

```
---------------------------------------------------------------------
Benchmark                           Time             CPU   Iterations
---------------------------------------------------------------------
BM_ParselessLMOpenClose         17710 ns        17199 ns        33422
BM_FastLMOpenClose          376520248 ns    367526500 ns            2
BM_ParselessLMFindUnigrams       5967 ns         5899 ns       113729
BM_FastLMFindUnigrams            2268 ns         2265 ns       307038
```
2022-01-15 16:15:02 -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 7edf011e42 Fixes a typo. 2022-01-14 22:36:58 +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 aa325f73aa Fixes the typo for the enum of McBopomofo keys. 2022-01-14 20:18:45 +08:00
zonble 95648caa0c Simplifies the code to build the input menu. 2022-01-14 19:55:08 +08:00
zonble d11daacbd2 Refactors the keyboard layout enum. 2022-01-14 19:47:53 +08:00
zonble 83354f7c48 Adds icons for keyboard layouts in preference. 2022-01-14 19:37:48 +08:00
zonble 9faed2153f Uses property wrappers to manage preferences. 2022-01-14 18:06:26 +08:00
Lukhnos Liu c698c61432 Merge pull request #220 from lukhnos/custom-phrase-reader
Use a more tolerant parser for user phrases
2022-01-13 23:43:35 -08:00
Lukhnos Liu d6cc5479f6 Use a more tolerant parser for user phrases
A generic key-value blob reader, KeyValueBlobReader, is implemented to
allow more flexibility in user-editable files. For example, this allows
comments in the file, as well as tolerating leading or trailing spaces,
tabs, or even Windows CR LF line endings.

Unit tests are supplied for KeyValueBlobReader although they are not
part of the Xcode project. A separate CMakeLists.txt is provided.

UserPhrasesLM is refactored to use KeyValueBlobReader. A small stylistic
change is appiled to reduce "using namespace" uses, but otherwise no
major style changes were applied to UserPhrasesLM.

Please note that McBopomofo's user phrase LM uses the value in a
key-value pair as the reading, and the key as the actual "value". We
don't plan to change that order so that we don't have to migrate data.

std::string_view is used to allow efficient reference to char buffers
and interop with std::string (and so no c_str() is needed). C++17 is now
enabled for the project to enable the use of std::string_view.

Copyright headers are added to McBopomofoLM and UserPhrasesLM.
2022-01-13 23:27:31 -08:00
zonble fcdd59dd6b Wraps OpenCCBridge into a SPM package. 2022-01-14 00:57:41 +08:00
zonble e01eb46c9f Wraps InputSourceHelper to a SPM package. 2022-01-14 00:43:21 +08:00
zonble d4772ffa99 Adds notifier UI to notify user Chinese conversion on/off. 2022-01-13 23:38:56 +08:00
zonble a7e38b5b2d Fine-tunes tooltip UI. 2022-01-13 22:00:29 +08:00
zonble 366453820d Adds a tiny tooltop for shift-left/right selections. 2022-01-13 21:47:52 +08:00
zonble 4c1781d970 Renames half-size to half-width. 2022-01-13 19:59:49 +08:00
zonble 9cd2306313 Adds emacs-style hotkeys. 2022-01-13 19:57:08 +08:00
zonble 232a944953 Implements half-size punctuations. 2022-01-13 17:07:22 +08:00
zonble d590d748f8 Adds UserPhrasesLM for user phrases.
Since there is no probability information for users' custom phrases,
they should be stored in a format differs from data.txt. Using the same
format and FastLM to parse user phrases just because of laziness but it
is not the right way.

The pull request adds a new language model class to parse user phrases.
It also update the input method controller to adopt the new user phrase
format.
2022-01-12 16:53:51 +08:00
zonble f1e56a7e01 Lets McBopomofoLM to accept NULL as the parameter in loadUserPhrases. 2022-01-12 13:17:41 +08:00
zonble 84fc2f068b Removes unused code and fixes a typo. 2022-01-12 13:16:10 +08:00
zonble abdf97f652 Adds McBopomofoLM as the facade of three language models.
- main language model
- user phrases
- user excluded phrases
2022-01-12 12:26:24 +08:00
zonble 56896625e3 Removes unused comments. 2022-01-12 01:17:39 +08:00
zonble cbd21cbe1d Updates localization. 2022-01-12 01:10:39 +08:00
zonble ea36061a41 Implements excluding punctuations. 2022-01-12 00:36:55 +08:00
zonble 9b485b799c Implements excluding phrases. 2022-01-12 00:16:55 +08:00
zonble 144d133463 Adds Language Model Manager.
The reference of the global language models were stored in the class
InputMethodController, however, the global models are global but not a
part of the input method controller, and the input method controller
only use one of the models (McBopomofo/Plain Bopomofo). I guess it
somehow violates SRP and there should be a better place for the global
models.
2022-01-11 17:12:58 +08:00
zonble f339948219 Fixes duplicated code and typos. 2022-01-11 13:46:29 +08:00
zonble df3914eeed Fixes a minor bug in the new Swift app delegate. 2022-01-11 02:35:31 +08:00
zonble a7b2edcf26 Converts AppDelegate to Swift. 2022-01-11 02:22:13 +08:00
zonble 61e2751702 Converts candidate UI to a Swift package. 2022-01-11 01:07:17 +08:00
zonble 867a828722 Fixes minor layout issues. 2022-01-11 00:47:48 +08:00
zonble f7e927d67d Starts to use Swift candidate UI.
There are bugs still.
2022-01-11 00:30:02 +08:00
zonble a97cc5ca6c Converts VerticalCandidateController to Swift. 2022-01-11 00:03:32 +08:00
zonble 5aafe64751 Starts to convert candidate UI to Swift. 2022-01-10 22:01:40 +08:00
zonble ba6889fa63 Converts OVInputSourceHelper to Swift. 2022-01-10 22:01:40 +08:00
zonble 84849bdb3d Converts the preference and non modal view controller to Swift. 2022-01-10 22:01:40 +08:00
zonble 75a0f68a9c Fixes the bug that I forgot to create the user phrases folder.
There was a legacy user override model which creates a folder and a
plist file. If a user uses McBopomofo for years, the folder would
exist. However, when the old override model was removed, I forgot
to create the folder for the new user phrase file.

The bug would let the users with new installation of McBopomofo unable
to add user phrases.
2022-01-10 21:59:18 +08:00
zonble 6bdd2aab44 Fixes a bug on building the unigrams. 2022-01-09 13:00:19 -08:00
zonble b4276f0488 Fixes a bug on building the vector for unigrams from both global language model and user phrases. 2022-01-09 13:00:19 -08:00
zonble 1e5bad20c2 Removes unused references. 2022-01-09 08:38:32 -08:00
zonble 5b72e48a4e Minor fine-tunes on the preference window. 2022-01-09 08:38:32 -08:00
zonble 0af238ef79 Cleans-up unused logs. 2022-01-09 08:38:32 -08:00
zonble 3763688275 Fixes a typo. 2022-01-09 08:38:32 -08:00
zonble a5247d958c Makes it able to reload user phrases. 2022-01-09 08:38:32 -08:00
zonble e909dc20b5 Uses user phrases in the block builder. 2022-01-09 08:38:32 -08:00
zonble 6f761ecbcd Implements adding phrase from shift and arrow keys. 2022-01-09 08:38:32 -08:00
zonble 358462dff1 [WIP] Starts to work on the user phrases. 2022-01-09 08:38:32 -08:00
ovadmin 789d2a5687 計算選字事件時,若遇到常用標點,將標點視為句尾
如此一來標點後的單字詞,在計算時,等同於句首第一詞。
2022-01-06 18:28:37 -08:00
ovadmin aeb774a8ed 小幅重構重複的程式碼 2022-01-06 18:28:37 -08:00
ovadmin 2e8e78971c 傳統注音不要記住用戶選字 2022-01-06 18:28:37 -08:00
ovadmin eef6f8c0ce 加大用戶選字詞模型的容量跟半衰期 2022-01-06 18:28:37 -08:00
ovadmin 3e0e859feb 將用戶選字記憶機制整合入 InputMethodController 2022-01-06 18:28:37 -08:00
ovadmin d672136843 實作簡單的用戶選字記憶模型
這個模型基本上只是根據游標前的兩個 unigram 記憶當前的用戶選字。當有超過
一個以上的用戶選字時,則要給每個選字評分。評分標準是選字頻率乘上一個透過
半衰期遞減的最近選字經歷時間。如此一來我們在「少用但最近選過」及「常用但
最近少選」之間取得一個平衡。半衰期透過經驗法則決定。

目前這個簡易模型並不存入磁碟,因此下一次重開機後就會洗掉重來。目前這樣選
擇純粹是因為模型有半衰期,因此長時間存放後還是會遺忘。

這個模型的好處是對既有詞庫提供詞的影響很小,對於連續單字詞的 override 有
還不錯的幫助。如此對於人名、地名、公司名等專有名詞,應該可以減少選字的頻
率。這個模型應用起來的缺點是,如果用戶修改的字詞原來是個雙字詞,例如先前
的兩個 unigram 分別是 A, BB ,而用戶想改的是 BB 的第二個字,使選完後的三
個字分別是 A, B', C,這個 C 往往是記不起來的,但如果一開始用戶逐字選取,
亦即在 BB 只出現 B 時就選取 B' 然後再打 C ,則 A, B', C 這個組合往往能被
正確記憶。實際發生原因在此不討論,但跟底層所用的組字網架的架構有關。確實
要改進的話得要從底層重新架構來下手,但至少目前這個模型給的建議偏保守,不
至干擾原有的預設選字。衡諸得失,這個模型提供一些邊際上的改善,應該還是值
得採用的。
2022-01-06 18:28:37 -08:00
ovadmin a17438b67a 修正一些選字機制 C++ 檔案 #include 不完整的問題 2022-01-06 18:28:37 -08:00
ovadmin 3760d24350 移除早期的候選歷史記憶機制
這個機制從未正式發布,設計本身也有很多缺陷,因此決定移除。
2022-01-06 18:28:29 -08:00
zonble 23100153cc Adds an option to clear entire input buffer by ESC key.
This fixes #146.
2022-01-02 22:09:23 +08:00
Lukhnos Liu 25ea443891 Correctly locate a candidate panel's screen
Previously only the x value was used to determine the screen to which a
candidate panel should below. That was incorrect. The entire point needs
to be considered.

This fixes the same issue that affected OpenVanilla:
https://github.com/openvanilla/openvanilla/issues/49
2021-11-24 23:22:29 -08:00
Lukhnos Liu 5ff3efb385 Revert "Stop using IMK's showPreferences:"
This reverts commit 69e463958e.
2021-11-24 21:16:20 -08:00
Lukhnos Liu ad81de87a0 Bump version to 1.1 2021-11-23 22:55:21 -08:00
Lukhnos Liu 3a027ba8fb Update copyright years 2021-11-23 19:04:42 -08:00
Lukhnos Liu 75b4bfac31 Localize new strings
Also fine-tune the Chinese Conversion menu item text.
2021-11-23 19:04:42 -08:00
Lukhnos Liu 69e463958e Stop using IMK's showPreferences:
This turns out to be unreliable on macOS 12.
2021-11-23 19:04:42 -08:00
Lukhnos Liu c1bea8c382 Fix IME activation issues on macOS 12
We now let the Installer to call the TextInputSources API. Since macOS
12, users are prompted to allow enabling of third-party IMEs in
Preferences.app the momemnt TISRegisterInputSource or
TISEnableInputSource is called. By moving the activation to the
Installer, a user will clearly see that it's the Installer that wants to
enable the IME.

In addition, we had to make necessary changes so that on macOS 12 and
later, the Installer always enable the default input source. This is due
to the observation that the kTISPropertyInputSourceIsEnabled becomes
unreliable on macOS 12--it may be true even if the user has removed the
input mode from their active input mode list in Preferences.app.
2021-11-23 19:04:42 -08:00
Lukhnos Liu b85029dec1 Fix non-existent font in .xib 2021-11-22 20:51:24 -08:00
zonble 164705e6f3 Allows users to use left and right key to go to another candidate page in the vertical candidates list.
This fixes #61.
2021-11-20 22:43:23 -08:00
zonble e27f5babe1 Allows auto-commiting the first candidate when users input a punctuation in plan BPMF mode. 2021-11-20 22:43:23 -08:00
zonble 385638c3b9 Allows commit the first canidate while typing a punctuation in plain BPMF mode. 2021-11-20 22:43:23 -08:00
zonble c17d991718 Also applies Chinese conversion on popped text.
Fixes issue #172.
2021-11-20 18:14:08 -08:00
zonble 21252e6c55 Removes NSUserDefault for selection key if a user chooses to use the default setting. 2021-11-12 00:36:41 +08:00
zonble da8e6c6fa5 Adds selection key settings in the preference window. 2021-11-12 00:02:01 +08:00
zonble 723a8402ab Fixes typos. 2021-11-11 00:14:49 +08:00
zonble 1f8cd8d06f Updates SwiftOpenCC. 2021-11-10 21:38:04 +08:00
zonble c8bad0913b Removes unused code. 2021-03-01 22:48:46 +08:00
zonble f6c36fe325 Bridges SwiftyOpenCC to create a simple Chinese convertion function. 2021-03-01 22:43:02 +08:00
zonble 4e27b5ecfa Adopts modern Objective-C syntax. 2021-02-28 22:45:36 +08:00
zonble 6341270696 Coverts to Objective-C ARC. 2021-02-28 21:38:59 +08:00
zonble 0f05e245a5 Coverts to Objective-C ARC. 2021-02-28 21:30:10 +08:00
zonble 7626d21a90 Merge branch 'master' of github.com:openvanilla/McBopomofo 2020-12-21 00:31:49 +08:00
Lukhnos Liu b754acdf07 Bump to version 1.0 2020-10-28 12:42:55 -07:00
Lukhnos Liu 9cbcee5b1f Bump to 1.0-beta3 to prepare for 1.0 release 2020-10-19 20:27:33 -07:00
Lukhnos Liu c44db5b000 Provide the UI to disable auto update check (#80) 2020-10-19 20:25:39 -07:00
Lukhnos Liu 4d2cf36b61 Add a preferences key to disable update checks 2020-10-19 20:09:17 -07:00
Lukhnos Liu 60aa005e2d Upgrade preferences.xib format (zh-Hant only) 2020-10-19 20:02:01 -07:00
Lukhnos Liu 688ae64723 Bump to 1.0-beta2 to prepare for 1.0 release 2020-10-19 14:52:18 -07:00
Lukhnos Liu 81748ae7fe Enable explicit update check in Release builds 2020-10-19 14:51:05 -07:00
Lukhnos Liu 7e3ee1742d Bump to 1.0-beta1 to prepare for 1.0 release 2020-10-18 20:08:51 -07:00
Lukhnos Liu eae12c04b4 Update copyright years 2020-10-18 12:48:15 -07:00
Lukhnos Liu 56dbbbc3b7 Delete UpdateNotificationController
This unifies the version update checker's UI. It also allows us to show
detailed info for a new version.
2020-10-18 12:48:15 -07:00
Lukhnos Liu 3bc70769df Show no update available when checking explicitly
This imports OpenVanilla's OVNonModalAlertWindowController for the
alerts.
2020-10-18 12:48:14 -07:00
Lukhnos Liu 4adf3c1b42 Update keyboard and app icons 2020-10-18 12:48:08 -07:00
Lukhnos Liu 3ac018f6c0 Retire IconMaker 2020-10-17 06:23:49 -07:00
Lukhnos Liu 4c8270c42f Cancel candidate by Bksp or Del when Plain Bopomofo
Fixes #152
2020-10-17 06:19:47 -07:00
Lukhnos Liu a71b354908 Fix broken CI builds by guarding new API usage 2020-10-10 07:47:29 -07:00
Lukhnos Liu 2f2f18d9e0 Check if the translocated app is still mounted
This ensures that, after the Installer has killed the current input method
process, the Installer can tell if the translocated input method bundle is no
longer mounted. It turns out that getfsstat() may return cached results and a
call to statfs() is necessary.

This fixes the bug that the Installer did not always correctly report that a
new version of the input method has been installed over a previous version.
The bug only manifests when getfsstat() returns cached results. That seems to
be the case on newer versions of macOS.
2020-10-10 07:24:50 -07:00
Lukhnos Liu 7d13ea0b41 Use NSTableViewStyleFullWidth on supported macOS
This prevents the vertical candidate table view to use the inset style [1].

The full-width style serves the purpose. The inset style makes the first
candidate too further away from the cursor in the composing buffer.

[1] https://developer.apple.com/design/human-interface-guidelines/macos/overview/whats-new-in-macos/
2020-10-10 06:37:32 -07:00
Lukhnos Liu fa224c2657 Reset other nodes' fixed state when fixing a node
This fixes a bug that, when a span covers several nodes and a long node
has already been candidate-fixed, fixing a short node does not cause
the walk to reflect the result.

A concrete example:

1. type 高中生.
2. move the cursor to 中 and change to 鐘聲: 高鐘聲.
3. with cursor position unchanged, select the candidate to 忠.
4. the expected result should be 高忠生 but instead it is stuck with
   高鐘聲 due to the node representing "鐘聲" is still fixed.

Fixes #54
2020-10-09 22:16:06 -07:00
Lukhnos Liu 71b97f82b3 Simplify candidate fixing by moving code to Grid 2020-10-09 22:16:06 -07:00
Lukhnos Liu 40c45b0fd8 Fix the LSMinimumSystemVersion value 2020-10-09 22:16:06 -07:00
zonble 1b0a4bf5d9 Update the plist file. 2020-03-31 15:29:58 -07:00
zonble f5d4b04e1b Update the plist file. 2020-03-30 01:26:34 +08:00
Lukhnos Liu cdbdf8c683 Bump to 0.9.11 2019-10-28 23:42:39 -07:00
Lukhnos Liu 4f6d1acc43 Update Installer to support app notarization
Soon notarization will be required for Developer ID apps. This change allows
the Installer to run in two modes. The "dev mode" still builds the IME as
the prerequisite of the Installer and places the IME app bundle inside the
Installer's resources folder. That has been so since the beginning of this
project, and this continues to allow IME developers to test the input method.
On the other hand, if "McBopomofo-r$rev.zip" is placed in the NotarizedArchives
folder and McBopomofo is not built as a dependency of the Installer and the
app bundle is not copied to the resources folder, the Installer then can be
built as a notarizable app (otherwise Xcode wouldn't even let you submit it
for notarization).

To build the distributable Installer, notarize the IME app first, then zip the
app as McBopomofo-r$rev.zip and place that to the NotarizedArchives folder
under Source/Installer. Then build and submit the Installer for notarization.
This is in line with Apple's guideline in
https://developer.apple.com/documentation/xcode/notarizing_your_app_before_distribution/customizing_the_notarization_workflow
("If you distribute your software via a custom third-party installer, you need
two rounds of notarization.")

We don't expect that we make new Installers often enough, and therefore we
don't intend to automate this process via scripting.
2019-10-28 23:42:39 -07:00
Lukhnos Liu 7978a9efba Update composing buffer after candidate keys (#145)
Recent versions of Chrome started to rely on whether composing buffer
gets updated after an arrow key event to determine whether to dismiss
(force commit) the composing buffer and handle the arrow key event for
the omnibox URL suggestions.
2019-06-18 22:14:05 -07:00
Lukhnos Liu ea865c6a24 Fix a static analyzer warning 2018-12-01 06:58:42 -08:00
Lukhnos Liu 8437d23eaf Fix the remaining API deprecation warnings
This replaces the use of NSAlertPanel with a helper function, which in
turn uses NSAlert, which is the recommended way of showing alerts.
2018-12-01 06:58:24 -08:00
Lukhnos Liu 5ce1cc3f38 Bump to 0.9.10 2018-11-24 21:51:07 -08:00
Lukhnos Liu 7b77f66b55 Update copyright years 2018-11-24 21:50:24 -08:00
Lukhnos Liu 01baf0bb29 Fine-tune horizontal candidate UI for dark mode 2018-11-24 21:47:15 -08:00
Lukhnos Liu 39a7eca195 Fix license text for dark mode 2018-11-24 21:47:15 -08:00
Lukhnos Liu 1ca73fe794 Fix a memory leak in the installer 2018-11-24 21:47:15 -08:00
Lukhnos Liu 14c2e70f7b Use control background color for dark mode 2018-11-24 21:47:15 -08:00
Lukhnos Liu 8058f37fff Modernize project and bump min version to 10.10
32-bit architecture support is removed as a result.
2018-11-24 21:47:15 -08:00
ovadmin e065d6fa17 Fix incorrect unprintable ASCII handling (#139)
When Caps Lock is on and when the character code is not printable, we
should simply reject handling such character instead of absorbing it and
inserting the character to the client buffer--not all apps handle those
insertions.
2018-07-07 13:25:10 -07:00
ovadmin a83eb38c5f 版本更新至 0.9.9
* 修正在 macOS 10.13 上無法叫出偏好設定的問題
2017-09-19 20:45:24 -07:00
ovadmin 9be64e0a48 修正在 macOS 10.13 beta 上無法叫出偏好設定的問題
修正根據請參考以下連結:
3241c7f688
2017-09-04 21:21:09 -07:00
ovadmin 966221191b 版本更新至 0.9.8
* 詞庫更新、修正及調整 (#115, #117, #126 等)
* 在輸入法選單中使用「小麥注音」作為名稱 (#109)
* 版權年份更新
* 選字窗細微修正
* 安裝程式正式支援 macOS 10.12
* 移除 debug build 時自動安裝輸入法的 Xcode 設定
2017-04-30 01:33:40 -07:00
ovadmin 9e3e4701df 輸入法選單名稱改為「小麥注音」 (fixes #109) 2017-04-30 01:33:40 -07:00
ovadmin 4e42a48cd9 更新版權年份 2017-04-30 01:33:40 -07:00
ovadmin d6e1ba435c 更新選字窗元件,與 OpenVanilla 同步 2017-04-30 01:33:40 -07:00
ovadmin dd6ba14da5 Handle installation on macOS 10.12 correctly
The approach is derived from OpenVanilla.
2017-04-24 23:11:50 -07:00
Mengjuei Hsieh 1167792d82 bump version (#114) 2016-11-01 22:02:55 -07:00
Mengjuei b023fe22e5 revert info.plists 2016-10-26 22:06:39 -07:00
Mengjuei Hsieh d9348efb1e minor revision to reflect xcode changes (#112)
__weak
if (0)
2016-10-24 23:08:43 -07:00
Peter Dave Hello 92b620f417 using zopflipng to optimize png images 2016-06-18 10:24:22 +08:00
Lukhnos Liu ccd4cc1cab Bump to 0.9.6.11 2014-10-28 23:46:28 -07:00
Lukhnos Liu 8747e7d7c7 Fix vertical candidate highlight color on Yosemite 2014-10-28 23:36:01 -07:00
Lukhnos Liu 82acc456bc Bump to 0.9.6.10 2014-05-18 20:42:59 -07:00
Lukhnos Liu 5f19be59b4 Override keyboard layout correctly. Fixes #86.
Using numerous NSLog's led to the discovery that when McBopofomo lost
function (as described in #86), -setValue:forTag:client: was often called
not just on the context of the foreground app, but also on the contexts
of the background apps. This led to the theory that calling keyboard
layout override in that method (not a documented way of doing things
anyways) might corrupt the input method context. That we swapped out
language model and the builder when the method got called didn't help.

In this commit, we put back the keyboard layout override code to where
it belongs -- in -activateServer: -- and we now only swap the language
model and re-create the builder if the input method really changes (e.g.
from Bopomofo to Plain Bopomofo, or vice versa).

Similar defensive coding is also used in the function key handler in the
-handleEvent:client: method.
2014-05-18 20:41:53 -07:00
Lukhnos Liu 3640c9f55f Remove build warnings for preferences.xib
Disable "Auto Recalculates Cell Size" option, which is not supported
before OS X 10.8.
2014-05-18 18:11:52 -07:00
Lukhnos Liu b1627f95fe Bump to 0.9.6.9 2014-05-16 21:21:02 -07:00
Lukhnos Liu e406645893 Fix candidate window visual artifacts
* Use a built-in window level instead of the non-standard one
* Don't force the window to re-draw
* Defer orderFront: and orderBack:
2014-05-16 21:18:47 -07:00
Lukhnos Liu 28ca23b453 Switch to HTTPS version info endpoint 2014-05-16 21:16:39 -07:00
Lukhnos Liu b56508c55c Add a debug menu item for checking updates 2014-05-16 21:16:39 -07:00
Mengjuei 890451ff27 organization update, 加詞及注音修正 2013-11-23 14:41:13 -08:00
Mengjuei dc5a6d0a37 update filelist 2013-11-10 22:05:35 -08:00
Lukhnos Liu c324eda5a9 Bump to 0.9.6.8 2013-06-15 16:42:20 -07:00
Lukhnos Liu b4eea515c3 Fix Span removal bug when linked against libc++ 2013-06-14 23:54:37 -07:00
leafy7382 0240445af5 NSPropertyListFormat does not need an assignment before use, remove rvalue. 2013-02-17 01:10:43 +08:00
Lukhnos Liu e9c57947aa Bump to 0.9.6.7 2013-01-29 22:17:07 -08:00
Lukhnos Liu 07f663eb00 Correctly fix the vertical scroller redraw issue. 2013-01-29 22:16:42 -08:00
Lukhnos Liu 1033c74de6 Bump to 0.9.6.6 2013-01-25 08:54:55 -08:00
Lukhnos Liu 337b295950 Attempt to fix the redraw issue. 2013-01-25 08:54:34 -08:00
Lukhnos Liu 1445ac501e Bump to 0.9.6.5 2013-01-24 23:29:28 -08:00
Lukhnos Liu 55d2cb2868 Defer updating scroller. 2013-01-24 23:28:42 -08:00
Lukhnos Liu ad6118e141 Bump to 0.9.6.4 2013-01-16 21:43:53 -08:00
Lukhnos Liu 54f0113c0c Avoid layout when providing cell values (fixes #73)
-tableView:objectValueForTableColumn:row: may call -layoutCandidateView,
which in turn may force the table view to reload; the layout code
should only run after all cell values are provided for to break this
potential cycle.
2013-01-16 21:42:41 -08:00
Lukhnos Liu d8203c2547 Bump to 0.9.6.3 2012-12-13 19:51:28 -08:00
Lukhnos Liu 92e2d41eba Clean up reading buf at deactivation (fixes #72) 2012-12-13 19:50:04 -08:00
Lukhnos Liu 2cc115e894 Bump to 0.9.6.2 2012-12-12 20:32:51 -08:00
Lukhnos Liu c9bd9ab24b Fix xib warnings. 2012-12-12 20:32:51 -08:00
Lukhnos Liu 9448c1af48 Fix Plain Bopomofo regression (#71)
This is caused by a missing method. Our implementation for
-[NSObject(IMKServerInput) inputText🔑modifiers:client:] was changed
to handleEvent: in 0.9.5.

Interestingly, calling -inputText🔑modifiers:client: somehow worked
when we linked against OS X 10.7 SDK (that was the SDK the 0.9.5
distribution used). This is no longer true with OS X 10.8 SDK.
2012-12-12 20:32:50 -08:00
Lukhnos Liu fe182ba26b Bump to 0.9.6.1 2012-12-01 22:23:33 -08:00
Lukhnos Liu f30753d3aa Bump to 0.9.6 2012-11-18 01:29:25 -08:00
Lukhnos Liu 95405cc72b Add UI support for IBM layout. Fixes #67.
Also change the layout constant from 4 to 5 since 4 is taken by Pinyin
layout.
2012-11-18 01:29:20 -08:00
Mengjuei beee34b96c Enable IBM Keyboard Layout, no update to xib yet 2012-11-13 00:40:26 -08:00
Lukhnos Liu c300e9cc10 Detab source code. 2012-10-31 22:12:50 -07:00
Lukhnos Liu e68845381c Revise DFA for parsing language models. 2012-10-31 21:55:13 -07:00
Lukhnos Liu 31a1a042fe Enlarge maximum candidate list text size. 2012-10-31 20:58:24 -07:00
Lukhnos Liu 94b80c42e3 Fix potential leak of NSURLConnection. Fixes #69. 2012-10-23 20:39:13 -07:00
Lukhnos Liu fadf8d431e Support Home/End/Del in input buffer, fixes #63.
Also fix two subtle issues:

1. Enter (not Return) key now works in candidate list
2. Cursor index should be compared against builder's length, *not*
   composed string's length, because the former is counted in
   code point but the latter in UTF-16 units. The composed string's
   length might therefore be longer if the string contains
   codepoints > U+FFFF, which would cause the cursor mechanism to
   be off.
2012-09-18 22:34:00 -07:00
Lukhnos Liu d5b8160394 Bump version to 0.9.5. 2012-09-18 09:04:06 -07:00
Mengjuei 6f9d64eaeb preliminary update to the License. 2012-09-15 12:05:20 -07:00
Lukhnos Liu d4730068fa Handle Shift with function key layout overrides. 2012-09-12 22:13:53 -07:00
Lukhnos Liu a2ea20306c Support overriding function key keyboard layout. 2012-09-12 21:59:53 -07:00
Lukhnos Liu aa1ed26b58 Update application icon set. 2012-09-12 09:34:51 -07:00
Lukhnos Liu 181b9894e6 Update IconMaker. 2012-09-12 09:34:42 -07:00
Lukhnos Liu 404bde168d Remove equivalent key settings. 2012-09-11 22:10:05 -07:00
Lukhnos Liu 913024fa75 Ignore input mode enable issues. 2012-09-11 22:04:55 -07:00
Lukhnos Liu f3b55c5ad9 Bump version. 2012-09-11 22:00:59 -07:00
Lukhnos Liu b670784799 Fix path issuses in the project file. 2012-09-11 21:54:35 -07:00
Lukhnos Liu d1893b6a37 Correctly enable all input modes when upgrading. 2012-09-11 21:38:59 -07:00
Lukhnos Liu 362801eb6c Remove SimpleLM. 2012-09-10 23:27:00 -07:00
Lukhnos Liu f710f382d9 Fix leak. 2012-09-10 23:12:09 -07:00
Lukhnos Liu d4cf55af9c Update app icon set. 2012-09-10 23:08:13 -07:00
Lukhnos Liu 879277f5f1 Bump version. 2012-09-10 22:57:15 -07:00
Lukhnos Liu 08e7b14f3e Use the new LM class. 2012-09-10 22:56:21 -07:00
Lukhnos Liu 67775e3ccf Implement an mmap-based LM parser. 2012-09-10 22:55:40 -07:00
Lukhnos Liu bf50e4fa7e Fix a punctuation bug in Plain Bopomofo mode.
Bopomofo keyboard layout-specific punctuation keys were not handeled
properly. The candidates are now correctly collected.
2012-09-10 19:12:57 -07:00
Lukhnos Liu 71921b848a Use stable sort in the engine.
So that unigram nodes with the same log probability are sorted
according to the order in which they were added to the language
model.
2012-09-10 19:02:24 -07:00
Lukhnos Liu 7b4568e152 Load Plain Bopomofo data. 2012-09-10 19:02:21 -07:00
Lukhnos Liu 10ff94e141 Bump version. 2012-09-09 13:16:07 -07:00
Lukhnos Liu 5c421c4b5d Improve Plain Bopomofo icons. 2012-09-09 13:12:39 -07:00
Lukhnos Liu 0587cad7ee Improve icon maker. 2012-09-09 12:59:35 -07:00
Lukhnos Liu 4cf94d5824 Support customizable alphanumeric keyboard layout.
Also make the default candidate font size bigger.
2012-09-09 12:36:04 -07:00
Lukhnos Liu 1c91498166 Restart SystemUIServer if upgrading from 0.9.4 or lower. 2012-09-09 11:43:56 -07:00
Lukhnos Liu 31f796f620 Implement the Plain Bopomofo mode. 2012-09-09 01:58:42 -07:00
Lukhnos Liu 6a5cd2a38a Create the mode for Plain Bopomofo. 2012-09-09 01:58:41 -07:00
Lukhnos Liu aa7ee150db Remove 64x64 icon generation from the icon maker. 2012-09-08 22:39:21 -07:00
Lukhnos Liu 34db8e75b7 Use the new iconset format to provide app icons. 2012-09-08 22:35:46 -07:00
Lukhnos Liu 1cc76c3c28 Add the icon set for another input mode. 2012-09-08 22:18:37 -07:00
Lukhnos Liu d6a14ffb76 Add a new input sources preferences menu iconset. 2012-09-08 22:17:22 -07:00
Lukhnos Liu f4f3a19447 Expand the icon maker. 2012-09-08 22:02:35 -07:00
Lukhnos Liu 484fbf54c8 Create a separate project for IconMaker. 2012-09-08 20:27:57 -07:00
Lukhnos Liu 2ebddfc29d Bump version. 2012-09-08 19:28:19 -07:00
Lukhnos Liu 37f31364b5 Project reorganization.
This commit:

* Creates a new top-level Xcode project file
* Renames remaining Lettuce (the original codename) uses to McBopomofo
* Renames English.lproj (the old style locale name) to en.lproj
2012-09-08 19:28:15 -07:00
Lukhnos Liu 51bd291ee5 Add retina icon. 2012-09-04 00:53:20 -07:00
Lukhnos Liu 176ecb74ff Use IconMaker to create retina icon. 2012-09-04 00:52:13 -07:00
Lukhnos D. Liu 6525894cb5 Bump versions. 2012-08-01 22:15:30 -07:00
Lukhnos D. Liu 173e159623 Rename the installer target to work around Xcode archiving issues. 2012-08-01 22:12:29 -07:00
Lukhnos D. Liu 13e0dca79b Add a native installer and bump version. 2012-08-01 21:47:36 -07:00
Mengjuei 550b952afe consider the situation of 10.8 2012-07-30 21:06:49 -07:00
Lukhnos D. Liu ddbd94bee4 Extract the candidate handler; handle subtleties of vertical text mode.
Now both Left and Right can be used as choose-candidate key. Also the
candidate window now doesn't obscure the vertical text being typed by
moving to the right to the vertical text. Because of this, Left key
feels strange. Adding Right key should give a better mental model.
2012-05-06 16:19:33 -07:00
Lukhnos D. Liu c48d478b4e Move enums to the top of the file. 2012-05-06 15:56:21 -07:00
Lukhnos D. Liu 6f2d617bcb Rename global variables. 2012-05-06 15:55:35 -07:00
Lukhnos D. Liu b369106719 Add Home/End key support in candidate panels. 2012-05-06 15:52:45 -07:00
Lukhnos D. Liu 1993942cd4 Refactor the code so that we use enums for key codes. 2012-05-06 15:52:45 -07:00
Lukhnos D. Liu f457b9d463 Fix a bug where the sink key handler missed a rejection condition. 2012-05-06 15:52:44 -07:00
Lukhnos D. Liu c52d68ed9e Correct the pref key names. 2012-04-08 15:16:04 -07:00
Lukhnos D. Liu 36b5a605dc Fix the bug that kCandidateTextFontName and kCandidateKeyLabelFontName shared the same value. 2012-04-08 15:12:26 -07:00
Lukhnos D. Liu 1693dc210e Add support for changing candidate keys and candidate panel fonts. 2012-04-08 15:08:53 -07:00
Lukhnos D. Liu c676d0d62c Handle the case where text client fails to handle char attr request. 2012-04-07 01:14:55 -07:00
Lukhnos D. Liu e4c54e6bb9 Edit comment. 2012-03-29 21:07:45 -07:00
Lukhnos D. Liu 005437db28 Handle the case when the vertical candidate data source is gone. 2012-03-29 21:04:30 -07:00
Lukhnos D. Liu b0b5dd0233 Remove CJK font requirement as OS X 10.7 already handles fallback better. 2012-03-29 20:57:16 -07:00
Lukhnos D. Liu b0e7e7032f Adjust layout parameters. 2012-03-29 20:06:42 -07:00
Lukhnos D. Liu 9c3623f19a Change compiler settings. 2012-03-29 12:19:17 -07:00
Lukhnos D. Liu 815f885e29 Improve UI parameters. 2012-03-29 12:19:00 -07:00
Lukhnos D. Liu dd43b08d82 Handle out-of-screen conditions. Improve drawing code. 2012-03-29 12:17:56 -07:00
Lukhnos D. Liu b492cb1f10 Fix a text wrapping issue in the vertical candidate panel. 2012-03-29 01:09:52 -07:00
Lukhnos D. Liu 810782bc77 Fix a mismatched synthesized property. 2012-03-29 00:32:20 -07:00
Lukhnos D. Liu 9128ef95b2 Use Voltaire for candidate UI; use 10.7 base SDK. 2012-03-28 23:28:42 -07:00
Lukhnos D. Liu 7d5cd8173c Import the Voltaire (commit 152775fc) project to replace IMK candidate UI. 2012-03-28 23:25:12 -07:00
Mengjuei 3ed20c1743 Python style update 2012-03-21 00:01:17 -07:00
Mengjuei abfcbe4a4e tag 0.9.3
1. bugfixes with software like Excel and TextWrangler
2. bugfixes with keystroks like Capslock and Shift
3. huge revision of phrase list
4. revision to frequency calculation
2012-03-20 00:31:14 -07:00
Mengjuei b7a74e5593 revision.... 2012-03-01 23:47:06 -08:00
Mengjuei 0d8e1ae20f Tab conversion into 4 spaces 2012-02-26 20:53:51 -08:00
Mengjuei 8e5c540597 reorganizing the layout 2012-02-26 16:30:59 -08:00
Mengjuei 373c631036 cosmetic change and change the location of the user dictionary 2012-02-26 16:24:09 -08:00
Mengjuei da5d323082 reorginzing Makefile 2012-02-26 14:28:28 -08:00
Mengjuei 82ead6dd72 [NSEvent modifierFlags] is out of place, eliminated. D.
+some phrases from the old notebook. M.
2012-02-25 01:19:44 -08:00
Mengjuei 61e2ed10d2 Solves Issue #44 2012-02-21 22:38:30 -08:00
Mengjuei 083660e708 update information 2012-01-15 20:49:56 -08:00
Mengjuei e4715a3ed1 Avoid a bug that commits wrong stuff... 2011-12-02 01:50:57 -08:00
Mengjuei d7ef219843 filename change 2011-11-22 22:35:19 -08:00
Mengjuei 130ec614dd git rev-list master | wc -l
forgot ...
2011-10-20 16:40:17 -07:00
Mengjuei 84a8e68c5d v0.9.2 2011-10-20 15:53:47 -07:00
Mengjuei 7476edf12a 最多使用六個自來組成一個詞 2011-10-18 16:06:51 -07:00
zonble c9d0378cd5 Cleans-up InputMethodController.mm. 2011-10-18 22:26:55 +08:00
Mengjuei a230705bbd comments 2011-10-17 02:55:27 -07:00
Mengjuei 872b4ffc5d This solves https://github.com/mjhsieh/McBopomofo/issues/22 2011-10-17 01:09:28 -07:00
zonble e963286527 Modifies the script to generate Credits.rtf. 2011-10-17 14:34:48 +08:00
zonble 8991ddfa4e Fixes a regression caused by trying to fix the problem of th numeric pad. 2011-10-17 13:57:38 +08:00
zonble a263f5739e Modifies the script to generate Credits.rtf. 2011-10-17 13:19:32 +08:00
zonble a9095f8dac Handles the number keyboard correctly. 2011-10-17 10:29:47 +08:00
zonble 22cd4faf77 Creates a RTF file while building. 2011-10-17 01:47:03 +08:00