Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
54d37f8
Update package.swift to use main branch
Skyline-23 Nov 16, 2025
1d0ffb9
Resolve compile issue
Skyline-23 Nov 16, 2025
626e1b7
Add submodule for CoreML
Skyline-23 Nov 16, 2025
0e2bacd
Add CoreML trait
Skyline-23 Nov 16, 2025
4dba985
Enables CoreML backend for Zenzai conversion
Skyline-23 Nov 16, 2025
578ac77
Fix CI scripts
Skyline-23 Nov 16, 2025
a57eaf0
Fix iOS, MacOS version branch
Skyline-23 Nov 16, 2025
26f21c2
Fix compile issue on variable env
Skyline-23 Nov 16, 2025
8b02864
Revert "Update package.swift to use main branch"
Skyline-23 Nov 16, 2025
cfa63e3
Add CoreML Build Tests
Skyline-23 Nov 16, 2025
e946f5b
Rollback Dependency
Skyline-23 Nov 16, 2025
c60936e
Move dependency to combine-resolved packagae
Skyline-23 Nov 16, 2025
421fb90
Fix branch name
Skyline-23 Nov 16, 2025
29fb84b
Refactor zenzai CoreML codes
Skyline-23 Nov 16, 2025
c519025
Add missing branch fallback
Skyline-23 Nov 16, 2025
4650739
CoreML conversion inside KanaKanjiConverter
Skyline-23 Nov 16, 2025
22f1b04
Adds CoreML support in cli
Skyline-23 Nov 17, 2025
3122720
Fix path of CoreML in install_cli.sh
Skyline-23 Nov 17, 2025
ee89847
Fix Mac os version issue
Skyline-23 Nov 17, 2025
ba56154
Restore MainActorTestCase.swift
Skyline-23 Nov 17, 2025
c7f1d92
Removed submodule Sources/ZenzCoreMLBackend/zenz-CoreML
Skyline-23 Nov 16, 2025
acfa39e
Fix CoreML Dependency
Skyline-23 Nov 17, 2025
d1e29a7
Removes LFS bootstrap from CI workflows & README.md update
Skyline-23 Nov 17, 2025
6885a03
docs: drop swift concurrency migration references
Skyline-23 Nov 25, 2025
ef786e4
docs: remove swift concurrency migration references
Skyline-23 Nov 25, 2025
35fdbc6
docs: strip concurrency wording (coreml-only)
Skyline-23 Nov 25, 2025
17c89c1
docs: remove language toggles from development guides
Skyline-23 Nov 25, 2025
4cc4dbb
api: add simple requestCandidatesAsync wrapper
Skyline-23 Nov 25, 2025
83b2f4c
docs: clarify sync API as primary
Skyline-23 Nov 25, 2025
636fff3
cli: call async requestCandidates bridge to avoid blocking CoreML
Skyline-23 Nov 25, 2025
4f91a69
fix: silence sendable issues for coreml async bridge
Skyline-23 Nov 25, 2025
0209a23
cli: fix requestCandidatesAsync call label
Skyline-23 Nov 25, 2025
a0ab322
Fix CoreML snapshots for sync APIs
Skyline-23 Nov 25, 2025
117ca4c
Fix CoreML sendability and llama target name
Skyline-23 Nov 25, 2025
89a7b12
Constrain blockingAsync to Sendable results
Skyline-23 Nov 25, 2025
91ba769
Bump macOS min to 15 when using ZenzaiCoreML trait
Skyline-23 Nov 25, 2025
dc7a3d7
Handle macOS 15 CoreML link flags under trait
Skyline-23 Nov 25, 2025
163ad1c
Copy resource bundle when installing CLI
Skyline-23 Nov 25, 2025
e3762a1
Gracefully skip llama.framework when absent
Skyline-23 Nov 25, 2025
c926ae3
Only skip llama.framework copy for CoreML builds
Skyline-23 Nov 25, 2025
ddfa88d
Restore llama Zenz load path when CoreML trait is off
Skyline-23 Nov 25, 2025
b357412
Update README CoreML requirements and async guidance
Skyline-23 Jan 12, 2026
0dd5ff5
Bump dictionary storage submodule
Skyline-23 Jan 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,28 @@ jobs:
run: swift build -Xswiftc -strict-concurrency=complete -Xcxx -xobjective-c++ -v
- name: Run tests
run: swift test -c release -Xswiftc -strict-concurrency=complete -Xcxx -xobjective-c++ -v
macos-coreml:
name: Swift ${{ matrix.swift-version }} (CoreML) on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
swift-version: ["6.1"]
steps:
- uses: ensan-hcl/setup-swift@swift-6.1.0
with:
swift-version: ${{ matrix.swift-version }}
- uses: actions/checkout@v5
with:
submodules: true
- name: Build (CoreML)
env:
CLANG_MODULE_CACHE_PATH: ${{ github.workspace }}/.build/ModuleCache
run: swift build --traits ZenzaiCoreML -Xswiftc -strict-concurrency=complete -Xcxx -xobjective-c++ -v
- name: Run tests (CoreML)
env:
CLANG_MODULE_CACHE_PATH: ${{ github.workspace }}/.build/ModuleCache
run: swift test --traits ZenzaiCoreML -c release -Xswiftc -strict-concurrency=complete -Xcxx -xobjective-c++ -v
ubuntu-build:
name: Swift ${{ matrix.swift-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down
27 changes: 27 additions & 0 deletions Docs/README.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Documents

**English** | [日本語](./README.md) | [한국어](./README.ko.md)

This directory contains documentation for AzooKeyKanaKanjiConverterModule.

For the azooKey main application, see [azooKey/docs](https://github.com/ensan-hcl/azooKey/tree/develop/docs/overview.md).

## For Developers

- [development_guide.en.md](./development_guide.en.md) - Development Guide
- [learning_data.md](./learning_data.md) - Learning Data Storage and Reset Methods
- [cli.md](./cli.md) - CLI Tool (anco) Usage
- [devcontainer.md](./devcontainer.md) - DevContainer Environment

## Zenzai Related

- [zenzai.en.md](./zenzai.en.md) - Zenzai (Neural Kana-Kanji Conversion) Usage
- [ZenzAvailability.en.md](./ZenzAvailability.en.md) - CoreML Availability Guidelines

## API & Implementation Details

- [converter_api.md](./converter_api.md) - Converter API
- [composing_text.md](./composing_text.md) - ComposingText API
- [conversion_algorithms.md](./conversion_algorithms.md) - Conversion Algorithms
- [custom_input_table.md](./custom_input_table.md) - Custom Input Table
- [dicdata_format.md](./dicdata_format.md) - Dictionary Data Format
27 changes: 27 additions & 0 deletions Docs/README.ko.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Documents

[English](./README.en.md) | [日本語](./README.md) | **한국어**

이 디렉토리는 AzooKeyKanaKanjiConverterModule에 관한 문서를 모아둔 곳입니다.

azooKey 본체에 대해서는 [azooKey/docs](https://github.com/ensan-hcl/azooKey/tree/develop/docs/overview.md)를 참조하세요.

## 개발자용

- [development_guide.ko.md](./development_guide.ko.md) - 개발 가이드
- [learning_data.md](./learning_data.md) - 학습 데이터 저장 위치 및 초기화 방법
- [cli.md](./cli.md) - CLI 도구 (anco) 사용법
- [devcontainer.md](./devcontainer.md) - DevContainer 환경

## Zenzai 관련

- [zenzai.ko.md](./zenzai.ko.md) - Zenzai (신경망 기반 가나-한자 변환) 사용법
- [ZenzAvailability.ko.md](./ZenzAvailability.ko.md) - CoreML 가용성 가이드라인

## API 및 구현 세부사항

- [converter_api.md](./converter_api.md) - Converter API
- [composing_text.md](./composing_text.md) - ComposingText API
- [conversion_algorithms.md](./conversion_algorithms.md) - 변환 알고리즘
- [custom_input_table.md](./custom_input_table.md) - 커스텀 입력 테이블
- [dicdata_format.md](./dicdata_format.md) - 사전 데이터 형식
22 changes: 20 additions & 2 deletions Docs/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# Documents

[English](./README.en.md) | **日本語** | [한국어](./README.ko.md)

本ディレクトリはAzooKeyKanaKanjiConverterModuleに関するドキュメントをまとめています。

azooKey本体については[azooKey/docs](https://github.com/ensan-hcl/azooKey/tree/develop/docs/overview.md)をご覧ください。

開発ガイドは[development_guide.md](./development_guide.md)をご覧ください。
学習データの保存先やリセット方法については[learning_data.md](./learning_data.md)を参照してください。
## 開発者向け

- [development_guide.md](./development_guide.md) - 開発ガイド
- [learning_data.md](./learning_data.md) - 学習データの保存先とリセット方法
- [cli.md](./cli.md) - CLIツール(anco)の使い方
- [devcontainer.md](./devcontainer.md) - DevContainer環境

## Zenzai関連

- [zenzai.md](./zenzai.md) - Zenzai(ニューラルかな漢字変換)の使い方
- [ZenzAvailability.md](./ZenzAvailability.md) - CoreML可用性ガイドライン

## API・実装詳細

- [converter_api.md](./converter_api.md) - Converter API
- [composing_text.md](./composing_text.md) - ComposingText API
- [conversion_algorithms.md](./conversion_algorithms.md) - 変換アルゴリズム
- [custom_input_table.md](./custom_input_table.md) - カスタム入力テーブル
- [dicdata_format.md](./dicdata_format.md) - 辞書データフォーマット
18 changes: 18 additions & 0 deletions Docs/ZenzAvailability.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Zenz / CoreML Availability Guidelines

**English** | [日本語](./ZenzAvailability.md) | [한국어](./ZenzAvailability.ko.md)

AzooKey's Zenz-related code needs to run on multiple platforms.
By following the rules below, you can maintain code quality without scattered `#if` guards and `@available` checks.

1. **Always expose common logic**
Features used outside of CoreML, such as `PrefixConstraint`, lattice construction, and candidate review, should not be hidden behind `#if ZenzaiCoreML` / `@available`. Files like `FullInputProcessingWithPrefixConstraint.swift` and `zenzai.swift` should always be included in the build.

2. **Guard only CoreML-specific entry points**
Apply `#if ZenzaiCoreML && canImport(CoreML)` + `@available(iOS 18, macOS 15, *)` only to parts that actually require the CoreML runtime, such as the CoreML backend, `ZenzContext+CoreML`, and `ZenzCoreMLService`. The calling side should use a single entry point like `coreMLService?.convert(...)`.

3. **Encapsulate runtime checks in services**
The `KanaKanjiConverter` main body should not be aware of CoreML availability. `ZenzCoreMLService` handles `#available` checks and model cache management. On other platforms, the service will be `nil`, allowing the existing processing path to work as is.

4. **Update this document when adding new code**
If there are changes to CoreML-specific files or availability rules, always update this document to share the intent.
18 changes: 18 additions & 0 deletions Docs/ZenzAvailability.ko.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Zenz / CoreML 가용성 가이드라인

[English](./ZenzAvailability.en.md) | [日本語](./ZenzAvailability.md) | **한국어**

AzooKey의 Zenz 관련 코드는 여러 플랫폼에서 동작해야 합니다.
아래 규칙을 따르면 `#if` 가드나 `@available` 검사가 흩어지지 않고 유지보수성을 유지할 수 있습니다.

1. **공통 로직은 항상 공개하기**
`PrefixConstraint`나 래티스 구축, 후보 검토 등 CoreML 외에서도 사용하는 기능은 `#if ZenzaiCoreML` / `@available`로 숨기지 않습니다. `FullInputProcessingWithPrefixConstraint.swift`나 `zenzai.swift`는 항상 빌드 대상에 포함되어야 합니다.

2. **CoreML 전용 진입점만 가드하기**
CoreML 백엔드, `ZenzContext+CoreML`, `ZenzCoreMLService` 등 실제로 CoreML 런타임이 필요한 부분에만 `#if ZenzaiCoreML && canImport(CoreML)` + `@available(iOS 18, macOS 15, *)`를 적용합니다. 호출하는 쪽에서는 `coreMLService?.convert(...)`처럼 단일 진입점을 통해 사용합니다.

3. **런타임 판정은 서비스에 캡슐화하기**
`KanaKanjiConverter` 본체는 CoreML 유무를 의식하지 않고, `ZenzCoreMLService`가 `#available` 판정과 모델 캐시 관리를 담당합니다. 다른 플랫폼에서는 서비스가 `nil`이 되어 기존 처리 경로가 그대로 사용됩니다.

4. **새 코드를 추가하면 이 문서를 업데이트하기**
CoreML 전용 파일이나 가용성 규칙에 변경사항이 있으면 반드시 이 문서를 업데이트하여 의도를 공유합니다.
18 changes: 18 additions & 0 deletions Docs/ZenzAvailability.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Zenz / CoreML の可用性ガイドライン

[English](./ZenzAvailability.en.md) | **日本語** | [한국어](./ZenzAvailability.ko.md)

AzooKey の Zenz 関連コードは複数プラットフォームで動作させる必要があります。
下記のルールを守ることで、`#if` ガードや `@available` が散逸せず、保守性を維持できます。

1. **共通ロジックは常に公開する**
`PrefixConstraint` やラティス構築、候補レビューなど CoreML 以外でも使う機能は `#if ZenzaiCoreML` / `@available` で隠さない。`FullInputProcessingWithPrefixConstraint.swift` や `zenzai.swift` は常にビルド対象にする。

2. **CoreML 専用の入口だけをガードする**
CoreML バックエンド、`ZenzContext+CoreML`、`ZenzCoreMLService` など実際に CoreML ランタイムを必要とする箇所だけに `#if ZenzaiCoreML && canImport(CoreML)` + `@available(iOS 18, macOS 15, *)` を付ける。呼び出し側は `coreMLService?.convert(...)` のように単一の入口経由で利用する。

3. **実行時判定はサービスに閉じ込める**
`KanaKanjiConverter` 本体は CoreML の有無を意識せず、`ZenzCoreMLService` が `#available` 判定やモデルキャッシュ管理を担当する。他プラットフォームではサービスが `nil` となり、既存の処理経路がそのまま使える構成にする。

4. **新しいコードを追加したら本書を更新する**
CoreML 専用ファイルや可用性ルールに変更があれば、必ずこのドキュメントを更新して意図を共有する。
Loading