esmorph 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 (89) hide show
  1. esmorph-0.1.0/.cargo/config.toml +4 -0
  2. esmorph-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +34 -0
  3. esmorph-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  4. esmorph-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +22 -0
  5. esmorph-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +7 -0
  6. esmorph-0.1.0/.github/dependabot.yml +30 -0
  7. esmorph-0.1.0/.github/workflows/ci.yml +155 -0
  8. esmorph-0.1.0/.github/workflows/docs.yml +37 -0
  9. esmorph-0.1.0/.github/workflows/publish.yml +475 -0
  10. esmorph-0.1.0/.gitignore +34 -0
  11. esmorph-0.1.0/.pre-commit-config.yaml +71 -0
  12. esmorph-0.1.0/.python-version +1 -0
  13. esmorph-0.1.0/CITATION.cff +27 -0
  14. esmorph-0.1.0/CODE_OF_CONDUCT.md +54 -0
  15. esmorph-0.1.0/CONTRIBUTING.md +63 -0
  16. esmorph-0.1.0/Cargo.lock +191 -0
  17. esmorph-0.1.0/Cargo.toml +15 -0
  18. esmorph-0.1.0/LICENSE-DICTIONARY.txt +18 -0
  19. esmorph-0.1.0/LICENSE.txt +17 -0
  20. esmorph-0.1.0/Makefile +118 -0
  21. esmorph-0.1.0/PKG-INFO +279 -0
  22. esmorph-0.1.0/README.es.md +243 -0
  23. esmorph-0.1.0/README.md +243 -0
  24. esmorph-0.1.0/THIRD-PARTY-NOTICES.txt +276 -0
  25. esmorph-0.1.0/crates/esmorph/Cargo.toml +31 -0
  26. esmorph-0.1.0/crates/esmorph/LICENSE.txt +17 -0
  27. esmorph-0.1.0/crates/esmorph/README.md +48 -0
  28. esmorph-0.1.0/crates/esmorph/src/alphabet.rs +331 -0
  29. esmorph-0.1.0/crates/esmorph/src/builder.rs +849 -0
  30. esmorph-0.1.0/crates/esmorph/src/clitics.rs +315 -0
  31. esmorph-0.1.0/crates/esmorph/src/dictionary/guess.rs +442 -0
  32. esmorph-0.1.0/crates/esmorph/src/dictionary.rs +2683 -0
  33. esmorph-0.1.0/crates/esmorph/src/error.rs +38 -0
  34. esmorph-0.1.0/crates/esmorph/src/format.rs +685 -0
  35. esmorph-0.1.0/crates/esmorph/src/lib.rs +40 -0
  36. esmorph-0.1.0/crates/esmorph/src/rules.rs +640 -0
  37. esmorph-0.1.0/crates/esmorph/src/ud.rs +302 -0
  38. esmorph-0.1.0/crates/esmorph-build/Cargo.toml +13 -0
  39. esmorph-0.1.0/crates/esmorph-build/src/frequencies.rs +393 -0
  40. esmorph-0.1.0/crates/esmorph-build/src/main.rs +249 -0
  41. esmorph-0.1.0/crates/esmorph-dict-es/Cargo.toml +15 -0
  42. esmorph-0.1.0/crates/esmorph-dict-es/LICENSE-DICTIONARY.txt +18 -0
  43. esmorph-0.1.0/crates/esmorph-dict-es/LICENSE.txt +17 -0
  44. esmorph-0.1.0/crates/esmorph-dict-es/README.md +7 -0
  45. esmorph-0.1.0/crates/esmorph-dict-es/build.rs +47 -0
  46. esmorph-0.1.0/crates/esmorph-dict-es/src/lib.rs +25 -0
  47. esmorph-0.1.0/crates/esmorph-py/Cargo.toml +18 -0
  48. esmorph-0.1.0/crates/esmorph-py/src/lib.rs +1024 -0
  49. esmorph-0.1.0/data/closed-classes.tsv +637 -0
  50. esmorph-0.1.0/data/units.tsv +35 -0
  51. esmorph-0.1.0/docs/analysis.es.md +152 -0
  52. esmorph-0.1.0/docs/analysis.md +152 -0
  53. esmorph-0.1.0/docs/analyzer.es.md +206 -0
  54. esmorph-0.1.0/docs/analyzer.md +206 -0
  55. esmorph-0.1.0/docs/authors.es.md +11 -0
  56. esmorph-0.1.0/docs/authors.md +11 -0
  57. esmorph-0.1.0/docs/comparison.es.md +124 -0
  58. esmorph-0.1.0/docs/comparison.md +124 -0
  59. esmorph-0.1.0/docs/css/extra.css +33 -0
  60. esmorph-0.1.0/docs/exceptions.es.md +36 -0
  61. esmorph-0.1.0/docs/exceptions.md +36 -0
  62. esmorph-0.1.0/docs/img/esmorph.png +0 -0
  63. esmorph-0.1.0/docs/img/esmorph.svg +18 -0
  64. esmorph-0.1.0/docs/img/speed.es.svg +62 -0
  65. esmorph-0.1.0/docs/img/speed.svg +62 -0
  66. esmorph-0.1.0/docs/index.es.md +99 -0
  67. esmorph-0.1.0/docs/index.md +99 -0
  68. esmorph-0.1.0/docs/inflection.es.md +95 -0
  69. esmorph-0.1.0/docs/inflection.md +95 -0
  70. esmorph-0.1.0/docs/installation.es.md +42 -0
  71. esmorph-0.1.0/docs/installation.md +42 -0
  72. esmorph-0.1.0/mkdocs.yml +102 -0
  73. esmorph-0.1.0/pyproject.toml +156 -0
  74. esmorph-0.1.0/python/esmorph/__init__.py +14 -0
  75. esmorph-0.1.0/python/esmorph/_esmorph.pyi +89 -0
  76. esmorph-0.1.0/python/esmorph/data/es.dict +0 -0
  77. esmorph-0.1.0/python/esmorph/py.typed +0 -0
  78. esmorph-0.1.0/scripts/compare.py +885 -0
  79. esmorph-0.1.0/scripts/compare.py.lock +1977 -0
  80. esmorph-0.1.0/scripts/conventions.py +306 -0
  81. esmorph-0.1.0/scripts/export_ud.py +115 -0
  82. esmorph-0.1.0/scripts/export_wiktionary.py +804 -0
  83. esmorph-0.1.0/scripts/notices.py +98 -0
  84. esmorph-0.1.0/scripts/smoke.py +29 -0
  85. esmorph-0.1.0/scripts/wiktionary_snapshot.py +85 -0
  86. esmorph-0.1.0/tests/test_analyzer.py +1347 -0
  87. esmorph-0.1.0/tests/test_docs.py +76 -0
  88. esmorph-0.1.0/tests/test_package.py +106 -0
  89. esmorph-0.1.0/uv.lock +1294 -0
@@ -0,0 +1,4 @@
1
+ # Code that needs no dictionary is checked without `make dictionary`; a dependency from git does not
2
+ # read this file
3
+ [env]
4
+ ESMORPH_EMPTY_DICTIONARY = "1"
@@ -0,0 +1,34 @@
1
+ name: Bug report
2
+ description: Wrong analysis, exception or crash
3
+ labels: ["bug"]
4
+ body:
5
+ - type: textarea
6
+ id: description
7
+ attributes:
8
+ label: What happens
9
+ description: What you expected and what you got
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: reproduce
14
+ attributes:
15
+ label: How to reproduce
16
+ description: The word forms or minimal code that trigger the bug and the full traceback, if any
17
+ render: python
18
+ validations:
19
+ required: true
20
+ - type: input
21
+ id: version
22
+ attributes:
23
+ label: esMorph version
24
+ description: "`python -c \"import esmorph; print(esmorph.__version__)\"`"
25
+ placeholder: "0.1.0"
26
+ validations:
27
+ required: true
28
+ - type: input
29
+ id: environment
30
+ attributes:
31
+ label: Python and OS
32
+ placeholder: "Python 3.12, macOS 15"
33
+ validations:
34
+ required: true
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Documentation
4
+ url: https://sergeyshk.github.io/esMorph/
5
+ about: Installation and use of the analyzer
@@ -0,0 +1,22 @@
1
+ name: Feature request
2
+ description: A new feature, missing words or an improvement
3
+ labels: ["enhancement"]
4
+ body:
5
+ - type: textarea
6
+ id: problem
7
+ attributes:
8
+ label: What problem does it solve
9
+ description: What you want to do and why the current features are not enough
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: proposal
14
+ attributes:
15
+ label: Proposed solution
16
+ description: How it could look in the API - a method, a parameter
17
+ - type: checkboxes
18
+ id: contribution
19
+ attributes:
20
+ label: Contribution
21
+ options:
22
+ - label: I am willing to submit a pull request
@@ -0,0 +1,7 @@
1
+ ## What was done
2
+
3
+ <!-- What changed and why. If the Python API, the analyses or the dictionary format change, say so explicitly: it goes into the release notes. If the pull request closes an issue: Closes #123 -->
4
+
5
+ ## Verification
6
+
7
+ <!-- How it was checked: tests (what exactly they verify), `make lint`, `make test-cov`, `make docs-build` if the documentation changed. Reminder: the documentation and README are bilingual - `docs/*.md` + `docs/*.es.md`, `README.md` + `README.es.md` -->
@@ -0,0 +1,30 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "uv"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "monthly"
7
+ open-pull-requests-limit: 5
8
+ groups:
9
+ python-dependencies:
10
+ patterns: ["*"]
11
+ update-types: ["minor", "patch"]
12
+
13
+ - package-ecosystem: "cargo"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "monthly"
17
+ open-pull-requests-limit: 5
18
+ labels: ["dependencies"]
19
+ groups:
20
+ rust-dependencies:
21
+ patterns: ["*"]
22
+ update-types: ["minor", "patch"]
23
+
24
+ - package-ecosystem: "github-actions"
25
+ directory: "/"
26
+ schedule:
27
+ interval: "monthly"
28
+ groups:
29
+ github-actions:
30
+ patterns: ["*"]
@@ -0,0 +1,155 @@
1
+ name: build
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ lint:
18
+ runs-on: ubuntu-latest
19
+ timeout-minutes: 30
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23
+ - name: Setup uv
24
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
25
+ with:
26
+ enable-cache: true
27
+ - name: Setup Rust
28
+ uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
29
+ with:
30
+ toolchain: stable
31
+ components: rustfmt, clippy
32
+ - name: Cache Rust
33
+ uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
34
+ - name: Install dependencies
35
+ run: uv sync --locked --no-default-groups --group lint --no-install-project
36
+ - name: Ruff
37
+ run: |
38
+ uv run --no-sync ruff check python scripts tests
39
+ uv run --no-sync ruff format python scripts tests --check
40
+ - name: Ruff format of the Python in Markdown
41
+ run: git ls-files -z '*.md' | xargs -0 uv run --no-sync ruff format --check
42
+ - name: Mypy
43
+ run: uv run --no-sync mypy
44
+ - name: Rustfmt
45
+ run: cargo fmt --all --check
46
+ - name: Clippy
47
+ run: |
48
+ cargo clippy --workspace --all-targets --locked -- -D warnings
49
+ # The workspace turns on the feature build: the module builds the core without it
50
+ cargo clippy -p esmorph --no-default-features --locked -- -D warnings
51
+ - name: Rustdoc
52
+ run: cargo doc --no-deps --all-features -p esmorph -p esmorph-dict-es --locked
53
+ env:
54
+ RUSTDOCFLAGS: -D warnings
55
+
56
+ test:
57
+ name: test (${{ matrix.python-version }}${{ matrix.os != 'ubuntu-latest' && format(', {0}', matrix.os) || '' }})
58
+ runs-on: ${{ matrix.os }}
59
+ timeout-minutes: 30
60
+ strategy:
61
+ fail-fast: false
62
+ matrix:
63
+ os: [ubuntu-latest]
64
+ python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
65
+ include:
66
+ - os: ubuntu-latest
67
+ python-version: "3.14t"
68
+ - os: windows-latest
69
+ python-version: "3.12"
70
+ - os: macos-latest
71
+ python-version: "3.12"
72
+ steps:
73
+ - name: Checkout
74
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
75
+ - name: Setup uv
76
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
77
+ with:
78
+ enable-cache: true
79
+ python-version: ${{ matrix.python-version }}
80
+ - name: Setup Rust
81
+ uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
82
+ with:
83
+ toolchain: stable
84
+ - name: Cache Rust
85
+ uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
86
+ - name: Install dependencies
87
+ run: uv sync --locked --no-default-groups --group test
88
+ - name: Cache Wiktionary
89
+ # The snapshot of Wiktionary from Hugging Face is downloaded once per version of the script
90
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
91
+ with:
92
+ path: build/wiktionary/raw
93
+ key: wiktionary-${{ hashFiles('scripts/export_wiktionary.py') }}
94
+ # On Windows the hash of a script with CRLF differs: any earlier cache fits, the download checks SHA-256
95
+ restore-keys: wiktionary-
96
+ enableCrossOsArchive: true
97
+ - name: Cache treebanks
98
+ # The training parts of the treebanks from GitHub are downloaded once per version of the script
99
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
100
+ with:
101
+ path: build/ud/raw
102
+ key: ud-${{ hashFiles('scripts/export_ud.py') }}
103
+ # On Windows the hash of a script with CRLF differs: any earlier cache fits, the download checks SHA-256
104
+ restore-keys: ud-
105
+ enableCrossOsArchive: true
106
+ - name: Build dictionary
107
+ shell: bash
108
+ run: |
109
+ uv run --no-sync python scripts/export_wiktionary.py build/wiktionary
110
+ uv run --no-sync python scripts/export_ud.py build/ud
111
+ cargo run --release --locked -p esmorph-build -- build/wiktionary build/ud python/esmorph/data/es.dict
112
+ uv run --no-sync python -c "import hashlib; print(hashlib.sha256(open('python/esmorph/data/es.dict', 'rb').read()).hexdigest())"
113
+ - name: Check dictionary size
114
+ # The dictionary goes to crates.io in the archive of the crate esmorph-dict-es, whose limit is
115
+ # 10 MiB: a pull request changing only the scripts of the dictionary sees it here, not on a release tag
116
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
117
+ run: |
118
+ size="$(gzip -9 -c python/esmorph/data/es.dict | wc -c)"
119
+ echo "es.dict compressed: $size bytes"
120
+ [ "$size" -lt 10420224 ] || { echo "The compressed dictionary does not fit the crates.io limit of 10 MiB"; exit 1; }
121
+ - name: Run tests
122
+ run: uv run --no-sync pytest --cov esmorph
123
+ - name: Run Rust tests
124
+ run: cargo test -p esmorph -p esmorph-dict-es -p esmorph-build --all-features --locked
125
+
126
+ msrv:
127
+ runs-on: ubuntu-latest
128
+ timeout-minutes: 30
129
+ steps:
130
+ - name: Checkout
131
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
132
+ - name: Setup Rust
133
+ uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
134
+ with:
135
+ toolchain: "1.88"
136
+ - name: Cache Rust
137
+ uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
138
+ - name: Check
139
+ run: cargo check --workspace --all-targets --locked
140
+
141
+ docs:
142
+ runs-on: ubuntu-latest
143
+ timeout-minutes: 30
144
+ steps:
145
+ - name: Checkout
146
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
147
+ - name: Setup uv
148
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
149
+ with:
150
+ enable-cache: true
151
+ python-version: "3.13"
152
+ - name: Install dependencies
153
+ run: uv sync --locked --only-group docs
154
+ - name: Build docs
155
+ run: uv run --no-sync mkdocs build --strict
@@ -0,0 +1,37 @@
1
+ name: docs
2
+
3
+ # The site describes the released version: it is published on a release tag, not from master
4
+ on:
5
+ push:
6
+ tags:
7
+ - "[0-9]+.[0-9]+.[0-9]+"
8
+ workflow_dispatch:
9
+
10
+ concurrency:
11
+ group: docs
12
+ cancel-in-progress: false
13
+
14
+ jobs:
15
+ deploy:
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 30
18
+ permissions:
19
+ contents: write
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23
+ with:
24
+ fetch-depth: 0
25
+ - name: Setup uv
26
+ uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
27
+ with:
28
+ enable-cache: true
29
+ python-version: "3.13"
30
+ - name: Install dependencies
31
+ run: uv sync --locked --only-group docs
32
+ - name: Configure git
33
+ run: |
34
+ git config user.name "github-actions[bot]"
35
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
36
+ - name: Deploy
37
+ run: uv run --no-sync mkdocs gh-deploy --force --strict