kaz-morph 0.1.0__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 (49) hide show
  1. kaz_morph-0.1.0/.github/workflows/packages.yml +89 -0
  2. kaz_morph-0.1.0/.gitignore +10 -0
  3. kaz_morph-0.1.0/Cargo.lock +765 -0
  4. kaz_morph-0.1.0/Cargo.toml +30 -0
  5. kaz_morph-0.1.0/LICENSE +21 -0
  6. kaz_morph-0.1.0/PKG-INFO +143 -0
  7. kaz_morph-0.1.0/README.md +131 -0
  8. kaz_morph-0.1.0/bindings/python/Cargo.toml +15 -0
  9. kaz_morph-0.1.0/bindings/python/src/lib.rs +107 -0
  10. kaz_morph-0.1.0/bindings/python/tests/test_context.py +59 -0
  11. kaz_morph-0.1.0/bindings/wasm/Cargo.toml +17 -0
  12. kaz_morph-0.1.0/bindings/wasm/src/lib.rs +116 -0
  13. kaz_morph-0.1.0/bindings/wasm/test.html +24 -0
  14. kaz_morph-0.1.0/bindings/wasm/tests/context.cjs +40 -0
  15. kaz_morph-0.1.0/bindings/wasm/tests/package.html +13 -0
  16. kaz_morph-0.1.0/bindings/wasm/tests/package.mjs +26 -0
  17. kaz_morph-0.1.0/cli/Cargo.toml +15 -0
  18. kaz_morph-0.1.0/cli/src/main.rs +71 -0
  19. kaz_morph-0.1.0/cli/tests/tokens.rs +33 -0
  20. kaz_morph-0.1.0/core/Cargo.toml +21 -0
  21. kaz_morph-0.1.0/core/benches/analyze.rs +64 -0
  22. kaz_morph-0.1.0/core/data/COPYING.apertium +674 -0
  23. kaz_morph-0.1.0/core/data/SOURCES.md +10 -0
  24. kaz_morph-0.1.0/core/data/lexicon.tsv +22610 -0
  25. kaz_morph-0.1.0/core/src/analyzer/adjective.rs +42 -0
  26. kaz_morph-0.1.0/core/src/analyzer/context.rs +58 -0
  27. kaz_morph-0.1.0/core/src/analyzer/converb.rs +86 -0
  28. kaz_morph-0.1.0/core/src/analyzer/mod.rs +134 -0
  29. kaz_morph-0.1.0/core/src/analyzer/noun.rs +64 -0
  30. kaz_morph-0.1.0/core/src/analyzer/present_future.rs +72 -0
  31. kaz_morph-0.1.0/core/src/analyzer/suffixes.rs +248 -0
  32. kaz_morph-0.1.0/core/src/analyzer/tests.rs +703 -0
  33. kaz_morph-0.1.0/core/src/analyzer/verb.rs +186 -0
  34. kaz_morph-0.1.0/core/src/analyzer/verbal_noun.rs +55 -0
  35. kaz_morph-0.1.0/core/src/irregular.rs +76 -0
  36. kaz_morph-0.1.0/core/src/lexicon.rs +276 -0
  37. kaz_morph-0.1.0/core/src/lib.rs +8 -0
  38. kaz_morph-0.1.0/core/src/phonology.rs +253 -0
  39. kaz_morph-0.1.0/core/src/types.rs +114 -0
  40. kaz_morph-0.1.0/core/tests/context.rs +74 -0
  41. kaz_morph-0.1.0/core/tests/converbs.rs +202 -0
  42. kaz_morph-0.1.0/core/tests/past_participle.rs +132 -0
  43. kaz_morph-0.1.0/core/tests/present_future.rs +117 -0
  44. kaz_morph-0.1.0/core/tests/short_agreement.rs +151 -0
  45. kaz_morph-0.1.0/core/tests/verbal_nouns.rs +164 -0
  46. kaz_morph-0.1.0/data/lexicon/apertium.tsv +22610 -0
  47. kaz_morph-0.1.0/pyproject.toml +19 -0
  48. kaz_morph-0.1.0/scripts/pack-npm.sh +36 -0
  49. kaz_morph-0.1.0/scripts/parse_apertium.py +80 -0
@@ -0,0 +1,89 @@
1
+ name: Distribution packages
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_dispatch:
6
+ push:
7
+ tags: ['v*']
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ python:
14
+ name: Python / ${{ matrix.target }}
15
+ runs-on: ${{ matrix.os }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ include:
20
+ - os: ubuntu-24.04
21
+ target: x86_64-unknown-linux-gnu
22
+ - os: ubuntu-24.04-arm
23
+ target: aarch64-unknown-linux-gnu
24
+ - os: macos-15
25
+ target: aarch64-apple-darwin
26
+ - os: macos-15-intel
27
+ target: x86_64-apple-darwin
28
+ - os: windows-2025
29
+ target: x86_64-pc-windows-msvc
30
+ steps:
31
+ - uses: actions/checkout@v6
32
+ - uses: actions/setup-python@v6
33
+ with:
34
+ python-version: '3.12'
35
+ - name: Build wheel
36
+ uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
37
+ with:
38
+ maturin-version: v1.14.0
39
+ target: ${{ matrix.target }}
40
+ manylinux: '2_28'
41
+ args: --release --locked --out dist ${{ matrix.os == 'macos-15' && '--sdist' || '' }}
42
+ - name: Install and test the wheel
43
+ run: |
44
+ python -m pip install --no-index --only-binary=:all: --find-links dist kaz-morph
45
+ python -I -m unittest discover -s bindings/python/tests -v
46
+ - uses: actions/upload-artifact@v6
47
+ with:
48
+ name: python-${{ matrix.target }}
49
+ path: dist/*
50
+ if-no-files-found: error
51
+
52
+ npm:
53
+ runs-on: ubuntu-24.04
54
+ steps:
55
+ - uses: actions/checkout@v6
56
+ - uses: actions/setup-node@v6
57
+ with:
58
+ node-version: '22'
59
+ package-manager-cache: false
60
+ - name: Build npm tarball
61
+ run: |
62
+ rustup target add wasm32-unknown-unknown
63
+ npm install --global wasm-pack@0.15.0
64
+ sh scripts/pack-npm.sh
65
+ - name: Install and test the tarball
66
+ run: |
67
+ consumer="$RUNNER_TEMP/kaz-morph-consumer"
68
+ mkdir -p "$consumer"
69
+ npm install --prefix "$consumer" --offline --ignore-scripts --no-audit --no-fund "$PWD"/dist/*.tgz
70
+ cp bindings/wasm/tests/context.cjs bindings/wasm/tests/package.mjs "$consumer/"
71
+ cd "$consumer"
72
+ KAZ_MORPH_WASM_PKG=kaz-morph-wasm node --test context.cjs package.mjs
73
+ - name: Load the installed package in Chrome
74
+ run: |
75
+ consumer="$RUNNER_TEMP/kaz-morph-consumer"
76
+ cp bindings/wasm/tests/package.html "$consumer/"
77
+ python3 -m http.server 8765 --bind 127.0.0.1 --directory "$consumer" &
78
+ server=$!
79
+ trap 'kill "$server"' EXIT
80
+ url=http://127.0.0.1:8765/package.html
81
+ curl --fail --silent --retry 10 --retry-connrefused --retry-delay 1 "$url" -o /dev/null
82
+ google-chrome --headless --user-data-dir="$RUNNER_TEMP/kaz-morph-chrome" \
83
+ --virtual-time-budget=10000 --dump-dom "$url" > "$RUNNER_TEMP/kaz-morph-dom.html"
84
+ grep -Fq '<output id="result">ал PastDefinite</output>' "$RUNNER_TEMP/kaz-morph-dom.html"
85
+ - uses: actions/upload-artifact@v6
86
+ with:
87
+ name: npm
88
+ path: dist/*.tgz
89
+ if-no-files-found: error
@@ -0,0 +1,10 @@
1
+ /target
2
+ **/target
3
+ *.swp
4
+ *.swo
5
+ .DS_Store
6
+ __pycache__/
7
+ *.egg-info/
8
+ dist/
9
+ pkg/
10
+ node_modules/