Commit Graph

997 Commits

Author SHA1 Message Date
ShikiSuen 3ca7410316 Repo // Stop using didSet in cassettePath property.
- It doesn't work in some cases.
2022-12-17 14:54:49 +08:00
ShikiSuen f94ecf5fda Repo // Implementing reverse-lookup, requiring macOS 10.15 and later.
- Prefs & PrefUI // Add reverse-lookup toggle.
2022-12-17 14:54:49 +08:00
ShikiSuen 6e67a5edc8 AppDelegate // Again always load cassette data on startup. 2022-12-17 14:54:49 +08:00
ShikiSuen 9e857b80d4 Repo // Turn currentLM and currentUOM into dynamic var. 2022-12-17 14:54:49 +08:00
ShikiSuen 60b3fcf625 PrefMgr // Remove redundant LMMgr.loadCassetteData(). 2022-12-17 14:54:49 +08:00
ShikiSuen 78af4b72c2 SessionCtl // Add comments regarding upstream issue 346 and UPR347. 2022-12-17 14:54:49 +08:00
ShikiSuen d35b958f16 SessionCtl // Disable reloading on hotkey-toggling cassette mode.
- ... unless it is not loaded.
2022-12-17 14:54:49 +08:00
ShikiSuen d5fbcf5e2c Repo // Comment updates. 2022-12-17 14:54:49 +08:00
ShikiSuen 234819030c Repo // Fix informativeText localization when cassette path error. 2022-12-17 14:54:49 +08:00
ShikiSuen baaa563c45 AppDelegate // Only load cassette on startup if it is enabled. 2022-12-17 14:54:49 +08:00
ShikiSuen c5263bac1c PrefMgr // Change default candidate font size back to 16. 2022-12-17 14:54:49 +08:00
ShikiSuen 9220c7f846 InputHandler // Implement wildcard key support.
- Let wildcard key function as the end key.
- Warns about incorrect wildcard key inputs.
2022-12-17 14:54:49 +08:00
ShikiSuen 4e124e6aac Repo // Let tooltip window auto-disappear after given seconds. 2022-12-17 14:54:49 +08:00
ShikiSuen 751824feef Repo // Better handling with tooltip colors. 2022-12-17 14:54:49 +08:00
ShikiSuen 6060cc4fbf SessionCtl // Clear tooltip when necessary. 2022-12-17 14:54:49 +08:00
ShikiSuen d1bd34ee43 SessionCtl // Show non-empty tooltip on .ofEmpty() state. 2022-12-17 14:54:49 +08:00
ShikiSuen 27061754d6 PrefUI & PrefWindow // Allow CIN2 & VCIN files to be selected. 2022-12-17 14:54:49 +08:00
ShikiSuen dfcb99eebe InputHandler // Force ASCII raw output in cassette mode. 2022-12-17 14:54:49 +08:00
ShikiSuen f0866a816c PrefUI & PrefWindow // Japanese localization fix. 2022-12-17 14:54:49 +08:00
ShikiSuen b59b8d5345 LMMgr // Fix malfunctioned loadCassetteData(). 2022-12-17 14:54:49 +08:00
ShikiSuen da68e12ff3 CCBridge // Add vertical ellipse symbol conversion. 2022-12-17 14:54:49 +08:00
ShikiSuen 4a7d165ab6 PrefUI & PrefWindow // Add settings regarding cassette mode. 2022-12-17 14:54:49 +08:00
ShikiSuen c0ef70fe0d InputHandler // Implement stroke composition support. 2022-12-17 14:54:49 +08:00
ShikiSuen 23e02b9132 SessionCtl // Prompt cassette mode in TDK candidate window. 2022-12-17 14:54:49 +08:00
ShikiSuen 0b8a61d1ad CheatSheet // Add hotkey descriptions regarding CIN cassette mode. 2022-12-17 14:54:49 +08:00
ShikiSuen 10695d6e63 SessionCtl // Add menu item for toggling cassette mode, etc. 2022-12-17 14:54:49 +08:00
ShikiSuen 49f9a3c995 SessionCtl // Force ABC layout if needed when Cassette mode is ON. 2022-12-17 14:54:49 +08:00
ShikiSuen f2c5a5297a Repo // LMMgr.loadCassetteData() when necessary. 2022-12-17 14:54:49 +08:00
ShikiSuen 1174a08360 LMMgr // Connecting properties regarding Cassette module. 2022-12-17 14:54:49 +08:00
ShikiSuen c3757e2ac3 SessionCtl // Sync cassette mode status when necessary. 2022-12-17 14:54:49 +08:00
ShikiSuen 8e03fb2469 CCBridge // Add cassetteConvert(). 2022-12-17 14:54:49 +08:00
ShikiSuen 8b8ebbf14f Prefs // Add properties regarding Cassette module. 2022-12-17 14:54:49 +08:00
ShikiSuen 57d9c3f5e1 SessionCtl // Comment update. 2022-12-17 14:54:49 +08:00
ShikiSuen 9a3ecba927 PrefUI // Reload user lang models on enabling the monitor. 2022-12-17 14:54:49 +08:00
ShikiSuen fa32d8ac93 Repo // Implementing macOS System Preferences pane. 2022-12-17 14:54:49 +08:00
ShikiSuen a9c02f9904 Tekkon // hasToneMarker() -> hasIntonation(). 2022-12-17 14:54:49 +08:00
ShikiSuen 77f071eef5 Repo // Preferences -> SSPreferences. 2022-12-17 14:54:49 +08:00
ShikiSuen 88b0726448 SessionCtl // Stop switching to certain states if not prompted to. 2022-12-17 14:54:49 +08:00
ShikiSuen 29b89518c0 InputHandler // Simplify the arrow handling in handleInput(). 2022-12-17 14:54:48 +08:00
ShikiSuen 272bfef227 SessionCtl // Fix a conditioning in candidatePairSelected(). 2022-12-17 14:54:48 +08:00
ShikiSuen 19b0b138f2 InputHandler // Further simplification, etc.
- Removing certain useless cases of delegate.switchState(IMEState.ofEmpty()) right after ofCommitting().
- Divide handleComposition() for future purposes.
2022-12-17 14:54:48 +08:00
ShikiSuen 4860b52306 InputHandler // Simplifying inline rotation method. 2022-12-17 14:54:48 +08:00
ShikiSuen 2cf53d5c6a SessionCtl // Optimize handlings of Committing() state. 2022-12-17 14:54:48 +08:00
ShikiSuen 70e0044179 InputHandler // Simplify CapsLock input handling. 2022-12-17 14:54:48 +08:00
ShikiSuen 1324e0a077 Repo // selectedCandidateIndex -> highlightedIndex. 2022-12-17 14:54:48 +08:00
ShikiSuen b6b647d822 InputHandler // Simplify handleCandidate(). 2022-12-17 14:54:48 +08:00
ShikiSuen 96fe170a8d InputHandler // Remove ineffective ThinkPad-specific key support. 2022-12-17 14:54:48 +08:00
ShikiSuen e8e67a1f5f InputHandler // Simplifying aftermaths. 2022-12-17 14:54:48 +08:00
ShikiSuen 0a0f02861b InputHandler // Remove errorCallback(). 2022-12-17 14:54:48 +08:00
ShikiSuen 581122720d InputHandler // Remove state parameter. 2022-12-17 14:54:48 +08:00
ShikiSuen 36a83f25a2 InputHandler // Remove stateCallback(). 2022-12-17 14:54:48 +08:00
ShikiSuen 4522921a0f InputHandler // Simplify handleInput(). 2022-12-17 14:54:48 +08:00
ShikiSuen d9cf938b29 Repo // Introducing InputHandlerProtocol. 2022-12-17 14:54:48 +08:00
ShikiSuen 6e94cbea55 Repo // Moving input handling instructions to InputHandler. 2022-12-17 14:54:48 +08:00
ShikiSuen 5832136e05 Repo // Implementing set() for NSWindowController. 2022-12-17 14:54:48 +08:00
ShikiSuen 0926e345a4 ClientMgr // Allow multiple selection. 2022-12-17 14:54:48 +08:00
ShikiSuen 4b08607608 PrefUI & PrefWindow // Disable multiple selection. 2022-12-17 14:54:48 +08:00
ShikiSuen 595304a0b8 LMMgr // Format tweaks.
- Use "Self." when necessary.
2022-12-17 14:54:48 +08:00
ShikiSuen c7c7769024 Bump version to 2.8.8 GM Build 2880. 2022-12-17 14:54:48 +08:00
ShikiSuen 70f47407f9 UpdateSputnik // Use shared instance; Fix wrong key name. 2022-12-17 14:54:48 +08:00
ShikiSuen 794cca4e98 AppDelegate // Format change, removing "currentAlertType". 2022-12-17 14:54:48 +08:00
ShikiSuen 939162e08a Repo // NSApplication.shared -> NSApp. 2022-12-17 14:54:48 +08:00
ShikiSuen 08148779e5 PrefUI // Use uppercase Hungary naming convention. 2022-12-17 14:54:48 +08:00
ShikiSuen 9ae2797fca Repo // Change how NSWindow shared instances are handled. 2022-12-17 14:54:48 +08:00
ShikiSuen 7c1dce393d AboutWindow // Also embed upstream license. 2022-12-17 14:54:48 +08:00
ShikiSuen 66fb90d8d5 AboutWindow // Update copyright information. 2022-12-17 14:54:48 +08:00
ShikiSuen 4a5182ccf3 Repo // Update copyright format. 2022-12-17 14:54:48 +08:00
ShikiSuen 82a4a0e1bc Repo // Pull symbol menu default data out of the package. 2022-12-17 14:54:48 +08:00
ShikiSuen 6168cc32d0 Repo // Massive nomenclature changes, etc. 2022-12-17 14:54:48 +08:00
ShikiSuen 458e7fa613 SessionCtl // Simplify handle(state). 2022-12-17 14:54:48 +08:00
ShikiSuen 1e8b0af44b SessionCtl // Again let IME works right after rebooting itself. 2022-12-17 14:54:48 +08:00
ShikiSuen 0956e043fd SessionCtl // Add (Bool)replaceCurrent to handle(event). 2022-12-17 14:54:48 +08:00
ShikiSuen 0d79e83777 SessionCtl // Track and handle deactivated states correctly. 2022-12-17 14:54:48 +08:00
ShikiSuen 81feeb341c IMKCandidates // Upgrade visible(). 2022-12-17 14:54:48 +08:00
ShikiSuen 970174117e SessionCtl // Remove unnecessary nil setters for ctlCandidateCurrent. 2022-12-17 14:54:48 +08:00
ShikiSuen 072ecdf907 CtlCandidateDelegate // Remove useless "AnyObject". 2022-12-17 14:54:48 +08:00
ShikiSuen d4ba4dbdcf SessionCtl // Fix incorrect "deactivated" states. 2022-12-17 14:54:48 +08:00
ShikiSuen c95a55dc60 SessionCtl // Publicization. 2022-12-17 14:54:48 +08:00
ShikiSuen b43d4b8993 SessionCtl // Add warning comments towards handle(state). 2022-12-17 14:54:48 +08:00
ShikiSuen a144e20304 SessionCtl // Make PCB, tooltip, and candidate window instances dynamic. 2022-12-17 14:54:48 +08:00
ShikiSuen 940e9b6d85 SessionCtl // Also debug-print the client when state changes. 2022-12-17 14:54:48 +08:00
ShikiSuen 1f9abfafe5 SessionCtl // Handle empty state when activating server. 2022-12-17 14:54:48 +08:00
ShikiSuen 55c469bf31 KeyHandler // Deprecating CFStringTransform(), etc. 2022-12-17 14:54:48 +08:00
ShikiSuen 2cd43f8a69 PrefWindow // Description updates. 2022-12-17 14:54:48 +08:00
ShikiSuen e09813704d PrefUI // Update certain descriptions and terms. 2022-12-17 14:54:48 +08:00
ShikiSuen 65f8bc2eff PrefUI // Add quick setup buttons for keyLayouts. 2022-12-17 14:54:48 +08:00
ShikiSuen ae776fb12d PrefUI // Remove limitations regarding choices of keyboard layouts. 2022-12-17 14:54:48 +08:00
ShikiSuen d0c704f9bf SessionCtl // Disable special keyLayout for candidate Window. 2022-12-17 14:54:48 +08:00
ShikiSuen 70e0269bf3 SessionCtl // Disable special keyboard layout for Caps Lock mode. 2022-12-17 14:54:48 +08:00
ShikiSuen 05994872ca SessionCtl // Force keyLayout translation when typing phonabets. 2022-12-17 14:54:48 +08:00
ShikiSuen 123d6111bc SessionCtl // Force half-width in alphanumerical keyboard. 2022-12-17 14:54:48 +08:00
ShikiSuen 165727f43d SessionCtl // Translate Apple dynamic keylayouts in new way. 2022-12-17 14:54:48 +08:00
ShikiSuen 4edbe4d85c TDKCandidates // Only show 1 column for vertical typing. 2022-12-17 14:54:48 +08:00
ShikiSuen 4c44cf09c9 SessionCtl // Remove useless delegate symbols. 2022-12-17 14:54:48 +08:00
ShikiSuen 4676c995ce Repo // Fix selection key errors of vertical IMKCandidates. 2022-12-17 14:54:48 +08:00
ShikiSuen ec35ebf24b Repo // Refuse ineffective candidate key events. 2022-12-17 14:54:48 +08:00
ShikiSuen b510ee5c1e KeyHandler // Stop generating candidate states with emply container. 2022-12-17 14:54:48 +08:00
ShikiSuen 1dfebd7b44 Repo // Remove useless symbols regarding candidate windows. 2022-12-17 14:54:48 +08:00
ShikiSuen 0abc362576 Repo // Deprecating Zonble's method of handling selection key errors.
- Also adding the ability of detecting non-printable chars.
2022-12-17 14:54:48 +08:00
ShikiSuen 80e578600c PrefMgr // Add LINE to IMKTextInputIncapable list. 2022-12-17 14:54:48 +08:00
ShikiSuen 6eb77a1b6f ClientMgr // Tweak NSAlert sheet size. 2022-12-17 14:54:48 +08:00
ShikiSuen 32d35ad911 SessionCtl // Revamp certain client()-related operations. 2022-12-17 14:54:48 +08:00
ShikiSuen f4a786904e TDKCandidates // Refactor for simplicity. 2022-12-17 14:54:47 +08:00
ShikiSuen e71f46f2f5 Repo // Typo fix: Emac -> Emacs. 2022-12-17 14:54:47 +08:00
ShikiSuen d620a1899d SessionCtl // Disable recent new Caps Lock features for macOS 11 and earlier. 2022-12-17 14:54:47 +08:00
ShikiSuen 110d945d40 SessionCtl // Always sync ASCIIMode state from CapsLock state. 2022-12-17 14:54:47 +08:00
ShikiSuen 757f166d4b PrefWindow // Fix a wrong binding in XIB. 2022-12-17 14:54:47 +08:00
ShikiSuen 2c80f5fdf0 PrefMgr // Fix a default setting for macOS 10.14 and earlier. 2022-12-17 14:54:47 +08:00
ShikiSuen bf4712a1de SessionCtl // Use alphanumerical keyboard for candidate window.
- 2.8.6 Special FIx: Stop stucking while typing in Xcode.
2022-12-17 14:54:47 +08:00
ShikiSuen f7f722d557 KeyHandler // Comment update. 2022-12-17 14:54:47 +08:00
ShikiSuen 646ca310c6 Repo // Updating bleachSpecifiedSuggestions() to add batch processing. 2022-12-17 14:54:47 +08:00
ShikiSuen bf6bc90238 SessionCtl_Menu // Update certain menu item namings. 2022-12-17 14:54:47 +08:00
ShikiSuen 844fd5b8d9 Repo // Let L-Shift toggle become effective immediately. 2022-12-17 14:54:47 +08:00
ShikiSuen d872a6b443 Repo // Remove nerfed phrases from UOM database. 2022-12-17 14:54:47 +08:00
ShikiSuen 5e263e7398 KeyHandler // Update certain comments. 2022-12-17 14:54:47 +08:00
ShikiSuen c3d3d95a1f Manuals && FAQ // Update for vChewing 2.8.0 and onwards. 2022-12-17 14:54:47 +08:00
ShikiSuen d5e01b5adf Repo // Enable TDKCandidateBackports for macOS 10.15-11. 2022-12-17 14:54:47 +08:00
ShikiSuen cb81da6581 Repo // Clang-format. 2022-12-17 14:49:05 +08:00
ShikiSuen 50bddf2f83 KeyHandler // Fix a behavior issue with TDKCandidates. 2022-12-17 14:49:05 +08:00
ShikiSuen b286f23c69 SessionCtl // Use GCD for Caps Lock processing. 2022-12-17 14:49:05 +08:00
ShikiSuen 030a8cb776 CtlCandidateTDK // Vertical candidate layout support, etc.
- SP2: Fix a color scheme mistake in bright mode.
2022-12-17 14:49:05 +08:00
ShikiSuen 8fd236a065 Repo // Removing page button toggle. 2022-12-17 14:49:05 +08:00
ShikiSuen 0def927690 Repo // Allow turning off CapsLock notifications, etc. 2022-12-17 14:49:05 +08:00
ShikiSuen 227d0fb1bc Repo // Require that minimum candidate key count is 6, etc.
- SP2 Fix: Shared // Add missing dependency.
2022-12-17 14:49:05 +08:00
ShikiSuen 373dc93139 Repo // Update CNS Data tag. 2022-12-17 14:49:05 +08:00
ShikiSuen c9b42ca9a5 Prefs // Update settings regarding candidate window, etc. 2022-12-17 14:49:05 +08:00
ShikiSuen 738ecc0a8f PrefWindow // Disable Voltaire-related settings. 2022-12-17 14:49:05 +08:00
ShikiSuen cef1a2a3f5 CtlCandidateTDK // DIfferentiate page flipping and row flipping. 2022-12-17 14:49:05 +08:00
ShikiSuen b38938de54 CtlCandidateTDK // Performance boost. 2022-12-17 14:49:05 +08:00
ShikiSuen eadae22dbb Repo // Introducing CtlCandidateTDK (horizontal). 2022-12-17 14:49:05 +08:00
ShikiSuen e6429e2639 i18n // Remove redundant contents. 2022-12-17 14:49:05 +08:00
ShikiSuen 88d4e56f2f KeyHandler // Add additional notes regarding CapsLock handling. 2022-12-17 14:49:05 +08:00
ShikiSuen 1bba520f01 PrefUI // Fix certain terms according to recent changes. 2022-12-17 14:49:05 +08:00
ShikiSuen df1a531c6c i18n // Fix the localization key name according to recent changes. 2022-12-17 14:49:05 +08:00
ShikiSuen f75bafdd01 SessionCtl // Add caps lock notification support, etc. 2022-12-17 14:49:05 +08:00
ShikiSuen 8d541ddde0 Repo // App Icon Update - 2022 Fall. 2022-12-17 14:49:05 +08:00
ShikiSuen 3c5b82750b PrefUI // Tweak contentMaxHeight. 2022-12-17 14:49:05 +08:00
ShikiSuen b8ddfcabbf SessionCtl // Remove useless delegate symbols, etc. 2022-12-17 14:49:05 +08:00
ShikiSuen 216fe6e1ba Repo // "ctlInputMethod" -> "SessionCtl". 2022-12-17 14:49:05 +08:00
ShikiSuen 5815a49359 Repo // Simplify certain naming methods. 2022-12-17 14:49:05 +08:00
ShikiSuen e9137b9e53 CtlCandidate(s) // Refactor with partial packaging.
- The CtlCandidateIMK is not package-able due to its utilization of bridging-header. There is no workaround available at this moment.
2022-12-17 14:49:05 +08:00
ShikiSuen 0041c3d669 KeyHandler // Remove unnecessary comments. 2022-12-17 14:49:05 +08:00
ShikiSuen 690df020bd IMKCandidates // Reorganization. 2022-12-17 14:49:05 +08:00
ShikiSuen 0ce0604c16 IMKCandidates // Move its key handling process to ctlIME. 2022-12-17 14:49:05 +08:00
ShikiSuen 7c3d90dc80 LMI // Introducing hasKeyValuePairFor(), using it in LMMgr. 2022-12-17 14:49:05 +08:00
ShikiSuen dbd7dc92a1 PCB // Pack PopupCompositionBuffer into Swift package. 2022-12-17 14:49:05 +08:00
ShikiSuen 1648152b24 Repo // Move IMEState-related protocols to Shared package. 2022-12-17 14:49:05 +08:00
ShikiSuen cab7eb28f7 IMEState // Make certain data components directly accessible. 2022-12-17 14:49:05 +08:00
ShikiSuen abec924d16 TooltipUI // Pack ctlTooltip into a package. 2022-12-17 14:49:05 +08:00
ShikiSuen a5874a1cfd ctlIME // Update notifications for toggling alphanumerical modes. 2022-12-17 14:49:05 +08:00
ShikiSuen 1f5481a8d4 NotifierUI // Refactor into a standalone package. 2022-12-17 14:49:05 +08:00
ShikiSuen d8fb9aee1d ICB // Utilizing NSAttributedString.length. 2022-12-17 14:49:05 +08:00
ShikiSuen 827e7e4735 ctlIME // Simplify isASCIIMode toggling. 2022-12-17 14:49:05 +08:00
ShikiSuen e577135079 ctlIME // Omit event input if isASCIIMode. 2022-12-17 14:49:05 +08:00
ShikiSuen a026c39425 PrefWindow // Apply NSGridView. 2022-12-17 14:49:05 +08:00
ShikiSuen ff0c082754 Main // Simplify the processing of the connection name. 2022-12-17 14:49:04 +08:00
ShikiSuen 7d05bcf1ff PrefMgr // Split its extension to a standalone file. 2022-12-17 14:49:04 +08:00
ShikiSuen 0477c6e2da PrefUI // +onlyLoadFactoryLangModelsIfNeeded. 2022-12-17 14:49:04 +08:00
ShikiSuen b747dd063e PrefWindow // +onlyLoadFactoryLangModelsIfNeeded. 2022-12-17 14:49:04 +08:00
ShikiSuen 50396a42c6 Prefs // +onlyLoadFactoryLangModelsIfNeeded. 2022-12-17 14:49:04 +08:00
ShikiSuen e1648fc1a7 PrefMgr // Remove unnecessary GCD. 2022-12-17 14:49:04 +08:00
ShikiSuen d5ce4f29ad LMMgr // Also use GCD in loadDataModels() per input mode. 2022-12-17 14:49:04 +08:00
ShikiSuen 2a22117bad LMMgr // Use GCD in loadDataModelsOnAppDelegate(). 2022-12-17 14:49:04 +08:00
ShikiSuen f80c13331d Repo // Pack InputMode typedefs into Shared package. 2022-12-17 14:49:04 +08:00
ShikiSuen a4a37feb16 LMMgr // Use GCD in saveUserOverrideModelData(). 2022-12-17 14:49:04 +08:00
ShikiSuen cf025b2b52 NotifierUI // Redefine how a notifier gets triggered.
- The previous approach is not compatible with Grand Central Dispatch.
2022-12-17 14:49:04 +08:00
ShikiSuen 03d4099894 KeyHandler // Use PrefMgrProtocol delegate to handle UserDefaults. 2022-12-17 14:49:04 +08:00
ShikiSuen 9d077a9d49 Repo // Massive refactor & renovation.
- This commit is a massive refactor update towards the current vChewing codebase, modernizing the entire project structure.
- Put things into packages to boost compile speed.
- Also: IMKCandidates // macOS 10.13 High Sierra compatibility.
- ctlIME // Remove duplicated setValue().
2022-12-17 14:49:04 +08:00
ShikiSuen 498ddcc153 Starting from vChewing 2.6.2 SP3. 2022-12-17 14:32:15 +08:00
ShikiSuen ce6e8453e7 Removing everything. 2022-12-17 14:23:03 +08:00
ShikiSuen 12abcd02a9 Replacing data to libvchewing-data (v3.1.1); Requiring >= macOS 10.13.
- The data replacement is to make sure it is allowed to be hosted in GitLab China and Gitee.
- Xcode 14 does not support targets earlier than macOS 10.13.
2022-12-17 14:20:50 +08:00
zonble 8de659f50b Adds an example for a symbol table in tree structure. 2022-12-17 14:03:10 +08:00
Lukhnos Liu ddbe363134 Bump version to 2.2.2 2022-02-20 08:34:07 -08:00
Lukhnos Liu ea477d6c5b Fix cpplint 2022-02-20 08:11:12 -08:00
Lukhnos Liu e892628492 Remove all the "inFoo" in-param style
We don't use out-params in Gramambular, but even for them the best
practices have been converging on using "T& param" for required output
param and "T* param" for optional output param. At any rate the prefix
was never necessary, and hence the removal.
2022-02-20 08:11:11 -08:00
Lukhnos Liu 26ad5fd5ea Move dumpDOT to Grid.cpp 2022-02-20 08:11:10 -08:00
Lukhnos Liu 13609f41f5 Remove all the "using namespace" usage 2022-02-20 08:11:09 -08:00
Lukhnos Liu d3302ef70a Reformat Gramambular with clang-format 2022-02-20 08:11:08 -08:00
Lukhnos Liu d4d8d14004 Import the test code from Formosana 2022-02-20 08:11:07 -08:00
Lukhnos Liu 305c874003 Supply a CMake project and a trivial unit test 2022-02-20 08:11:03 -08:00
Lukhnos Liu dc6ef93d72 Remove the "using namespace" usage in McBopomofo 2022-02-19 10:00:28 -08:00
Lukhnos Liu 2091c1dc7d Format ObjC code with clang-format, WebKit style 2022-02-19 08:26:28 -08:00
Lukhnos Liu ca2f4bf8fd Delete the dead tistool.m 2022-02-19 08:26:08 -08:00
Lukhnos Liu ea2e76e107 Handle [A-Z] if input state is not empty (#292)
This fixes the regression, first introduced in 2.2, from 2.0.x behavior.
2022-02-16 00:15:40 -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
Lukhnos Liu d9e1417fa1 Bump version to 2.2.1 2022-02-14 19:50:01 -08:00
Lukhnos Liu b4704ff7e4 Merge pull request #289 from zonble/master
Fixes an Swift type conversion issue which happens while typing in Terminal app
2022-02-14 19:48:44 -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 a00d34241d Bump to version 2.2 2022-02-14 00:40:55 -08:00
Lukhnos Liu 0697d8b233 Fix path bugs in ArchiveUtil 2022-02-14 00:39:40 -08:00
Lukhnos Liu 39a9330969 Typo fix 2022-02-13 22:49:51 -08:00
Lukhnos Liu c2f45c2060 Make the half-width punctuations toggle work again 2022-02-13 19:22:45 -08:00
Lukhnos Liu 5d6659ef19 Rename associated-phrases.cin to associated-phrases.txt
Since the file doesn't really contain any .cin directives.
2022-02-13 19:16:37 -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
Lukhnos Liu 21fe0af085 Credits.rtf copyediting 2022-02-13 18:36:51 -08:00
Weizhong Yang a.k.a zonble 6122eeee15 Merge pull request #283 from lukhnos/bopomofo-refactoring
Bopomofo refactoring
2022-02-14 02:04:18 +08:00
zonble b5d9ce60bf Prevents the override model to remember symbols with scode -8 or lower. 2022-02-14 01:38:26 +08:00
Lukhnos Liu a55c0a4b60 Remove the absolute order format
The "absolute order" is a compact representation, originally a
historical carry-over from VanillaInput (2004). Modern input methods
no longer need such a compact form. It is therefore now removed.
2022-02-13 09:21:58 -08:00
Lukhnos Liu 502e8f1ea9 Remove an unused Romanization scheme 2022-02-13 09:21:44 -08:00
zonble 4d94bb0cd2 Automatically uses vertical candidate list if there is a long candidate. 2022-02-14 01:01:03 +08:00
zonble 83184229e6 Hides the function that using Ctrl+Enter to output BPMF readings. 2022-02-13 23:05:59 +08:00
zonble 11caa62b5d Prevents the user override model to store symbols. 2022-02-13 22:57:13 +08:00
zonble f32689eede Adds symbols. 2022-02-13 22:40:44 +08:00
zonble 08b92ae53b Fixes a typo. 2022-02-04 21:39:31 +08:00
zonble dc24de2ccb Notifies the users not to add duplicated phrases. 2022-02-04 05:46:31 +08:00
zonble 472b149020 Adds tests. 2022-02-04 05:19:25 +08:00
zonble ccfb97e7c5 Fixes the bug that the state was not reset if marking range is zero. 2022-02-04 04:33:49 +08:00
zonble bfa272ac65 Minor fix on the function to move cursor after selection. 2022-02-04 00:09:44 +08:00
zonble 9ade7d16a9 Adds an setting to move the cursor after selecting a candidate.
The setting only works when "SelectPhraseAfterCursorAsCandidate" is also
on. When a user use the mode, it is very possible that he or she has
already something in the input buffer and go back to choose a candidate.
When he or she completes selection, the user may want to go back to the
end and continue inputting. The setting is a time saver.
2022-02-04 00:03:16 +08:00
zonble 2880394812 Fixes a minor bug on handling backspace key. 2022-02-03 01:49:41 +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 a567ad0e65 Updates copyright info. 2022-02-03 01:20:35 +08:00
zonble ff9664c7f1 Fixes a typo. 2022-02-03 01:10:51 +08:00
zonble d4173bd931 Bug fixes on the marking state.
When the length of the range become to 0, the controller should go back
to inputting state.
2022-02-03 01:07:54 +08:00
zonble e9707b5427 Merge branch 'master' of github.com:openvanilla/McBopomofo 2022-02-03 00:06:03 +08:00
zonble b5220cbfe3 Add tests. 2022-02-03 00:02:23 +08:00
Lukhnos Liu 68732e6b15 Merge pull request #271 from zonble/dev/tests
Adds unit test cases for the key handler
2022-02-02 07:52:10 -08:00
zonble f39b4fa0bc Moves the Swift StringUtils class to a Swift package. 2022-02-02 22:47:15 +08:00
zonble 56ced2dd0f Adds test cases. 2022-02-02 21:25:51 +08:00
zonble 44ecf223d7 Adds test cases. 2022-02-02 21:10:26 +08:00
zonble cac954a00b Updates test cases. 2022-02-02 20:29:23 +08:00
zonble 5849478fe5 Removes the dependency on OpenVanilla. 2022-02-02 18:07:41 +08:00
zonble 4743889e2f Removes the usage of OVUTF8Helper in the key handler. 2022-02-02 17:58:45 +08:00
Weizhong Yang a.k.a zonble 8e1e3d184b Merge pull request #269 from lukhnos/mandarin-refactoring
Refactor the Bopomofo syllable library for better thread safety
2022-02-02 17:57:14 +08:00
Lukhnos Liu 55971131f0 Expand tests 2022-02-01 18:41:24 -08:00
Lukhnos Liu f591a4668c Use thread-safe init for keyboard layouts 2022-02-01 18:41:20 -08:00
Lukhnos Liu 44f6167a38 Use C++ UTF-8 literals and remove MSVC escapes 2022-02-01 18:41:14 -08:00
Lukhnos Liu 385fd34476 Rename member variables 2022-02-01 18:41:09 -08:00
Lukhnos Liu 2f567cddc2 Use constexpr for Bopomofo Components 2022-02-01 18:41:02 -08:00
Lukhnos Liu f4a0f2fe93 Update copyright headers and include guard 2022-02-01 18:40:56 -08:00
Lukhnos Liu a455aef587 Fix most cpplint warnings 2022-02-01 18:40:50 -08:00
Lukhnos Liu f0222c023d Use default copy/move ctors and assignment ops 2022-02-01 18:40:43 -08:00
Lukhnos Liu aa27cbbb02 Remove the "using namespace std;" usage 2022-02-01 18:40:39 -08:00
Lukhnos Liu 71b69cae50 Reformat with clang-format 2022-02-01 18:40:33 -08:00
Lukhnos Liu 4ebe1a1a11 Remove OpenVanilla dependencies
This removes one overengineered method from BopomofoSyllable and
rewrites a helper using a simpler UTF-8 heuristics.

Also adds the CMake project file and a unit test suite.
2022-02-01 18:40:18 -08:00
zonble 49f998ad5d Adds tests. 2022-02-02 07:24:47 +08:00
zonble 9c8d740fc6 Adds tests. 2022-02-02 07:24:47 +08:00
zonble 118a1243de Removes unused lines. 2022-02-02 06:02:44 +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 82dbed7815 Fixes a crash on adding user phrases. 2022-02-01 08:41:36 +08:00
zonble 347560e36b Disables adding phrases with shift-arraw keys when the length of the composing buffer and readings do not match. 2022-02-01 08:11:09 +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 536c9d1fc7 Adds some punctuations using control key.
It allows users ever use Microsoft Bopomofo to input punctuations using
keys like ctrl + comma.
2022-02-01 02:32:55 +08:00
zonble 8573332879 Removes unused localization. 2022-01-31 23:42:02 +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
Lukhnos Liu 2dd398f6ca Merge pull request #264 from zonble/dev/fseventstream
Loads the user phrases just after the files are changes.
2022-01-30 13:37:17 -08:00
zonble 3851f91d6c Fixes the bug that Shift+Space did not commit current composing buffer. 2022-01-31 04:47:45 +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 c59560dba2 Fixes the behavior to use ESC to clear the input buffer area. 2022-01-30 20:37:05 +08:00
zonble 8ba4b9dfdf Prevents loading data models repeatedly. 2022-01-30 20:27:33 +08:00
zonble fe67daceee Modifies the interface of LanguageModelManager to note that some methods are for testing only. 2022-01-30 20:18:43 +08:00
zonble ae9b524caa Updates the descriptions of the states. 2022-01-30 09:28:26 +08:00
zonble 4681465a68 Fixes a typo. 2022-01-30 08:53:59 +08:00
zonble 5ba7365cd3 Fixes typos. 2022-01-30 08:26:32 +08:00
zonble 8a05e4d6f7 Makes variables in LanguageModelManager static. 2022-01-30 08:18:45 +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 bce641608b Updates the copyright title and the README file. 2022-01-30 08:06:22 +08:00
zonble 4c358c1c1d Converts InputMethodController to Swift. 2022-01-30 08:06:22 +08:00
zonble 485925634a Adds unit tests for the key handler. 2022-01-28 20:43:43 +08:00
zonble bb4550b9da Notifies if half-size punctuation is on or off. 2022-01-28 19:37:38 +08:00
zonble 220696a70d Adds a hotkey to toggle half/full width punctuation. 2022-01-28 19:30:43 +08:00
zonble 464a54f98a Also uses the backspace key to cancel candidate in smart BPMF mode.
Going and Chewing also use backspace to do this.
2022-01-28 19:23:55 +08:00
zonble c3304bc5f7 Allows users to input letters when candidate window is open in plain BPMF mode. 2022-01-28 19:10:01 +08:00
zonble 43eef1fc1f Suppresses a log. 2022-01-28 18:56:51 +08:00
zonble 618065b881 Fixes the state from handling enter in plain BPMF mode. 2022-01-28 18:55:58 +08:00
zonble 439bb99ef5 Removes logs. 2022-01-28 17:53:32 +08:00
zonble 75dc93a2ce Fixes the position of the tooltip. 2022-01-28 17:04:07 +08:00
zonble ee521b6ee2 Fixes the behavior of the delete and backspace key. 2022-01-28 16:59:28 +08:00
zonble 9612aa6ba0 Code clean-up. 2022-01-28 16:51:25 +08:00
zonble b13da10ec0 Code clean-up. 2022-01-28 16:16:52 +08:00
zonble 0bc9468ba2 Splits Input Method controller into two classes. 2022-01-28 15:02:00 +08:00
zonble dd803b6c31 Removes logs and add copyright information. 2022-01-28 04:40:53 +08:00
zonble 056ffeabfd Tunes the interface. 2022-01-28 04:04:44 +08:00
zonble 7ee955a55c Cleans-up KeyHandlerInput. 2022-01-28 03:24:06 +08:00
zonble 87702f76c5 Cleans-up the interface. 2022-01-28 03:18:10 +08:00
zonble e17d06fd2a Fixes the cursor index when choosing candidates. 2022-01-28 01:58:25 +08:00
zonble 9351d877ba Fixes the issue on presenting the candidate window. 2022-01-28 01:44:50 +08:00
zonble fc0c077193 Fixes the bug on handling arrow keys. 2022-01-28 01:35:15 +08:00
zonble 2bbaa4a793 Fixes NSCoding exceptions. 2022-01-28 00:23:31 +08:00
zonble 56c393cefa Prevents using global state as possible. 2022-01-27 23:19:27 +08:00
zonble 1ad9e23918 Refactors the input controller. 2022-01-27 22:54:53 +08:00
zonble 6fe2fc59f3 Moves the way to render attributed string to the states. 2022-01-24 21:47:24 +08:00
zonble 82a916c433 Adds a new file KeyHandler.swift to start to break input controller to testable modules. 2022-01-24 17:46:34 +08:00
zonble 177cba5d56 [WIP] Starts to extract input states from the input controller. 2022-01-24 02:13:18 +08:00
zonble 6f254bf75d Updates copyright information. 2022-01-22 11:24:22 +08:00
zonble 3bba134e2f Adds Credits.rtf. 2022-01-22 00:34:48 +08:00
zonble 8717625d2e Adds a missing line back to the installer. 2022-01-22 00:07:07 +08:00
zonble bfb66cb080 Converts the installer to Swift. 2022-01-22 00:01:21 +08:00
zonble 5fe1c28ae7 Converts main to Swift. 2022-01-21 19:17:36 +08:00
Lukhnos Liu 957b66a96b Bump to version 2.0.1 2022-01-20 15:37:31 -08:00
Lukhnos Liu 6c76b2cae0 Delete a duplicate key in McBopomofo-Info.plist 2022-01-20 15:36:33 -08:00
zonble cb05937478 Fixes the order of the keyboard layouts.
Fixes #250.
2022-01-20 14:20:10 +08:00
Lukhnos Liu 25c50e67a4 Bump to version 2.0 2022-01-19 10:05:48 -08:00
Lukhnos Liu 42c4441d05 Introduce a Swift class to the Installer
This is so that the Installer will be built with the correct Swift
settings, especially those that instruct the Xcode to package the Swift
runtime libraries. This is needed because the Installer now depends on
InputSourceHelper, which is written in Swift. Without this, the app
would not be packaged with the Swift runtime libraries, which caused
the installer to be unusable on older but supported macOS versions.
2022-01-19 10:05:38 -08:00
Lukhnos Liu 29df72b79f Bump to version 2.0-alpha 2022-01-18 23:31:07 -08:00
Lukhnos Liu 8c692e6c3b Update copyright years 2022-01-18 23:28:08 -08:00
Lukhnos Liu 202b1fa058 Also make PhraseReplacementMap more tolerant
This also clarifies the test expectations and how parsing errors are
handled.
2022-01-18 22:46:26 -08:00
Weizhong Yang a.k.a zonble 9bc3536630 Merge branch 'master' into more-tolerant-userphraseslm 2022-01-19 14:01:23 +08:00
Weizhong Yang a.k.a zonble 04d2ff5a4d Merge pull request #244 from lukhnos/custom-data-templates
Writes templates the first time custom data is used
2022-01-19 13:31:15 +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 c8f65580bb Make UserPhrasesLM more tolerant
This lets UserPhrasesLM consumes as much user data as possible before
bailing. This makes it more tolerant to data errors and will not fail
entirely just because the user has one faulty line in a data file.

Also removes FastFM from the benchmarking suite.

This also runs the CMake-based C++ tests as part of the GitHub CI.
2022-01-18 16:20:25 -08:00
Lukhnos Liu 75f321f088 Update copyright headers (fixes #213) 2022-01-18 14:21:55 -08:00
Lukhnos Liu 61f55670fb Write templates the first time custom data is used
Now that we allow comments in the custom data files, this change writes
localized templates as well as basic instructions. Links to McBopomofo
User's Manual are also provided.
2022-01-18 13:42:45 -08:00
zonble 7e2d3df5ba Prevents users from adding custom phrases with more than 6 characters.
Also fixes typos.
2022-01-19 00:49:50 +08:00
zonble d2c039c42d Notifies the users it is not suggested to add phrase when model is converted. 2022-01-18 22:19:25 +08:00
zonble aa9c31ffcf Fixes the location of the tooltip. 2022-01-18 22:04:09 +08:00
zonble 0d80d28e0e Formats Swift code. 2022-01-18 21:16:07 +08:00
zonble dd1310d40a Makes version update testable. 2022-01-18 18:39:21 +08:00
zonble 29813f93e5 Adds test cases. 2022-01-18 17:05:51 +08:00
zonble e9b1a8ad4a Removes unused comments. 2022-01-17 00:55:36 +08:00
zonble a75c7b7086 Allows users to type Latin letters while using shift + letter keys.
Fixes issue #162.
2022-01-17 00:48:29 +08:00
zonble 8249c612ff Adds a validator for candidate keys in the preference window. 2022-01-16 23:33:35 +08:00
zonble 4ec4eed562 Removes unused files. 2022-01-16 15:15:41 +08:00
zonble 5ff6f378e6 Fixes a bug on selecting the candidate keys in the preference UI. 2022-01-16 15:14:49 +08:00
zonble c4259c4c4e Updates comments and fixes a typo. 2022-01-16 15:04:20 +08:00
zonble 4e56f350e8 Fixes a wrong API call. 2022-01-16 15:04:20 +08:00
zonble 5c0a14deeb Refactors the function to filter and transform unigrams in McBopomofoLM. 2022-01-16 15:04:20 +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 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