litscan-2 0.0.1__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.
- litscan_2-0.0.1/.github/workflows/CI.yml +103 -0
- litscan_2-0.0.1/.gitignore +77 -0
- litscan_2-0.0.1/Cargo.lock +1591 -0
- litscan_2-0.0.1/Cargo.toml +29 -0
- litscan_2-0.0.1/PKG-INFO +9 -0
- litscan_2-0.0.1/build.rs +18 -0
- litscan_2-0.0.1/docs/classifier.md +176 -0
- litscan_2-0.0.1/docs/how-it-works.md +172 -0
- litscan_2-0.0.1/docs/index.md +63 -0
- litscan_2-0.0.1/docs/open-questions.md +19 -0
- litscan_2-0.0.1/docs/outputs.md +101 -0
- litscan_2-0.0.1/docs/usage.md +143 -0
- litscan_2-0.0.1/litscan_2/__init__.py +22 -0
- litscan_2-0.0.1/litscan_2/paragraphs.py +81 -0
- litscan_2-0.0.1/litscan_2/scan.py +69 -0
- litscan_2-0.0.1/mkdocs.yml +51 -0
- litscan_2-0.0.1/pyproject.toml +21 -0
- litscan_2-0.0.1/src/classifier.rs +264 -0
- litscan_2-0.0.1/src/jats.rs +1085 -0
- litscan_2-0.0.1/src/lib.rs +510 -0
- litscan_2-0.0.1/src/paragraphs.rs +163 -0
- litscan_2-0.0.1/src/scanner.rs +688 -0
- litscan_2-0.0.1/tests/automaton_building.rs +49 -0
- litscan_2-0.0.1/tests/common/mod.rs +46 -0
- litscan_2-0.0.1/tests/end_to_end_parity.rs +42 -0
- litscan_2-0.0.1/tests/fixtures/mini_shard.xml +56 -0
- litscan_2-0.0.1/tests/fixtures/model.safetensors +0 -0
- litscan_2-0.0.1/tests/fixtures/model_metadata.json +33971 -0
- litscan_2-0.0.1/tests/fixtures/sample_terms.tsv +11101 -0
- litscan_2-0.0.1/tests/fixtures/test_fixtures.json +44391 -0
- litscan_2-0.0.1/tests/manifest.rs +125 -0
- litscan_2-0.0.1/tests/tokenizer_parity.rs +23 -0
- litscan_2-0.0.1/tests/vectorizer_parity.rs +24 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ['v*']
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
runs-on: ubuntu-24.04
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
19
|
+
- uses: Swatinem/rust-cache@v2
|
|
20
|
+
- run: cargo test
|
|
21
|
+
|
|
22
|
+
wheels:
|
|
23
|
+
runs-on: ${{ matrix.runner }}
|
|
24
|
+
strategy:
|
|
25
|
+
matrix:
|
|
26
|
+
include:
|
|
27
|
+
- { runner: ubuntu-24.04, target: x86_64 }
|
|
28
|
+
- { runner: ubuntu-24.04, target: aarch64 }
|
|
29
|
+
- { runner: macos-15, target: aarch64 }
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
- name: Build wheel
|
|
33
|
+
uses: PyO3/maturin-action@v1
|
|
34
|
+
env:
|
|
35
|
+
LITSCAN_GIT_SHA: ${{ github.sha }}
|
|
36
|
+
with:
|
|
37
|
+
target: ${{ matrix.target }}
|
|
38
|
+
args: --release --out dist
|
|
39
|
+
manylinux: auto
|
|
40
|
+
docker-options: -e LITSCAN_GIT_SHA
|
|
41
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
42
|
+
- uses: actions/upload-artifact@v4
|
|
43
|
+
with:
|
|
44
|
+
name: wheels-${{ matrix.runner }}-${{ matrix.target }}
|
|
45
|
+
path: dist
|
|
46
|
+
|
|
47
|
+
sdist:
|
|
48
|
+
runs-on: ubuntu-24.04
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v4
|
|
51
|
+
- uses: PyO3/maturin-action@v1
|
|
52
|
+
with:
|
|
53
|
+
command: sdist
|
|
54
|
+
args: --out dist
|
|
55
|
+
- uses: actions/upload-artifact@v4
|
|
56
|
+
with:
|
|
57
|
+
name: wheels-sdist
|
|
58
|
+
path: dist
|
|
59
|
+
|
|
60
|
+
docs:
|
|
61
|
+
runs-on: ubuntu-24.04
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v4
|
|
64
|
+
- uses: actions/setup-python@v5
|
|
65
|
+
with:
|
|
66
|
+
python-version: '3.12'
|
|
67
|
+
- run: pip install mkdocs-material==9.8.0
|
|
68
|
+
- run: mkdocs build --strict
|
|
69
|
+
- uses: actions/upload-pages-artifact@v3
|
|
70
|
+
with:
|
|
71
|
+
path: site
|
|
72
|
+
|
|
73
|
+
deploy-docs:
|
|
74
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
75
|
+
needs: docs
|
|
76
|
+
runs-on: ubuntu-24.04
|
|
77
|
+
environment:
|
|
78
|
+
name: github-pages
|
|
79
|
+
url: ${{ steps.deploy.outputs.page_url }}
|
|
80
|
+
permissions:
|
|
81
|
+
pages: write
|
|
82
|
+
id-token: write
|
|
83
|
+
steps:
|
|
84
|
+
- id: deploy
|
|
85
|
+
uses: actions/deploy-pages@v4
|
|
86
|
+
|
|
87
|
+
publish:
|
|
88
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
89
|
+
needs: [test, wheels, sdist]
|
|
90
|
+
runs-on: ubuntu-24.04
|
|
91
|
+
environment: pypi
|
|
92
|
+
permissions:
|
|
93
|
+
id-token: write # PyPI trusted publishing, no token secret
|
|
94
|
+
steps:
|
|
95
|
+
- uses: actions/checkout@v4
|
|
96
|
+
- name: Tag matches Cargo.toml version
|
|
97
|
+
run: test "${GITHUB_REF_NAME#v}" = "$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)"
|
|
98
|
+
- uses: actions/download-artifact@v4
|
|
99
|
+
with:
|
|
100
|
+
pattern: wheels-*
|
|
101
|
+
path: dist
|
|
102
|
+
merge-multiple: true
|
|
103
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/target
|
|
2
|
+
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
.venv/
|
|
14
|
+
env/
|
|
15
|
+
bin/
|
|
16
|
+
build/
|
|
17
|
+
develop-eggs/
|
|
18
|
+
dist/
|
|
19
|
+
eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
include/
|
|
26
|
+
man/
|
|
27
|
+
venv/
|
|
28
|
+
*.egg-info/
|
|
29
|
+
.installed.cfg
|
|
30
|
+
*.egg
|
|
31
|
+
|
|
32
|
+
# Installer logs
|
|
33
|
+
pip-log.txt
|
|
34
|
+
pip-delete-this-directory.txt
|
|
35
|
+
pip-selfcheck.json
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.coverage
|
|
41
|
+
.cache
|
|
42
|
+
nosetests.xml
|
|
43
|
+
coverage.xml
|
|
44
|
+
|
|
45
|
+
# Translations
|
|
46
|
+
*.mo
|
|
47
|
+
|
|
48
|
+
# Mr Developer
|
|
49
|
+
.mr.developer.cfg
|
|
50
|
+
.project
|
|
51
|
+
.pydevproject
|
|
52
|
+
|
|
53
|
+
# Rope
|
|
54
|
+
.ropeproject
|
|
55
|
+
|
|
56
|
+
# Django stuff:
|
|
57
|
+
*.log
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
.DS_Store
|
|
61
|
+
|
|
62
|
+
# Sphinx documentation
|
|
63
|
+
docs/_build/
|
|
64
|
+
|
|
65
|
+
# PyCharm
|
|
66
|
+
.idea/
|
|
67
|
+
|
|
68
|
+
# VSCode
|
|
69
|
+
.vscode/
|
|
70
|
+
|
|
71
|
+
# Pyenv
|
|
72
|
+
.python-version
|
|
73
|
+
|
|
74
|
+
# mkdocs build output
|
|
75
|
+
/site
|
|
76
|
+
|
|
77
|
+
.serena/
|