Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: azooKey/azooKey-Desktop
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.0-alpha.7
Choose a base ref
...
head repository: azooKey/azooKey-Desktop
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 2,771 additions and 532 deletions.
  1. +13 −0 .github/FUNDING.yml
  2. +6 −3 .gitmodules
  3. +36 −0 .swiftlint.yml
  4. +1 −1 LICENSE
  5. +54 −26 README.md
  6. +59 −160 azooKeyMac.xcodeproj/project.pbxproj
  7. +37 −18 azooKeyMac/AppDelegate.swift
  8. +15 −1 azooKeyMac/Configs/BoolConfigItem.swift
  9. +0 −1 azooKeyMac/Configs/ConfigItem.swift
  10. +75 −1 azooKeyMac/Configs/CustomCodableConfigItem.swift
  11. +16 −0 azooKeyMac/Configs/StringConfigItem.swift
  12. +50 −0 azooKeyMac/Extensions/KeychainHelper.swift
  13. +8 −0 azooKeyMac/Info.plist
  14. +50 −6 azooKeyMac/InputController/Actions/ClientAction.swift
  15. +42 −1 azooKeyMac/InputController/Actions/UserAction.swift
  16. +258 −0 azooKeyMac/InputController/CandidateWindow/BaseCandidateViewController.swift
  17. +82 −0 azooKeyMac/InputController/CandidateWindow/CandidateView.swift
  18. +33 −0 azooKeyMac/InputController/CandidateWindow/SuggestCandidatesViewController.swift
  19. +119 −2 azooKeyMac/InputController/InputMode.swift
  20. +185 −76 azooKeyMac/InputController/InputState.swift
  21. +376 −0 azooKeyMac/InputController/OpenAIClient.swift
  22. +545 −0 azooKeyMac/InputController/SegmentsManager.swift
  23. +392 −177 azooKeyMac/InputController/azooKeyMacInputController.swift
  24. +14 −28 azooKeyMac/InputController/azooKeyMacInputControllerHelper.swift
  25. +1 −0 azooKeyMac/Resources/base_n5_lm
  26. +0 −1 azooKeyMac/Resources/zenz-v1
  27. +1 −0 azooKeyMac/Resources/zenz-v3-small-gguf
  28. +111 −11 azooKeyMac/Windows/ConfigWindow.swift
  29. +132 −0 azooKeyMac/Windows/UserDictionaryEditorWindow.swift
  30. +8 −0 azooKeyMac/azooKeyMac.entitlements
  31. +0 −17 azooKeyMac/azooKeyMacApp.swift
  32. BIN azooKeyMac/en.tiff
  33. BIN azooKeyMac/en@2x.tiff
  34. BIN azooKeyMac/main.tiff
  35. BIN azooKeyMac/main@2x.tiff
  36. +41 −2 install.sh
  37. +11 −0 pkgbuild.sh
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [ensan-hcl]
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
# ko_fi: # Replace with a single Ko-fi username
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
# liberapay: # Replace with a single Liberapay username
# issuehunt: # Replace with a single IssueHunt username
# otechie: # Replace with a single Otechie username
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
9 changes: 6 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "azooKeyMac/Resources/zenz-v1"]
path = azooKeyMac/Resources/zenz-v1
url = https://huggingface.co/Miwa-Keita/zenz-v1
[submodule "azooKeyMac/Resources/base_n5_lm"]
path = azooKeyMac/Resources/base_n5_lm
url = https://huggingface.co/Miwa-Keita/base_n5_lm
[submodule "azooKeyMac/Resources/zenz-v3-small-gguf"]
path = azooKeyMac/Resources/zenz-v3-small-gguf
url = https://huggingface.co/Miwa-Keita/zenz-v3-small-gguf
36 changes: 36 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# document: https://github.com/realm/SwiftLint
disabled_rules:
- line_length # 行の長さが気になる場合はエディタで折り返しを設定してください
- nesting # 型名のネストの深さを気にするのは非本質的
- file_length # ファイルの長さを気にするのは非本質的
- function_body_length # 関数の実装の長さを気にするのも非本質的
- type_body_length # 型の実装の長さを気にするのも非本質的

identifier_name:
min_length: 1
max_length: 10000 # 長さ上限を無効化
excluded: ["英数|かな"]

type_name:
min_length: 1
max_length: 10000 # 長さ上限を無効化

analyzer_rules:
- unused_import
- unused_declaration

opt_in_rules:
- implicit_return # implicit returnを推奨
- sorted_imports # importをsortする
- array_init # Array()を推奨
- conditional_returns_on_newline
- empty_string # 同上
- explicit_init # explicitに.initを書かない
- first_where # .filter { }.firstよりも.first(where:)を用いる.
- operator_usage_whitespace # 演算子の左右に空白を
- redundant_nil_coalescing # ?? nilを禁止
- reduce_into # reduce(into:)を推奨
- toggle_bool # .toggleを推奨

included:
- azooKeyMac
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 ensan
Copyright (c) 2025 Miwa Keita

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
80 changes: 54 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# azooKey on Desktop
# azooKey on macOS

iOSのキーボードアプリ「[azooKey](https://github.com/ensan-hcl/azooKey)」のデスクトップ版です
[azooKey](https://github.com/ensan-hcl/azooKey)のmacOS版です。高精度なニューラルかな漢字変換エンジン「Zenzai」を導入した、オープンソースの日本語入力システムです

現在アルファ版のため、動作は一切保証できません。
**現在アルファ版のため、動作は一切保証できません**

## 動作環境

macOS 14.3で動作確認しています。古いOSでの動作は検証していません
macOS 14とmacOS 15で動作確認しています。macOS 13でも利用できますが、動作は検証していません

## リリース版インストール

@@ -23,54 +23,79 @@ macOS 14.3で動作確認しています。古いOSでの動作は検証して
azooKey on macOSの開発に参加したい方、使い方に質問がある方、要望や不具合報告がある方は、ぜひ[azooKeyのDiscordサーバ](https://discord.gg/dY9gHuyZN5)にご参加ください。


## 開発版のビルド・デバッグ
cloneする際には`--recursive`をつけてサブモジュールまでロードしてください。
### azooKey on macOSを支援する

GitHub Sponsorsをご利用ください。


## 機能

* ニューラルかな漢字変換システム「Zenzai」による高精度な変換
* プロフィールプロンプト機能
* 履歴学習機能
* ユーザ辞書機能
* 個人最適化システム「[Tuner](https://github.com/azooKey/Tuner)」との連携機能

* ライブ変換
* LLMによる「いい感じ変換」機能
* その他の

## 開発ガイド

コントリビュート歓迎です!!

### 想定環境
* macOS 14+
* Xcode 16+
* Git LFS導入済み
* SwiftLint導入済み

### 開発版のビルド・デバッグ

cloneする際には`--recursive`をつけてサブモジュールまでローカルに落としてください。

```bash
git clone https://github.com/ensan-hcl/azooKey-Desktop --recursive
git clone https://github.com/azooKey/azooKey-Desktop --recursive
```

以下のスクリプトを用いて最新のコードをビルドしてください。`.pkg`によるインストールと同等になります。その後、上記の手順を行ってください。
以下のスクリプトを用いて最新のコードをビルドしてください。`.pkg`によるインストールと同等になります。その後、上記の手順を行ってください。また、submoduleが更新されている場合は `git submodule update --init` を行ってください。

```bash
# submoduleを更新
git submodule update --init

# ビルド&インストール
./install.sh
```

開発中はazooKeyのプロセスをkillすることで最新版を反映することが出来ます。また、必要に応じて入力ソースからazooKeyを削除して再度追加する、macOSからログアウトして再ログインするなど、リセットが必要になる場合があります。

## 機能
### 開発時のトラブルシューティング

* ニューラルかな漢字変換システム「Zenzai」による高精度な変換のサポート
* iOSのキーボードアプリazooKeyと同レベルの日本語入力のサポート
* 英字入力のサポート
* 部分変換のサポート
* 変換範囲のエディットも可能
* ライブ変換のサポート
* 設定メニューでのライブ変換の切り替え
* 英単語変換のサポート
* 設定メニューで切り替え
* 学習機能
* インストーラのサポート
`install.sh`でビルドが成功しない場合、以下をご確認ください。

## 開発ガイド
* XcodeのGUI上で「Team ID」を変更する必要がある場合があります
* 「Packages are not supported when using legacy build locations, but the current project has them enabled.」と表示される場合は[https://qiita.com/glassmonkey/items/3e8203900b516878ff2c](https://qiita.com/glassmonkey/items/3e8203900b516878ff2c)を参考に、Xcodeの設定をご確認ください

コントリビュート歓迎です!!
変換精度がリリース版に比べて悪いと感じた場合、以下をご確認ください。
* Git LFSが導入されていない環境では、重みファイルがローカル環境に落とせていない場合があります。`azooKey-Desktop/azooKeyMac/Resources/zenz-v3-small-gguf/ggml-model-Q5_K_M.gguf`が70MB程度のファイルとなっているかを確認してください

### pkgファイルの作成
`pkgbuild.sh`によって配布用のdmgファイルを作成できます。`build/azooKeyMac.app` としてDeveloper IDで署名済みの.appを配置してください。

### TODO

* 入力中に自動で変換候補ウィンドウを表示する
* 予測変換を表示する
* CIを増やす
* アルファ版を自動リリースする
* 機能の拡充
* ユーザ辞書をサポートする
* 「いい感じ変換」の改良
* 「Tuner」との相互運用性の向上

### Future Direction

* WindowsとLinuxもサポートする
* @7ka-Hiira さんによる[fcitx5-hazkey](https://github.com/7ka-Hiira/fcitx5-hazkey)もご覧ください
* @fkunn1326 さんによる[azooKey-Windows](https://github.com/fkunn1326/azooKey-Windows)もご覧ください

* iOS版のazooKeyと学習や設定を同期する

## Reference
@@ -81,3 +106,6 @@ Thanks to authors!!
* https://www.logcg.com/en/archives/2078.html
* https://stackoverflow.com/questions/27813151/how-to-develop-a-simple-input-method-for-mac-os-x-in-swift
* https://mzp.booth.pm/items/809262

## Acknowledgement
本プロジェクトは情報処理推進機構(IPA)による[2024年度未踏IT人材発掘・育成事業](https://www.ipa.go.jp/jinzai/mitou/it/2024/koubokekka.html)の支援を受けて開発を行いました。
Loading