ユーザー辞書のインポート/エクスポートを追加#319
Draft
artin-kagun wants to merge 1 commit into
Draft
Conversation
Member
|
@artin-kagun 実装について確認させてください。各種IMEでユーザ辞書形式や品詞体系が違うと思いますが、そのあたりってどう吸収する設計になっていますか? |
Author
|
@ensan-hcl お返事遅れまして申し訳ないです。 現状の実装では、各IMEの品詞体系を完全にazooKey側の品詞体系へ変換する設計にはしていません。 そのため、現時点での対応は、各形式のファイルからユーザー辞書項目として取り込めるという意味であり、IMEごとの品詞体系を保持・変換するものではありません。 インポート動作については、ローカルで以下のモック辞書を用意し、いずれもインポートできることを手動確認しました。
エクスポートも手動確認済みです。 |
Author
|
@ensan-hcl すみません。追記です。 私が試験運用している中で変換品質の悪化に気づきにくかったのは、ユーザー辞書として名刺ばかりを取り込んでいたからかもしれません。 ユーザー辞書項目を変換器に渡すとき、 としています。 たとえばインポート元の辞書に のような項目があったとしても、それは変換機に以下のように渡されます |
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