loqalkit 1.6.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. loqalkit-1.6.2/.gitattributes +1 -0
  2. loqalkit-1.6.2/.github/workflows/publish.yml +85 -0
  3. loqalkit-1.6.2/.github/workflows/tag-release.yml +34 -0
  4. loqalkit-1.6.2/.gitignore +23 -0
  5. loqalkit-1.6.2/CLAUDE.md +53 -0
  6. loqalkit-1.6.2/Dockerfile +18 -0
  7. loqalkit-1.6.2/LICENSE +23 -0
  8. loqalkit-1.6.2/LoqalKitAndroid/build.gradle.kts +48 -0
  9. loqalkit-1.6.2/LoqalKitAndroid/gradle/libs.versions.toml +146 -0
  10. loqalkit-1.6.2/LoqalKitAndroid/gradle/wrapper/gradle-wrapper.jar +0 -0
  11. loqalkit-1.6.2/LoqalKitAndroid/gradle/wrapper/gradle-wrapper.properties +7 -0
  12. loqalkit-1.6.2/LoqalKitAndroid/gradle.properties +2 -0
  13. loqalkit-1.6.2/LoqalKitAndroid/gradlew +248 -0
  14. loqalkit-1.6.2/LoqalKitAndroid/gradlew.bat +93 -0
  15. loqalkit-1.6.2/LoqalKitAndroid/settings.gradle.kts +20 -0
  16. loqalkit-1.6.2/LoqalKitAndroid/src/main/AndroidManifest.xml +6 -0
  17. loqalkit-1.6.2/LoqalKitAndroid/src/main/assets/silero_vad.onnx +0 -0
  18. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/ASRSession.kt +20 -0
  19. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/AudioRecorderInterface.kt +13 -0
  20. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/Canonical.kt +73 -0
  21. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/Configuration.kt +256 -0
  22. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/DirectionInfo.kt +115 -0
  23. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/FuriganaSegment.kt +9 -0
  24. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/FuriganaService.kt +240 -0
  25. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/HTTPClient.kt +137 -0
  26. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/LanguageClient.kt +240 -0
  27. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/LanguageDetector.kt +68 -0
  28. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/LanguageDetectorInterface.kt +22 -0
  29. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/LanguageGenderInfo.kt +190 -0
  30. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/ScriptInfo.kt +105 -0
  31. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/TranslationService.kt +59 -0
  32. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/asr/AudioRecorder.kt +513 -0
  33. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/asr/ServerASRService.kt +257 -0
  34. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/asr/ServerASRStreamClient.kt +202 -0
  35. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/asr/SilenceDetector.kt +57 -0
  36. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/asr/SileroVad.kt +108 -0
  37. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/asr/SpeechRecognizerWrapper.kt +220 -0
  38. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/ondevice/LoqalOnDeviceTTSService.kt +597 -0
  39. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/ondevice/PiperSynthesizer.kt +144 -0
  40. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/ondevice/VoiceConverter.kt +321 -0
  41. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/ondevice/VoicePackManifest.kt +38 -0
  42. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/ondevice/preprocessing/CYShift.kt +140 -0
  43. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/ondevice/preprocessing/TextPreprocessor.kt +30 -0
  44. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/ondevice/preprocessing/YiddishNumbers.kt +190 -0
  45. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/ondevice/preprocessing/YiddishPreprocessor.kt +673 -0
  46. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/tts/LocalTTSService.kt +214 -0
  47. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/tts/NetworkMonitor.kt +71 -0
  48. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/tts/ServerTTSService.kt +371 -0
  49. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/tts/TTSRouter.kt +191 -0
  50. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/tts/TTSVoiceCache.kt +23 -0
  51. loqalkit-1.6.2/LoqalKitAndroid/src/main/kotlin/com/sorato/loqalkit/tts/VoiceResolver.kt +126 -0
  52. loqalkit-1.6.2/LoqalKitAndroid/src/test/kotlin/com/sorato/loqalkit/CanonicalTest.kt +53 -0
  53. loqalkit-1.6.2/LoqalKitAndroid/src/test/kotlin/com/sorato/loqalkit/FuriganaServiceTest.kt +102 -0
  54. loqalkit-1.6.2/LoqalKitAndroid/src/test/kotlin/com/sorato/loqalkit/RomanizeShapesTest.kt +45 -0
  55. loqalkit-1.6.2/LoqalKitAndroid/src/test/kotlin/com/sorato/loqalkit/TranslateShapesTest.kt +41 -0
  56. loqalkit-1.6.2/PKG-INFO +104 -0
  57. loqalkit-1.6.2/Package.resolved +24 -0
  58. loqalkit-1.6.2/Package.swift +91 -0
  59. loqalkit-1.6.2/README.md +68 -0
  60. loqalkit-1.6.2/Sources/LoqalASR/ASRRouter.swift +335 -0
  61. loqalkit-1.6.2/Sources/LoqalASR/AudioRecorder.swift +401 -0
  62. loqalkit-1.6.2/Sources/LoqalASR/ServerASRService.swift +206 -0
  63. loqalkit-1.6.2/Sources/LoqalASR/ServerASRStreamClient.swift +194 -0
  64. loqalkit-1.6.2/Sources/LoqalASR/SpeechRecognizerService.swift +1126 -0
  65. loqalkit-1.6.2/Sources/LoqalDetection/LanguageDetector.swift +402 -0
  66. loqalkit-1.6.2/Sources/LoqalKit/ASR.swift +168 -0
  67. loqalkit-1.6.2/Sources/LoqalKit/Detection.swift +113 -0
  68. loqalkit-1.6.2/Sources/LoqalKit/Exports.swift +5 -0
  69. loqalkit-1.6.2/Sources/LoqalKit/Furigana.swift +27 -0
  70. loqalkit-1.6.2/Sources/LoqalKit/Romanization.swift +66 -0
  71. loqalkit-1.6.2/Sources/LoqalKit/Sign.swift +80 -0
  72. loqalkit-1.6.2/Sources/LoqalKit/TTS.swift +65 -0
  73. loqalkit-1.6.2/Sources/LoqalKit/Translation.swift +35 -0
  74. loqalkit-1.6.2/Sources/LoqalKit/VoicePacks.swift +79 -0
  75. loqalkit-1.6.2/Sources/LoqalLanguageClient/LanguageClient.swift +255 -0
  76. loqalkit-1.6.2/Sources/LoqalLanguageCore/Canonical.swift +98 -0
  77. loqalkit-1.6.2/Sources/LoqalLanguageCore/Configuration.swift +126 -0
  78. loqalkit-1.6.2/Sources/LoqalLanguageCore/DirectionInfo.swift +106 -0
  79. loqalkit-1.6.2/Sources/LoqalLanguageCore/FuriganaService.swift +344 -0
  80. loqalkit-1.6.2/Sources/LoqalLanguageCore/HTTPClient.swift +147 -0
  81. loqalkit-1.6.2/Sources/LoqalLanguageCore/LanguageGenderInfo.swift +233 -0
  82. loqalkit-1.6.2/Sources/LoqalLanguageCore/LoqalLanguageCore.docc/LoqalKit.md +68 -0
  83. loqalkit-1.6.2/Sources/LoqalLanguageCore/Resources/Languages.json +1435 -0
  84. loqalkit-1.6.2/Sources/LoqalLanguageCore/ScriptInfo.swift +147 -0
  85. loqalkit-1.6.2/Sources/LoqalLanguageCore/TTSProtocols.swift +27 -0
  86. loqalkit-1.6.2/Sources/LoqalOnDeviceTTS/OnDeviceTTSService.swift +465 -0
  87. loqalkit-1.6.2/Sources/LoqalOnDeviceTTS/PiperSynthesizer.swift +90 -0
  88. loqalkit-1.6.2/Sources/LoqalOnDeviceTTS/Preprocessing/CYShift.swift +104 -0
  89. loqalkit-1.6.2/Sources/LoqalOnDeviceTTS/Preprocessing/TextPreprocessor.swift +11 -0
  90. loqalkit-1.6.2/Sources/LoqalOnDeviceTTS/Preprocessing/YiddishNumbers.swift +196 -0
  91. loqalkit-1.6.2/Sources/LoqalOnDeviceTTS/Preprocessing/YiddishPreprocessor.swift +901 -0
  92. loqalkit-1.6.2/Sources/LoqalOnDeviceTTS/SherpaOnnx.swift +177 -0
  93. loqalkit-1.6.2/Sources/LoqalOnDeviceTTS/VoiceConverter.swift +422 -0
  94. loqalkit-1.6.2/Sources/LoqalSign/SignASRService.swift +48 -0
  95. loqalkit-1.6.2/Sources/LoqalSign/SignLanguages.swift +34 -0
  96. loqalkit-1.6.2/Sources/LoqalSign/SignTTSService.swift +47 -0
  97. loqalkit-1.6.2/Sources/LoqalTTS/BilingualSegmenter.swift +95 -0
  98. loqalkit-1.6.2/Sources/LoqalTTS/LocalTTSService.swift +122 -0
  99. loqalkit-1.6.2/Sources/LoqalTTS/NetworkMonitor.swift +21 -0
  100. loqalkit-1.6.2/Sources/LoqalTTS/ServerTTSService.swift +301 -0
  101. loqalkit-1.6.2/Sources/LoqalTTS/TTSRouter.swift +177 -0
  102. loqalkit-1.6.2/Sources/LoqalTTS/TTSVoiceCache.swift +28 -0
  103. loqalkit-1.6.2/Sources/LoqalTTS/VoiceResolver.swift +80 -0
  104. loqalkit-1.6.2/Sources/LoqalTranslation/TranslationService.swift +74 -0
  105. loqalkit-1.6.2/SwiftTests/LoqalKitTests/AudioRecorderTests.swift +40 -0
  106. loqalkit-1.6.2/SwiftTests/LoqalKitTests/RomanizeRoutingTests.swift +97 -0
  107. loqalkit-1.6.2/SwiftTests/LoqalLanguageClientTests/ResponseDecodeTests.swift +58 -0
  108. loqalkit-1.6.2/SwiftTests/LoqalLanguageCoreTests/CanonicalTests.swift +97 -0
  109. loqalkit-1.6.2/SwiftTests/LoqalOnDeviceTTSTests/Fixtures/loshn_koydesh.json +1 -0
  110. loqalkit-1.6.2/SwiftTests/LoqalOnDeviceTTSTests/Fixtures/yiddish_test_vectors.json +121 -0
  111. loqalkit-1.6.2/SwiftTests/LoqalOnDeviceTTSTests/YiddishPreprocessorTests.swift +178 -0
  112. loqalkit-1.6.2/SwiftTests/LoqalSignTests/SignLanguagesTests.swift +50 -0
  113. loqalkit-1.6.2/THIRD_PARTY_NOTICES.md +33 -0
  114. loqalkit-1.6.2/XCFrameworks/onnxruntime.xcframework/Info.plist +3 -0
  115. loqalkit-1.6.2/XCFrameworks/onnxruntime.xcframework/ios-arm64/libonnxruntime.a +1 -0
  116. loqalkit-1.6.2/XCFrameworks/onnxruntime.xcframework/ios-arm64/onnxruntime.a +3 -0
  117. loqalkit-1.6.2/XCFrameworks/onnxruntime.xcframework/ios-arm64_x86_64-simulator/libonnxruntime.a +1 -0
  118. loqalkit-1.6.2/XCFrameworks/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.a +3 -0
  119. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/Info.plist +3 -0
  120. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64/Headers/cargs.h +3 -0
  121. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64/Headers/module.modulemap +3 -0
  122. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64/Headers/onnxruntime_c_api.h +3 -0
  123. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64/Headers/sherpa-onnx/c-api/c-api.h +3 -0
  124. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64/Headers/sherpa-onnx/c-api/cxx-api.h +3 -0
  125. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64/libsherpa-onnx.a +3 -0
  126. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/cargs.h +3 -0
  127. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap +3 -0
  128. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/onnxruntime_c_api.h +3 -0
  129. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/sherpa-onnx/c-api/c-api.h +3 -0
  130. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/sherpa-onnx/c-api/cxx-api.h +3 -0
  131. loqalkit-1.6.2/XCFrameworks/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/libsherpa-onnx.a +3 -0
  132. loqalkit-1.6.2/docs/README.html +1370 -0
  133. loqalkit-1.6.2/docs/README.md +1087 -0
  134. loqalkit-1.6.2/docs/README.pdf +0 -0
  135. loqalkit-1.6.2/docs/USER_GUIDE.html +2211 -0
  136. loqalkit-1.6.2/docs/USER_GUIDE.md +1112 -0
  137. loqalkit-1.6.2/docs/USER_GUIDE.pdf +0 -0
  138. loqalkit-1.6.2/docs/generate.py +99 -0
  139. loqalkit-1.6.2/loqalkit/__init__.py +197 -0
  140. loqalkit-1.6.2/loqalkit/_client.py +61 -0
  141. loqalkit-1.6.2/loqalkit/accent.py +86 -0
  142. loqalkit-1.6.2/loqalkit/audio_chunk.py +190 -0
  143. loqalkit-1.6.2/loqalkit/bilingual.py +225 -0
  144. loqalkit-1.6.2/loqalkit/canonical.py +312 -0
  145. loqalkit-1.6.2/loqalkit/codes.py +71 -0
  146. loqalkit-1.6.2/loqalkit/data/silero_vad.onnx +0 -0
  147. loqalkit-1.6.2/loqalkit/detect.py +986 -0
  148. loqalkit-1.6.2/loqalkit/disambiguate.py +413 -0
  149. loqalkit-1.6.2/loqalkit/furigana.py +225 -0
  150. loqalkit-1.6.2/loqalkit/gender.py +414 -0
  151. loqalkit-1.6.2/loqalkit/languages.json +1 -0
  152. loqalkit-1.6.2/loqalkit/localize_document.py +865 -0
  153. loqalkit-1.6.2/loqalkit/prompts.py +112 -0
  154. loqalkit-1.6.2/loqalkit/refine.py +184 -0
  155. loqalkit-1.6.2/loqalkit/registry.py +130 -0
  156. loqalkit-1.6.2/loqalkit/romanize.py +486 -0
  157. loqalkit-1.6.2/loqalkit/sample_text.py +72 -0
  158. loqalkit-1.6.2/loqalkit/script_info.py +42 -0
  159. loqalkit-1.6.2/loqalkit/segment_turns.py +624 -0
  160. loqalkit-1.6.2/loqalkit/segmentation.py +197 -0
  161. loqalkit-1.6.2/loqalkit/server/__init__.py +0 -0
  162. loqalkit-1.6.2/loqalkit/server/app.py +1406 -0
  163. loqalkit-1.6.2/loqalkit/speakers.py +117 -0
  164. loqalkit-1.6.2/loqalkit/transcribe.py +430 -0
  165. loqalkit-1.6.2/loqalkit/transcribe_document.py +571 -0
  166. loqalkit-1.6.2/loqalkit/translate.py +356 -0
  167. loqalkit-1.6.2/loqalkit/tts.py +201 -0
  168. loqalkit-1.6.2/loqalkit/vad.py +320 -0
  169. loqalkit-1.6.2/loqalkit/vad_timing.py +84 -0
  170. loqalkit-1.6.2/loqalkit/vocalize.py +133 -0
  171. loqalkit-1.6.2/pyproject.toml +74 -0
  172. loqalkit-1.6.2/tests/__init__.py +0 -0
  173. loqalkit-1.6.2/tests/test_accent.py +122 -0
  174. loqalkit-1.6.2/tests/test_audio_chunk.py +173 -0
  175. loqalkit-1.6.2/tests/test_bilingual.py +100 -0
  176. loqalkit-1.6.2/tests/test_canonical.py +213 -0
  177. loqalkit-1.6.2/tests/test_codes.py +29 -0
  178. loqalkit-1.6.2/tests/test_detect_hints.py +125 -0
  179. loqalkit-1.6.2/tests/test_detect_subject.py +171 -0
  180. loqalkit-1.6.2/tests/test_furigana.py +147 -0
  181. loqalkit-1.6.2/tests/test_gender.py +279 -0
  182. loqalkit-1.6.2/tests/test_iso639_canonical.py +114 -0
  183. loqalkit-1.6.2/tests/test_language_prompt.py +119 -0
  184. loqalkit-1.6.2/tests/test_language_provider_map.py +146 -0
  185. loqalkit-1.6.2/tests/test_lid_windows.py +194 -0
  186. loqalkit-1.6.2/tests/test_localize_document.py +425 -0
  187. loqalkit-1.6.2/tests/test_refine.py +144 -0
  188. loqalkit-1.6.2/tests/test_registry.py +52 -0
  189. loqalkit-1.6.2/tests/test_romanize.py +175 -0
  190. loqalkit-1.6.2/tests/test_sample_text.py +57 -0
  191. loqalkit-1.6.2/tests/test_script_info.py +27 -0
  192. loqalkit-1.6.2/tests/test_segment_turns.py +639 -0
  193. loqalkit-1.6.2/tests/test_transcribe_document.py +451 -0
  194. loqalkit-1.6.2/tests/test_transcribe_gate.py +63 -0
  195. loqalkit-1.6.2/tests/test_translate.py +146 -0
  196. loqalkit-1.6.2/tests/test_transliterate.py +104 -0
  197. loqalkit-1.6.2/tests/test_vad.py +108 -0
  198. loqalkit-1.6.2/tests/test_vocalize.py +98 -0
@@ -0,0 +1 @@
1
+ XCFrameworks/** filter=lfs diff=lfs merge=lfs -text
@@ -0,0 +1,85 @@
1
+ name: publish
2
+
3
+ # Publish the Python package to PyPI when a version tag appears.
4
+ #
5
+ # tag-release.yml creates v<version> whenever pyproject.toml's version changes
6
+ # on main, so the full chain is: bump the version in a PR -> merge -> tag is
7
+ # created -> this workflow publishes it. No hand-cut tags, no manual upload.
8
+ #
9
+ # Authentication is PyPI Trusted Publishing (OIDC). There is no API token to
10
+ # store or rotate — GitHub mints a short-lived identity for this specific
11
+ # workflow in this specific repo, and PyPI verifies it. That is why nothing
12
+ # here reads `secrets`.
13
+
14
+ on:
15
+ push:
16
+ tags: ["v*"]
17
+ workflow_dispatch:
18
+
19
+ jobs:
20
+ build:
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.12"
28
+
29
+ - run: pip install build
30
+
31
+ - run: python -m build
32
+
33
+ - name: Check the built version matches the tag
34
+ if: startsWith(github.ref, 'refs/tags/')
35
+ run: |
36
+ # Guards the failure mode that motivated this workflow: a tag cut by
37
+ # hand without bumping pyproject.toml. The package then reports a
38
+ # version that no pin can ever satisfy, and anything comparing the
39
+ # pinned tag against installed metadata reinstalls forever without
40
+ # converging. Refuse to publish that.
41
+ tag="${GITHUB_REF#refs/tags/v}"
42
+ built=$(python -c "
43
+ import pathlib, re
44
+ names = [p.name for p in pathlib.Path('dist').glob('*.whl')]
45
+ print(re.match(r'loqalkit-([^-]+)-', names[0]).group(1))
46
+ ")
47
+ echo "tag=$tag built=$built"
48
+ if [ "$tag" != "$built" ]; then
49
+ echo "::error::Tag v$tag does not match built version $built."
50
+ echo "::error::Bump version in pyproject.toml rather than tagging by hand."
51
+ exit 1
52
+ fi
53
+
54
+ - name: Check the VAD model shipped in the wheel
55
+ run: |
56
+ # hatchling includes .py by default but not data files; the artifacts
57
+ # config in pyproject.toml is what pulls this in. Without it the vad
58
+ # extra installs onnxruntime and then fails at runtime on a missing
59
+ # model, which is a far worse way to find out.
60
+ python - <<'PY'
61
+ import pathlib, sys, zipfile
62
+ whl = next(pathlib.Path("dist").glob("*.whl"))
63
+ names = zipfile.ZipFile(whl).namelist()
64
+ if "loqalkit/data/silero_vad.onnx" not in names:
65
+ sys.exit(f"silero_vad.onnx missing from {whl.name}")
66
+ print(f"OK — VAD model present in {whl.name}")
67
+ PY
68
+
69
+ - uses: actions/upload-artifact@v4
70
+ with:
71
+ name: dist
72
+ path: dist/
73
+
74
+ publish:
75
+ needs: build
76
+ runs-on: ubuntu-latest
77
+ permissions:
78
+ id-token: write # required for Trusted Publishing; do not remove
79
+ steps:
80
+ - uses: actions/download-artifact@v4
81
+ with:
82
+ name: dist
83
+ path: dist/
84
+
85
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,34 @@
1
+ name: tag-release
2
+
3
+ # Auto-create the git tag v<version> whenever the version in pyproject.toml
4
+ # changes on main. The version in pyproject.toml is the single source of truth;
5
+ # LoqalKitServer installs core by this tag (git+...@vX.Y.Z), so the tag must
6
+ # exist before its Docker build runs. Bump the version in a PR, merge, and the
7
+ # matching tag appears automatically — no hand-cut tags.
8
+
9
+ on:
10
+ push:
11
+ branches: [main]
12
+ paths: ["pyproject.toml"]
13
+
14
+ jobs:
15
+ tag:
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ contents: write
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ with:
22
+ fetch-depth: 0
23
+ - id: v
24
+ run: echo "version=$(grep -m1 '^version' pyproject.toml | cut -d'"' -f2)" >> "$GITHUB_OUTPUT"
25
+ - name: Create tag if missing
26
+ run: |
27
+ tag="v${{ steps.v.outputs.version }}"
28
+ if git rev-parse "$tag" >/dev/null 2>&1; then
29
+ echo "$tag already exists — nothing to do"
30
+ else
31
+ git tag "$tag"
32
+ git push origin "$tag"
33
+ echo "created and pushed $tag"
34
+ fi
@@ -0,0 +1,23 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .eggs/
7
+ *.egg
8
+ .venv/
9
+ venv/
10
+ .env
11
+ .claude-tmp/
12
+ .DS_Store
13
+
14
+ # Swift Package Manager
15
+ .build/
16
+ .swiftpm/
17
+
18
+ # Android / Gradle
19
+ .gradle/
20
+ local.properties
21
+ *.iml
22
+ .idea/
23
+ .claude/settings.local.json
@@ -0,0 +1,53 @@
1
+ # LoqalKit
2
+
3
+ Unified language SDK — detection, transcription, romanization, translation, TTS routing.
4
+
5
+ **Repo:** `SoratoGroup/loqalkit`
6
+
7
+ ## Structure
8
+
9
+ ```
10
+ LoqalKit/
11
+ ├── loqalkit/ # Python package
12
+ │ ├── __init__.py # Re-exports all public symbols
13
+ │ ├── bilingual.py # [[Marker]] segment parsing
14
+ │ ├── canonical.py # Language-tag canonicalization (includes legacy codes)
15
+ │ ├── codes.py # BCP-47 normalization
16
+ │ ├── detect.py # Text + audio language detection
17
+ │ ├── disambiguate.py # LLM disambiguation for confusable families
18
+ │ ├── prompts.py # ASR language prompts
19
+ │ ├── registry.py # Per-language metadata (languages.json)
20
+ │ ├── romanize.py # Romanization (batch + segment-aware)
21
+ │ ├── script_info.py # Latin vs non-Latin script classification
22
+ │ ├── segmentation.py # Long-segment splitting
23
+ │ ├── speakers.py # Speaker extraction
24
+ │ ├── transcribe.py # ASR via gpt-4o-transcribe
25
+ │ ├── translate.py # JSON/text translation
26
+ │ ├── vocalize.py # Niqqud/harakat vowel marks
27
+ │ ├── languages.json # Language metadata
28
+ │ └── _client.py # OpenAI client accessor (dual-path)
29
+ ├── tests/
30
+ ├── pyproject.toml
31
+ └── CLAUDE.md
32
+ ```
33
+
34
+ ## Dev
35
+
36
+ ```bash
37
+ pip install -e .
38
+ pytest tests/ -v
39
+ ```
40
+
41
+ **Server:** The FastAPI server has been extracted to its own repository. See `LoqalKitServer/` (`SoratoGroup/loqalkitserver`).
42
+
43
+ ## Consumers
44
+
45
+ - **ManabuDashboard** — `pip install loqalkit` (direct import)
46
+ - **ManabuAgent** — `pip install loqalkit` (direct import + async APIs)
47
+ - **ManabuApple** — Swift package (LoqalKitSwift, future)
48
+ - **ManabuAndroid** — Kotlin library (LoqalKitAndroid, future)
49
+
50
+ ## Architecture
51
+
52
+ - **LoqalKit Server** (CPU, Vultr) — all language APIs, TTS routing. Extracted to `LoqalKitServer/` (`SoratoGroup/loqalkitserver`).
53
+ - **LoqalKit GPU Worker** (RunPod) — Piper synthesis, MMS-LID, voice cloning
@@ -0,0 +1,18 @@
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Copy only dependency metadata first for layer caching
6
+ COPY pyproject.toml ./
7
+
8
+ # Copy full source, then install in one layer
9
+ COPY . .
10
+ RUN pip install --no-cache-dir '.[serve]'
11
+
12
+ EXPOSE 8100
13
+
14
+ # Runtime env vars (must be provided by Dokploy):
15
+ # MANABU_APP_SECRET �� shared secret for X-App-Secret auth
16
+ # OPENAI_API_KEY — or proxy URL via MANABU_PROXY_BASE_URL
17
+
18
+ CMD ["uvicorn", "loqalkit.server.app:app", "--host", "0.0.0.0", "--port", "8100"]
loqalkit-1.6.2/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Copyright (c) 2026 Sorato Group. All rights reserved.
2
+
3
+ LoqalKit is proprietary software.
4
+
5
+ Permission is granted to download, install, and use this package solely for the
6
+ purpose of accessing the Loqal platform through a valid subscription or API key
7
+ issued by Sorato Group, subject to the applicable terms of service.
8
+
9
+ You may not redistribute, sublicense, sell, or publish this software or any
10
+ derivative of it, and you may not modify, reverse engineer, decompile, or
11
+ disassemble it, except to the extent that such restriction is prohibited by
12
+ applicable law.
13
+
14
+ Third-party components redistributed with this package are licensed separately
15
+ and are listed in THIRD_PARTY_NOTICES.md. Nothing in this license limits your
16
+ rights under those licenses with respect to those components.
17
+
18
+ THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,48 @@
1
+ plugins {
2
+ id("com.android.library") version "8.9.1"
3
+ id("org.jetbrains.kotlin.android") version "2.1.0"
4
+ id("org.jetbrains.kotlin.plugin.serialization") version "2.1.0"
5
+ id("maven-publish")
6
+ }
7
+
8
+ group = "com.sorato"
9
+ version = "1.0.0"
10
+
11
+ android {
12
+ namespace = "com.sorato.loqalkit"
13
+ compileSdk = 36
14
+ defaultConfig { minSdk = 26 }
15
+ compileOptions {
16
+ sourceCompatibility = JavaVersion.VERSION_17
17
+ targetCompatibility = JavaVersion.VERSION_17
18
+ }
19
+ kotlinOptions { jvmTarget = "17" }
20
+ }
21
+
22
+ dependencies {
23
+ implementation("com.squareup.okhttp3:okhttp:4.12.0")
24
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
25
+ implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
26
+ implementation("androidx.core:core-ktx:1.15.0")
27
+
28
+ // On-device TTS: Piper via sherpa-onnx + OpenVoice via ONNX Runtime
29
+ implementation("com.github.k2-fsa:sherpa-onnx:1.12.34")
30
+ implementation("com.microsoft.onnxruntime:onnxruntime-android:1.23.2")
31
+
32
+ // Japanese morphological analysis for furigana
33
+ implementation("com.atilika.kuromoji:kuromoji-ipadic:0.9.0")
34
+
35
+ testImplementation("org.jetbrains.kotlin:kotlin-test")
36
+ testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
37
+ }
38
+
39
+ publishing {
40
+ publications {
41
+ register<MavenPublication>("release") {
42
+ afterEvaluate {
43
+ from(components["release"])
44
+ }
45
+ artifactId = "loqalkit"
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,146 @@
1
+ [versions]
2
+ agp = "8.9.1"
3
+ kotlin = "2.1.0"
4
+ ksp = "2.1.0-1.0.29"
5
+ compose-bom = "2025.01.01"
6
+ hilt = "2.54"
7
+ navigation = "2.8.5"
8
+ serialization = "1.7.3"
9
+ coroutines = "1.9.0"
10
+ retrofit = "2.11.0"
11
+ okhttp = "4.12.0"
12
+ supabase = "3.1.4"
13
+ ktor = "3.0.3"
14
+ livekit = "2.23.5"
15
+ media3 = "1.5.1"
16
+ billing = "7.1.1"
17
+ coil = "3.0.4"
18
+ maps-compose = "6.4.1"
19
+ lifecycle = "2.8.7"
20
+ activity-compose = "1.9.3"
21
+ core-ktx = "1.15.0"
22
+ datastore = "1.1.1"
23
+ work = "2.10.0"
24
+ facebook = "17.0.2"
25
+ junit = "4.13.2"
26
+
27
+ [libraries]
28
+ # Compose
29
+ compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
30
+ compose-ui = { group = "androidx.compose.ui", name = "ui" }
31
+ compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
32
+ compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
33
+ compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
34
+ compose-material3 = { group = "androidx.compose.material3", name = "material3" }
35
+ compose-material-icons = { group = "androidx.compose.material", name = "material-icons-extended" }
36
+ compose-animation = { group = "androidx.compose.animation", name = "animation" }
37
+
38
+ # AndroidX
39
+ activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activity-compose" }
40
+ core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
41
+ lifecycle-runtime = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle" }
42
+ lifecycle-viewmodel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }
43
+
44
+ # DataStore
45
+ datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "datastore" }
46
+
47
+ # Navigation
48
+ navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" }
49
+
50
+ # Hilt
51
+ hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
52
+ hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
53
+ hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version = "1.2.0" }
54
+
55
+ # Serialization
56
+ serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" }
57
+
58
+ # Coroutines
59
+ coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "coroutines" }
60
+ coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
61
+
62
+ # Networking
63
+ retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }
64
+ retrofit-serialization = { group = "com.squareup.retrofit2", name = "converter-kotlinx-serialization", version.ref = "retrofit" }
65
+ okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }
66
+ okhttp-logging = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttp" }
67
+
68
+ # Supabase
69
+ supabase-auth = { group = "io.github.jan-tennert.supabase", name = "auth-kt", version.ref = "supabase" }
70
+ supabase-postgrest = { group = "io.github.jan-tennert.supabase", name = "postgrest-kt", version.ref = "supabase" }
71
+ supabase-realtime = { group = "io.github.jan-tennert.supabase", name = "realtime-kt", version.ref = "supabase" }
72
+ ktor-client-android = { group = "io.ktor", name = "ktor-client-android", version.ref = "ktor" }
73
+
74
+ # LiveKit
75
+ livekit-android = { group = "io.livekit", name = "livekit-android", version.ref = "livekit" }
76
+
77
+ # Media
78
+ media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "media3" }
79
+ media3-exoplayer-hls = { group = "androidx.media3", name = "media3-exoplayer-hls", version.ref = "media3" }
80
+ media3-effect = { group = "androidx.media3", name = "media3-effect", version.ref = "media3" }
81
+ media3-ui = { group = "androidx.media3", name = "media3-ui", version.ref = "media3" }
82
+ media3-common = { group = "androidx.media3", name = "media3-common", version.ref = "media3" }
83
+ media3-datasource = { group = "androidx.media3", name = "media3-datasource", version.ref = "media3" }
84
+ media3-datasource-okhttp = { group = "androidx.media3", name = "media3-datasource-okhttp", version.ref = "media3" }
85
+ media3-database = { group = "androidx.media3", name = "media3-database", version.ref = "media3" }
86
+ media3-session = { group = "androidx.media3", name = "media3-session", version.ref = "media3" }
87
+
88
+ # Billing
89
+ billing-ktx = { group = "com.android.billingclient", name = "billing-ktx", version.ref = "billing" }
90
+
91
+ # Images
92
+ coil-compose = { group = "io.coil-kt.coil3", name = "coil-compose", version.ref = "coil" }
93
+ coil-network = { group = "io.coil-kt.coil3", name = "coil-network-okhttp", version.ref = "coil" }
94
+
95
+ # Google Maps
96
+ maps-compose = { group = "com.google.maps.android", name = "maps-compose", version.ref = "maps-compose" }
97
+
98
+ # Google Sign-In (Credential Manager)
99
+ credentials = { group = "androidx.credentials", name = "credentials", version = "1.5.0" }
100
+ credentials-play-services = { group = "androidx.credentials", name = "credentials-play-services-auth", version = "1.5.0" }
101
+ google-id = { group = "com.google.android.libraries.identity.googleid", name = "googleid", version = "1.1.1" }
102
+
103
+ # WorkManager
104
+ work-runtime = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "work" }
105
+
106
+ # Facebook
107
+ facebook-core = { group = "com.facebook.android", name = "facebook-core", version.ref = "facebook" }
108
+
109
+ # ML Kit (text recognition for camera scan, matching iOS DataScannerViewController)
110
+ mlkit-text = { group = "com.google.mlkit", name = "text-recognition", version = "16.0.1" }
111
+
112
+ # CameraX (for camera preview in scan mode)
113
+ camerax-core = { group = "androidx.camera", name = "camera-core", version = "1.4.1" }
114
+ camerax-camera2 = { group = "androidx.camera", name = "camera-camera2", version = "1.4.1" }
115
+ camerax-lifecycle = { group = "androidx.camera", name = "camera-lifecycle", version = "1.4.1" }
116
+ camerax-view = { group = "androidx.camera", name = "camera-view", version = "1.4.1" }
117
+
118
+ # On-device TTS
119
+ # IMPORTANT: onnxruntime-android version MUST match the ONNX Runtime that
120
+ # sherpa-onnx bundles in its AAR. sherpa-onnx 1.12.34 ships a libonnxruntime.so
121
+ # built from ORT 1.23.2 (exports OrtGetApiBase@@VERS_1.23.2). Mismatched
122
+ # versions cause:
123
+ # java.lang.UnsatisfiedLinkError: cannot locate symbol "OrtGetApiBase"
124
+ # referenced by "libonnxruntime4j_jni.so"
125
+ # at VoiceConverter load time, because Android merges the duplicate
126
+ # libonnxruntime.so entries to one file and the JNI ends up calling a
127
+ # differently-versioned libonnxruntime.so than it was built against.
128
+ # When bumping sherpa-onnx, re-verify the bundled ORT version with:
129
+ # llvm-readelf --dyn-symbols libonnxruntime.so | grep OrtGetApiBase
130
+ # and update this version to match (downgrade if necessary).
131
+ sherpa-onnx = { group = "com.github.k2-fsa", name = "sherpa-onnx", version = "1.12.34" }
132
+ onnxruntime-android = { group = "com.microsoft.onnxruntime", name = "onnxruntime-android", version = "1.23.2" }
133
+
134
+ # Testing
135
+ junit = { group = "junit", name = "junit", version.ref = "junit" }
136
+
137
+ [plugins]
138
+ android-application = { id = "com.android.application", version.ref = "agp" }
139
+ android-library = { id = "com.android.library", version.ref = "agp" }
140
+ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
141
+ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
142
+ kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
143
+ ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
144
+ hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
145
+ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
146
+ play-publisher = { id = "com.github.triplet.play", version = "3.12.1" }
@@ -0,0 +1,7 @@
1
+ distributionBase=GRADLE_USER_HOME
2
+ distributionPath=wrapper/dists
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
4
+ networkTimeout=10000
5
+ validateDistributionUrl=true
6
+ zipStoreBase=GRADLE_USER_HOME
7
+ zipStorePath=wrapper/dists
@@ -0,0 +1,2 @@
1
+ android.useAndroidX=true
2
+ org.gradle.jvmargs=-Xmx2048m