-
Notifications
You must be signed in to change notification settings - Fork 0
Platform Support
Lexicon is verified on macOS and Linux with SwiftPM tests. CI also runs tests on an Android emulator and cross-builds Android ARM64.
The package currently declares:
- Swift tools version 6.3
- Swift language mode 6
- macOS 15
- iOS 18
On Apple platforms, Lexicon.Graph.from(sentences:) can use NaturalLanguage for tokenization and lexical classes.
The base Swift package and CLI work normally on macOS. MLX semantic search is also intended for Apple platforms.
Linux builds use a deterministic fallback for sentence graph generation where NaturalLanguage is unavailable. The API remains available, but lexical-class behavior is simpler than Apple's NaturalLanguage implementation.
Android support is verified in two ways:
- cross-compiling the package with the official Swift SDK for Android
- running SwiftPM tests on an Android API 28 emulator
Cross-build commands:
swift build --swift-sdk aarch64-unknown-linux-android28 --static-swift-stdlib
swift build --swift-sdk x86_64-unknown-linux-android28 --static-swift-stdlibThe Android test job uses the emulator harness from skiptools/swift-android-action because SwiftPM cross-compilation alone builds the test runner but does not execute it on an Android runtime.
Search can run without semantic embeddings:
swift run lexicon search commerce.lexicon submit order --embedding-provider noneSemantic search can use system support where available or MLX when the CLI is built with the MLXSearch package trait:
swift run --traits MLXSearch lexicon search commerce.lexicon "order submit" \
--embedding-provider mlx \
--embedding-model TaylorAI/bge-micro-v2MLX document embeddings are cached under the user cache directory by default. Use --embedding-cache and --rebuild-embeddings to control cache behavior.
For ordinary pull requests:
swift test -Xswiftc -warnings-as-errors
swift build --product lexicon -Xswiftc -warnings-as-errors
swift build --product lexicon-generate -Xswiftc -warnings-as-errors
swift build --product lexicon-lsp -Xswiftc -warnings-as-errorsFor concurrency-focused checks:
swift test -Xswiftc -strict-concurrency=complete -Xswiftc -warnings-as-errors