error-align 0.1.0b2__tar.gz → 0.1.0b5__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 (68) hide show
  1. error_align-0.1.0b5/.coveragerc +6 -0
  2. error_align-0.1.0b5/.github/CODEOWNERS +1 -0
  3. error_align-0.1.0b5/.github/assets/aau.png +0 -0
  4. error_align-0.1.0b5/.github/assets/corti.png +0 -0
  5. error_align-0.1.0b5/.github/assets/dtu.png +0 -0
  6. error_align-0.1.0b5/.github/assets/empty.png +0 -0
  7. error_align-0.1.0b5/.github/assets/logo.svg +34 -0
  8. error_align-0.1.0b5/.github/assets/pcai.png +0 -0
  9. error_align-0.1.0b5/.github/assets/ucph.png +0 -0
  10. error_align-0.1.0b5/.github/pull_request_template.md +14 -0
  11. error_align-0.1.0b5/.github/release_drafter_main_branch.yml +34 -0
  12. error_align-0.1.0b5/.github/workflows/build_and_publish.yml +88 -0
  13. error_align-0.1.0b5/.github/workflows/build_wheels.yml +52 -0
  14. error_align-0.1.0b5/.github/workflows/label_check.yml +29 -0
  15. error_align-0.1.0b5/.github/workflows/lint.yml +21 -0
  16. error_align-0.1.0b5/.github/workflows/release_draft_main_branch.yml +22 -0
  17. error_align-0.1.0b5/.github/workflows/tests_and_coverage.yml +41 -0
  18. error_align-0.1.0b5/.gitignore +154 -0
  19. error_align-0.1.0b5/.pre-commit-config.yaml +32 -0
  20. error_align-0.1.0b5/.python-version +1 -0
  21. error_align-0.1.0b5/CMakeLists.txt +20 -0
  22. error_align-0.1.0b5/Makefile +21 -0
  23. {error_align-0.1.0b2 → error_align-0.1.0b5}/PKG-INFO +38 -47
  24. {error_align-0.1.0b2 → error_align-0.1.0b5}/README.md +8 -15
  25. error_align-0.1.0b5/codecov.yml +11 -0
  26. error_align-0.1.0b5/cpp/beam_search.cpp +493 -0
  27. error_align-0.1.0b5/cpp/edit_distance.cpp +242 -0
  28. error_align-0.1.0b5/evaluation/evaluate_dataset.py +349 -0
  29. error_align-0.1.0b5/evaluation/monolingual_eval.sh +14 -0
  30. error_align-0.1.0b5/evaluation/multilingual_eval.sh +9 -0
  31. error_align-0.1.0b5/evaluation/prepare_primock57.py +117 -0
  32. error_align-0.1.0b5/evaluation/transcribe_dataset.py +277 -0
  33. error_align-0.1.0b5/poetry.lock +11577 -0
  34. error_align-0.1.0b5/pyproject.toml +92 -0
  35. error_align-0.1.0b5/pytest.ini +2 -0
  36. error_align-0.1.0b5/ruff.toml +31 -0
  37. error_align-0.1.0b5/src/error_align/__init__.py +6 -0
  38. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/backtrace_graph.py +50 -84
  39. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/optimal_word_alignment.py +1 -0
  40. error_align-0.1.0b5/src/error_align/baselines/power/cmudict.rep.json +1 -0
  41. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/normalize/__init__.py +1 -1
  42. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/power/levenshtein.py +3 -3
  43. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power_alignment.py +29 -11
  44. error_align-0.1.0b5/src/error_align/beam_search.py +337 -0
  45. error_align-0.1.0b5/src/error_align/core.py +26 -0
  46. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/edit_distance.py +1 -1
  47. error_align-0.1.0b5/src/error_align/error_align.py +224 -0
  48. error_align-0.1.0b5/src/error_align/graph_metadata.py +124 -0
  49. error_align-0.1.0b5/src/error_align/path_to_alignment.py +112 -0
  50. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/utils.py +57 -11
  51. error_align-0.1.0b5/tests/test_default.py +217 -0
  52. error_align-0.1.0b2/pyproject.toml +0 -97
  53. error_align-0.1.0b2/src/error_align/__init__.py +0 -7
  54. error_align-0.1.0b2/src/error_align/error_align.py +0 -495
  55. error_align-0.1.0b2/src/error_align/func.py +0 -38
  56. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/__init__.py +0 -0
  57. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/normalize/contractions.py +0 -0
  58. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/normalize/normalize.py +0 -0
  59. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/normalize/numbers.py +0 -0
  60. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/power/__init__.py +0 -0
  61. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/power/aligner.py +0 -0
  62. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/power/phonemes.py +0 -0
  63. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/power/pronounce.py +0 -0
  64. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/power/punct.py +0 -0
  65. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/power/readers.py +0 -0
  66. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/power/power/writers.py +0 -0
  67. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/rapidfuzz_word_alignment.py +0 -0
  68. {error_align-0.1.0b2 → error_align-0.1.0b5}/src/error_align/baselines/utils.py +0 -0
@@ -0,0 +1,6 @@
1
+ [run]
2
+ branch = True
3
+ source = error_align
4
+
5
+ [report]
6
+ omit = src/error_align/baselines/*
@@ -0,0 +1 @@
1
+ * @borgholt
@@ -0,0 +1,34 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1200" height="210"
2
+ viewBox="0 0 1200 210" role="img" aria-label="ErrorAlign logo">
3
+
4
+ <!-- outer white border -->
5
+ <!-- <rect x="207" y="50" width="860" height="200" fill="white" stroke="white" stroke-width="10" transform="skewX(-12)"/> -->
6
+
7
+ <!-- "Error" -->
8
+ <text x="51.5%" y="130"
9
+ text-anchor="end"
10
+ dominant-baseline="middle"
11
+ font-family="Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif"
12
+ font-weight="900"
13
+ font-style="italic"
14
+ font-size="130"
15
+ stroke="#2b2b2bff"
16
+ stroke-width="6"
17
+ fill="#8e0000b4">
18
+ ERROR
19
+ </text>
20
+
21
+ <!-- "Align" -->
22
+ <text x="52.5%" y="130"
23
+ text-anchor="start"
24
+ dominant-baseline="middle"
25
+ font-family="Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif"
26
+ font-weight="900"
27
+ font-style="italic"
28
+ font-size="130"
29
+ stroke="#2b2b2bff"
30
+ stroke-width="6"
31
+ fill="#297301b4">
32
+ ALIGN
33
+ </text>
34
+ </svg>
@@ -0,0 +1,14 @@
1
+ ## Description
2
+
3
+ <!--
4
+ Do not leave this blank.
5
+ This PR [adds/removes/fixes/replaces] the [feature/bug/etc] because [reason] by doing [x].
6
+ -->
7
+
8
+ <!--
9
+ Before submitting a Pull Request, please ensure you've done the following:
10
+ - 👷‍♀️ Create small PRs. In most cases, this will be possible.
11
+ - 📝 Use descriptive commit messages.
12
+ - ✅ Provide tests for your changes (if required).
13
+ - 📗 Update any related documentation (if required).
14
+ -->
@@ -0,0 +1,34 @@
1
+ name-template: 'v$RESOLVED_VERSION'
2
+ tag-template: 'v$RESOLVED_VERSION'
3
+ categories:
4
+ - title: '🔴 Major changes'
5
+ label: 'major'
6
+ exclude-label: 'dependabot'
7
+ - title: '🟠 Minor changes'
8
+ label: 'minor'
9
+ exclude-label: 'dependabot'
10
+ - title: '🟡 Patch changes'
11
+ label: 'patch'
12
+ exclude-label: 'dependabot'
13
+ - title: '📦 Dependencies'
14
+ collapse-after: 1
15
+ label: dependabot
16
+ change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
17
+ change-title-escapes: '\<*_&'
18
+ version-resolver:
19
+ major:
20
+ labels:
21
+ - 'major'
22
+ minor:
23
+ labels:
24
+ - 'minor'
25
+ patch:
26
+ labels:
27
+ - 'patch'
28
+ default: patch
29
+ filter-by-commitish: true
30
+ template: |
31
+ ## What's Changed
32
+ $CHANGES
33
+
34
+ **Full change log**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
@@ -0,0 +1,88 @@
1
+ name: Build and Publish
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ tags:
7
+ - "v*"
8
+
9
+ jobs:
10
+ build_wheels:
11
+ name: Build wheels on ${{ matrix.os }}
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ matrix:
15
+ os: [ubuntu-latest, macos-latest, windows-latest]
16
+
17
+ env:
18
+ # ---- Linux ----
19
+ # Build manylinux + musllinux wheels
20
+ CIBW_ARCHS_LINUX: "x86_64"
21
+ CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
22
+ CIBW_MUSLLINUX_X86_64_IMAGE: "musllinux_1_2"
23
+
24
+ # ---- macOS ----
25
+ # Build Intel, Apple Silicon, and universal2 wheels
26
+ CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
27
+
28
+ # ---- Windows ----
29
+ # Build both 32-bit and 64-bit wheels
30
+ CIBW_ARCHS_WINDOWS: "AMD64 x86"
31
+
32
+ # ---- General settings ----
33
+ # Build wheels for CPython 3.11–3.13
34
+ CIBW_BUILD: "cp311-* cp312-* cp313-*"
35
+
36
+ # If needed, skip PyPy or unsupported combos
37
+ CIBW_SKIP: "pp* *-manylinux_i686"
38
+
39
+ # Output
40
+ CIBW_OUTPUT_DIR: "wheelhouse"
41
+
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+
45
+ - name: Install cibuildwheel
46
+ run: pip install cibuildwheel==2.22.0
47
+
48
+ - name: Build wheels
49
+ run: cibuildwheel
50
+
51
+ - name: Upload wheels as artifacts
52
+ uses: actions/upload-artifact@v4
53
+ with:
54
+ name: wheels-${{ matrix.os }}
55
+ path: wheelhouse/*.whl
56
+
57
+ build_sdist:
58
+ name: Build sdist
59
+ runs-on: ubuntu-latest
60
+ steps:
61
+ - uses: actions/checkout@v4
62
+
63
+ - name: Build sdist
64
+ run: |
65
+ pip install build
66
+ python -m build --sdist
67
+
68
+ - uses: actions/upload-artifact@v4
69
+ with:
70
+ name: sdist
71
+ path: dist/*.tar.gz
72
+
73
+ publish:
74
+ name: Publish to PyPI
75
+ needs: [build_wheels, build_sdist]
76
+ runs-on: ubuntu-latest
77
+ steps:
78
+ - uses: actions/download-artifact@v4
79
+
80
+ - name: Install Twine
81
+ run: pip install twine
82
+
83
+ - name: Publish to PyPI
84
+ run: |
85
+ twine upload wheels-*/* sdist/*
86
+ env:
87
+ TWINE_USERNAME: "__token__"
88
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,52 @@
1
+ name: Build wheels
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ build_wheels:
8
+ name: Build wheels on ${{ matrix.os }}
9
+ runs-on: ${{ matrix.os }}
10
+ strategy:
11
+ matrix:
12
+ os: [ubuntu-latest, macos-latest, windows-latest]
13
+
14
+ env:
15
+ # ---- Linux ----
16
+ # Build manylinux + musllinux wheels
17
+ CIBW_ARCHS_LINUX: "x86_64"
18
+ CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
19
+ CIBW_MUSLLINUX_X86_64_IMAGE: "musllinux_1_2"
20
+
21
+ # ---- macOS ----
22
+ # Build Intel, Apple Silicon, and universal2 wheels
23
+ CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
24
+
25
+ # ---- Windows ----
26
+ # Build both 32-bit and 64-bit wheels
27
+ CIBW_ARCHS_WINDOWS: "AMD64 x86"
28
+
29
+ # ---- General settings ----
30
+ # Build wheels for CPython 3.11–3.13
31
+ CIBW_BUILD: "cp311-* cp312-* cp313-*"
32
+
33
+ # If needed, skip PyPy or unsupported combos
34
+ CIBW_SKIP: "pp* *-manylinux_i686"
35
+
36
+ # Output
37
+ CIBW_OUTPUT_DIR: "wheelhouse"
38
+
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+
42
+ - name: Install cibuildwheel
43
+ run: pip install cibuildwheel==2.22.0
44
+
45
+ - name: Build wheels
46
+ run: cibuildwheel
47
+
48
+ - name: Upload wheels as artifacts
49
+ uses: actions/upload-artifact@v4
50
+ with:
51
+ name: wheels-${{ matrix.os }}
52
+ path: wheelhouse/*.whl
@@ -0,0 +1,29 @@
1
+ name: Label Check
2
+
3
+ permissions:
4
+ pull-requests: read
5
+
6
+ concurrency:
7
+ # Overwrite previous label check action if new triggered (one run per PR, cancel on new run)
8
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9
+ cancel-in-progress: true
10
+
11
+ on:
12
+ pull_request:
13
+ types:
14
+ - opened
15
+ - synchronize
16
+ - reopened
17
+ - labeled
18
+ - unlabeled
19
+
20
+ jobs:
21
+ check_version_labels:
22
+ name: Ensure version label
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: docker://agilepathway/pull-request-label-checker:latest
26
+ with:
27
+ github_enterprise_graphql_url: https://api.github.com/graphql
28
+ one_of: major,minor,patch
29
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,21 @@
1
+ name: Ruff
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout repo
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Run Ruff
17
+ uses: astral-sh/ruff-action@v3
18
+ with:
19
+ version: latest
20
+ args: "check"
21
+ src: "."
@@ -0,0 +1,22 @@
1
+ name: Release Drafter (main branch)
2
+
3
+ permissions:
4
+ pull-requests: read
5
+ contents: write
6
+
7
+ on:
8
+ push:
9
+ branches:
10
+ - main
11
+ workflow_dispatch: # Option for manual trigger
12
+
13
+ jobs:
14
+ update_release_draft:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: release-drafter/release-drafter@v6
18
+ with:
19
+ config-name: release_drafter_main_branch.yml
20
+ disable-autolabeler: true
21
+ env:
22
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,41 @@
1
+ name: Tests and Coverage
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ python-version: [3.11, 3.12, 3.13]
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v4
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+
25
+ - name: Install test dependencies with Poetry
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ pip install poetry
29
+ poetry install --with test,dev
30
+ poetry run pip install .
31
+
32
+ - name: Run tests with coverage
33
+ run: poetry run pytest --cov=error_align --cov-report=xml
34
+
35
+ - name: Upload coverage to Codecov
36
+ if: matrix.python-version == '3.12'
37
+ uses: codecov/codecov-action@v5
38
+ with:
39
+ files: ./coverage.xml
40
+ token: ${{ secrets.CODECOV_TOKEN }}
41
+ verbose: true
@@ -0,0 +1,154 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ test-output.xml
50
+ test-results.xml
51
+ *.cover
52
+ *.py,cover
53
+ .hypothesis/
54
+ .pytest_cache/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+
76
+ # PyBuilder
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pipenv
87
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
88
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
89
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
90
+ # install all needed dependencies.
91
+ #Pipfile.lock
92
+
93
+ # celery beat schedule file
94
+ celerybeat-schedule
95
+
96
+ # SageMath parsed files
97
+ *.sage.py
98
+
99
+ # Environments
100
+ .env
101
+ .venv
102
+ env/
103
+ venv/
104
+ ENV/
105
+ env.bak/
106
+ venv.bak/
107
+
108
+ # Spyder project settings
109
+ .spyderproject
110
+ .spyproject
111
+
112
+ # Rope project settings
113
+ .ropeproject
114
+
115
+ # mkdocs documentation
116
+ /site
117
+
118
+ # mypy
119
+ .mypy_cache/
120
+ .dmypy.json
121
+ dmypy.json
122
+
123
+ # Pyre type checker
124
+ .pyre/
125
+
126
+ # Local GitHub Actions tool (ACT)
127
+ .actrc
128
+
129
+ # coverage
130
+ cov.xml
131
+
132
+ # Editor config files
133
+ .vscode
134
+
135
+ # DeepCode/Snyk
136
+ .dccache
137
+
138
+ # Tox stuff
139
+ tests/reports
140
+
141
+ # Makefile installation stamp
142
+ .install.stamp
143
+
144
+ # Ruff
145
+ .ruff_cache
146
+
147
+ # MacOS
148
+ .DS_Store
149
+
150
+ # Data files generated for evaluation
151
+ evaluation/transcribed_data/
152
+ evaluation/primock57/
153
+ evaluation/results/
154
+ evaluation/visualize/
@@ -0,0 +1,32 @@
1
+ fail_fast: False
2
+ repos:
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks
4
+ rev: v6.0.0
5
+ hooks:
6
+ - id: check-added-large-files # Check for large files.
7
+ exclude: ^src/error_align/baselines/power/cmudict.rep.json$
8
+ - id: check-ast # Check Python file syntax using the ast module.
9
+ - id: check-json # Check JSON file syntax.
10
+ - id: check-merge-conflict # Check for merge conflict strings.
11
+ - id: check-toml # Check TOML file syntax.
12
+ - id: check-xml # Check XML file syntax.
13
+ - id: check-yaml # Check YAML file syntax.
14
+ - id: detect-private-key # Check for private keys.
15
+ - id: end-of-file-fixer # Ensure files end with a newline.
16
+ - id: trailing-whitespace # Check for trailing whitespace.
17
+ - repo: https://github.com/astral-sh/ruff-pre-commit
18
+ rev: v0.13.2
19
+ hooks:
20
+ - id: ruff-format
21
+ - id: ruff-check
22
+ args: ["--fix"]
23
+ - repo: https://github.com/asottile/yesqa
24
+ rev: v1.5.0
25
+ hooks:
26
+ - id: yesqa # Check if there are any unnecessary 'noqa' comments in the code.
27
+ - repo: https://github.com/python-poetry/poetry
28
+ rev: 2.2.1
29
+ hooks:
30
+ - id: poetry-check # Validate the pyproject.toml file.
31
+ - id: poetry-lock # Lock dependencies on changes to the pyproject.toml.
32
+ - id: poetry-install # Install dependencies from the lock file on checkout and merge.
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,20 @@
1
+ cmake_minimum_required(VERSION 3.18)
2
+ project(error_align LANGUAGES CXX)
3
+
4
+ set(CMAKE_CXX_STANDARD 17)
5
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
6
+
7
+ find_package(pybind11 CONFIG REQUIRED)
8
+
9
+ # Build the module
10
+ pybind11_add_module(_cpp_edit_distance cpp/edit_distance.cpp)
11
+ pybind11_add_module(_cpp_beam_search cpp/beam_search.cpp)
12
+
13
+ # Install it under the Python package directory (src/error_align)
14
+ install(
15
+ TARGETS
16
+ _cpp_edit_distance
17
+ _cpp_beam_search
18
+ LIBRARY DESTINATION error_align
19
+ RUNTIME DESTINATION error_align
20
+ )
@@ -0,0 +1,21 @@
1
+ # Inspired by: https://blog.mathieu-leplatre.info/tips-for-your-makefile-with-python.html
2
+ # https://www.thapaliya.com/en/writings/well-documented-makefiles/
3
+
4
+ .DEFAULT_GOAL := help
5
+
6
+ PRE_COMMIT_HOOKS_IN_PIPELINE = \
7
+ check-added-large-files check-ast check-json check-merge-conflict check-toml check-xml check-yaml \
8
+ detect-private-key end-of-file-fixer trailing-whitespace ruff ruff-format yesqa poetry-check update-readme-title
9
+
10
+ help: ## Display this help
11
+ @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
12
+
13
+ .PHONY: install
14
+ install: ## Install the package for development along with pre-commit hooks.
15
+ poetry install --with dev --with test
16
+ poetry run pre-commit install
17
+
18
+ .PHONY: clean
19
+ clean: ## Clean up the project directory removing __pycache__, .coverage, test results, etc.
20
+ find . -type d -name "__pycache__" | xargs rm -rf {};
21
+ rm -rf coverage.xml test-output.xml test-results.xml htmlcov .pytest_cache .ruff_cache