ユーザー辞書のインポート/エクスポートを追加#319
Draft
artin-kagun wants to merge 1 commit intoazooKey:mainfrom
Draft
Conversation
Member
|
@artin-kagun 実装について確認させてください。各種IMEでユーザ辞書形式や品詞体系が違うと思いますが、そのあたりってどう吸収する設計になっていますか? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
ユーザー辞書設定に、既存の単一ユーザー辞書へファイルから読み込む / ファイルへ書き出すための導線を追加します。
#318 で一度まとめて提案していた変更のうち、このPRでは「ユーザー辞書のインポート / エクスポート」に範囲を絞っています。複数辞書管理、大規模辞書キャッシュ、候補欄へのコメント表示は含めていません。
変更内容
UserDictionaryTextCodecを追加しました。UserDictionaryTextFormatとして分けています。com.apple.security.files.user-selected.read-writeを追加しました。意図
まずは既存のユーザー辞書モデルを広げず、現在の
Config.UserDictionary.Value.itemsに対して入出力だけを足す構成にしています。形式サポートの細部はこのPR内でレビューしやすいよう、変換ロジックをUIから分離しました。検証
swift test --disable-sandbox --package-path Core --build-path /private/tmp/azookey-pr-import-export-buildgit diff --check upstream/mainplutil -lint azooKeyMac/azooKeyMac.entitlementsxcrun swiftc -parse azooKeyMac/Windows/UserDictionaryEditorWindow.swift