chore(typing): snapshot local pinyin WIP before syncing cloud branch
Preserve the in-progress local typing/pinyin implementation so feat/pinyin can safely reset to origin/feat/pinyin (cloud English + Chinese typing).
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
# Typing Keyboard Baseline (Phase 0)
|
||||
|
||||
Frozen reference for NanoMouse × OSGKeyboard fusion.
|
||||
|
||||
## NanoMouse reference
|
||||
|
||||
| Field | Value |
|
||||
|-------|--------|
|
||||
| Repo | https://github.com/xjwhnxjwhn/nanomouse |
|
||||
| Frozen commit | `a6177d898a01662ce551b43a01cf82a9f84ca54c` (2026-07-29 tip at clone) |
|
||||
| Local clone (gitignored) | `.refs/nanomouse/` |
|
||||
|
||||
## KeyboardKit / key shell
|
||||
|
||||
NanoMouse does **not** SPM-pin upstream KeyboardKit Pro. It vendors an MIT KeyboardKit tree inside:
|
||||
|
||||
`ios/Packages/HamsterKeyboardKit/Sources/KeyboardKit/` (see that folder’s `LICENSE`).
|
||||
|
||||
OSG ships a **lean SwiftUI key shell** in-repo (`OSGKeyboardExt/Typing/`)
|
||||
behind `TypingLayoutProviding`; KeyboardKit is not linked.
|
||||
|
||||
**KeyboardKit Pro is not used.**
|
||||
|
||||
## Chinese schema / lexicon
|
||||
|
||||
| Choice | Detail |
|
||||
|--------|--------|
|
||||
| Product intent | Full pinyin + Microsoft/Sogou double pinyin + opt-in fuzzy pairs |
|
||||
| Engine | librime 1.17.0 via static XCFramework (BSD-3-Clause) |
|
||||
| Binary package | `ghostflyby/librime-xcframework` `1.17.0-pack.1`, checksum `0f0fc13b…1164` |
|
||||
| Baseline | rime-pinyin-simp (Apache-2.0) |
|
||||
| Modern words | Jieba frequencies + phrase-pinyin-data + pinyin-data (MIT) |
|
||||
| Generated lexicon | `Resources/Typing/Rime/osg_pinyin.dict.yaml` (~365K entries) |
|
||||
| User learning | librime userdb in App Group |
|
||||
| Explicitly excluded | rime-ice / rime-double-pinyin (GPL), Luna / Essay (LGPL) |
|
||||
|
||||
The dictionary is rebuilt deterministically by
|
||||
`Scripts/typing/build_rime_dictionary.py`; `manifest.json` pins every source
|
||||
commit and SHA-256.
|
||||
|
||||
## Memory / height budget
|
||||
|
||||
| Mode | Target height | Memory notes |
|
||||
|------|---------------|--------------|
|
||||
| Voice | 281 pt (`KeyboardRootView.totalHeight`) | Matches typing height; no typing engine loaded |
|
||||
| Typing | 281 pt (`TypingRootView.totalHeight`) | Host-prebuilt Rime data; extension opens one session |
|
||||
| RSS goal | Typing peak < 50 MB | Session closes on voice switch / memory warning |
|
||||
|
||||
## Success criteria (Phase 1)
|
||||
|
||||
- Top-right tab switches voice ↔ typing; recording/processing locks voice.
|
||||
- English QWERTY + 123 / basic symbols.
|
||||
- Full pinyin and Microsoft/Sogou double pinyin produce phrase candidates.
|
||||
- Fuzzy pairs default off and are enabled individually in Settings.
|
||||
- No GPL/LGPL input data in the app; NOTICE lists exact source licenses.
|
||||
+2
-1
@@ -35,13 +35,14 @@
|
||||
<li><strong>API credentials</strong> — your cloud-engine LLM API key is stored in the iOS Keychain on your device and is read only when an LLM request is made. It is shared with the main app through a shared Keychain group, never through UserDefaults. When you enable <strong>iCloud settings sync</strong>, API keys replicate through Apple's <strong>iCloud Keychain</strong> to your other signed-in devices — not through iCloud Key-Value Store JSON.</li>
|
||||
<li><strong>App preferences</strong> — engine mode, recognition language, polish intensity, translation target, handedness, cursor-navigation toggle, and keyboard settings are stored in App Group <code>UserDefaults</code> on your device so the main app and keyboard extension stay in sync. When iCloud settings sync is enabled, these preferences (excluding API keys) may also be mirrored in your private iCloud Key-Value Store account.</li>
|
||||
<li><strong>Personal dictionary</strong> — terms and aliases you add in the Dictionary tab are stored locally on your device. They are included in LLM polish prompts so your vocabulary is preserved. Optional <strong>iCloud dictionary sync</strong> mirrors your dictionary through your private iCloud Key-Value Store; OSGKeyboard does not operate a separate dictionary server.</li>
|
||||
<li><strong>On-device typing learning</strong> — the Chinese keyboard stores selected words and candidate frequencies in the App Group on your device so future candidates improve. This user dictionary is not uploaded by OSGKeyboard.</li>
|
||||
<li><strong>Voice history</strong> — the host app may keep a list of recent successful transcripts in its History tab. History is capped at 300 entries. When iCloud settings sync is enabled, history may also sync through your private iCloud Key-Value Store.</li>
|
||||
<li><strong>Usage statistics</strong> — cumulative dictation time, dictation characters, and translation characters are computed for the home screen stats card. When iCloud settings sync is enabled, per-device totals may merge through your private iCloud Key-Value Store.</li>
|
||||
</ul>
|
||||
|
||||
<h2>What we do not collect</h2>
|
||||
<ul>
|
||||
<li>We do <strong>not</strong> log or upload ordinary keystrokes you type with the keyboard.</li>
|
||||
<li>We do <strong>not</strong> log or upload ordinary keystrokes. Only the on-device Chinese candidate-learning data described above is retained locally.</li>
|
||||
<li>We do <strong>not</strong> operate analytics, crash reporting, or advertising SDKs.</li>
|
||||
<li>We do <strong>not</strong> upload raw audio anywhere on the default local engine. The only exception is the optional cloud ASR engine: if you explicitly enable it (a confirmation dialog is shown first), recordings go to the ASR provider <em>you</em> configure — never to servers of ours.</li>
|
||||
<li>We do <strong>not</strong> sell personal data.</li>
|
||||
|
||||
@@ -35,13 +35,14 @@
|
||||
<li><strong>API credentials</strong> — your cloud-engine LLM API key is stored in the iOS Keychain on your device and is read only when an LLM request is made. It is shared with the main app through a shared Keychain group, never through UserDefaults.</li>
|
||||
<li><strong>App preferences</strong> — engine mode, recognition language, polish intensity, translation target, handedness, cursor-navigation toggle, and keyboard settings are stored in App Group <code>UserDefaults</code> on your device so the main app and keyboard extension stay in sync.</li>
|
||||
<li><strong>Personal dictionary</strong> — terms and aliases you add in the Dictionary tab are stored locally on your device. They are included in LLM polish prompts so your vocabulary is preserved; dictionary data is not uploaded to a separate server.</li>
|
||||
<li><strong>On-device typing learning</strong> — the Chinese keyboard stores selected words and candidate frequencies in the App Group on your device so future candidates improve. This user dictionary is not uploaded by OSGKeyboard.</li>
|
||||
<li><strong>Voice history</strong> — the host app may keep a list of recent successful transcripts in its History tab. History is capped at 300 entries. When iCloud settings sync is enabled, history may also sync through your private iCloud Key-Value Store.</li>
|
||||
<li><strong>Usage statistics</strong> — cumulative dictation time, dictation characters, translation characters, and dictionary entry count are computed and stored locally on the home screen stats card.</li>
|
||||
</ul>
|
||||
|
||||
<h2>What we do not collect</h2>
|
||||
<ul>
|
||||
<li>We do <strong>not</strong> log or upload ordinary keystrokes you type with the keyboard.</li>
|
||||
<li>We do <strong>not</strong> log or upload ordinary keystrokes. Only the on-device Chinese candidate-learning data described above is retained locally.</li>
|
||||
<li>We do <strong>not</strong> operate analytics, crash reporting, or advertising SDKs.</li>
|
||||
<li>We do <strong>not</strong> upload raw audio anywhere on the default local engine. The only exception is the optional cloud ASR engine: if you explicitly enable it (a confirmation dialog is shown first), recordings go to the ASR provider <em>you</em> configure — never to servers of ours.</li>
|
||||
<li>We do <strong>not</strong> sell personal data.</li>
|
||||
|
||||
Reference in New Issue
Block a user