adhara 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.
@@ -0,0 +1,86 @@
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-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: dtolnay/rust-toolchain@stable
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: '3.12'
22
+ - run: cargo test --release
23
+ - run: pip install -e '.[dev]'
24
+ - run: pytest -q
25
+
26
+ swift:
27
+ runs-on: macos-15
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: dtolnay/rust-toolchain@stable
31
+ - run: scripts/xcframework.sh
32
+ - run: swift test
33
+
34
+ build:
35
+ needs: test
36
+ strategy:
37
+ fail-fast: false
38
+ matrix:
39
+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-14, macos-15-intel]
40
+ runs-on: ${{ matrix.os }}
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ - uses: PyO3/maturin-action@v1
44
+ with:
45
+ args: --profile dist --out dist
46
+ manylinux: 2_28 # usearch's numkong needs a newer gcc than manylinux2014 has
47
+ - uses: actions/upload-artifact@v4
48
+ with:
49
+ name: wheels-${{ matrix.os }}
50
+ path: dist
51
+
52
+ sdist:
53
+ runs-on: ubuntu-latest
54
+ steps:
55
+ - uses: actions/checkout@v4
56
+ - uses: PyO3/maturin-action@v1
57
+ with:
58
+ command: sdist
59
+ args: -o dist
60
+ - uses: actions/upload-artifact@v4
61
+ with:
62
+ name: wheels-sdist
63
+ path: dist
64
+
65
+ publish:
66
+ if: startsWith(github.ref, 'refs/tags/v')
67
+ needs: [build, sdist, swift]
68
+ runs-on: ubuntu-latest
69
+ permissions:
70
+ contents: write
71
+ steps:
72
+ - uses: actions/download-artifact@v4
73
+ with:
74
+ pattern: wheels-*
75
+ path: dist
76
+ merge-multiple: true
77
+ - uses: softprops/action-gh-release@v2
78
+ with:
79
+ files: dist/*
80
+ generate_release_notes: true
81
+ - uses: PyO3/maturin-action@v1
82
+ env:
83
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
84
+ with:
85
+ command: upload
86
+ args: --non-interactive --skip-existing dist/*
@@ -0,0 +1,11 @@
1
+ target/
2
+ *.so
3
+ *.dylib
4
+ __pycache__/
5
+ .venv/
6
+ *.sqlite*
7
+ *.usearch*
8
+ .pytest_cache/
9
+ swift/.build/
10
+ swift/AdharaCore.xcframework/
11
+ .build/
adhara-0.1.0/CLAUDE.md ADDED
@@ -0,0 +1,31 @@
1
+ # Working in this repo
2
+
3
+ The Rust code in `src/` is the source. The Python package (`python/adhara`) and the Swift package (`swift/`, `Package.swift`) are thin layers over it. `scripts/gen_tables.py` writes `src/tables.rs`. Never edit `src/tables.rs` by hand.
4
+
5
+ ## The one rule
6
+
7
+ adhara gives the results of litesearch. A faster method that changes a result is a bug. The tests in `tests/` compare adhara with litesearch directly.
8
+
9
+ - The folds equal `litesearch/sanskrit.py` on every word of the test corpus.
10
+ - The tokens equal the litesearch chain. One apsw quirk is the exception. `RESULTS.md` describes it.
11
+ - `adhara_hybrid` returns the rows of litesearch `search` in the same order. `ann` selects the HNSW search or the exact search, as `ann` does in litesearch.
12
+
13
+ ## Three parts
14
+
15
+ - `fold.rs` is the port of `sanskrit.py`. It does not use SQLite.
16
+ - `tok.rs` is the FTS5 tokenizer `adhara`. Porter goes outside it (`porter adhara`), as litesearch puts porter outside its chain.
17
+ - `hybrid.rs` is the table function `adhara_hybrid`. It reads the litesearch schema: `<store>`, `<store>_fts` and `usearch_indices`.
18
+
19
+ ## Builds
20
+
21
+ - `--features python` builds the Python module. The same file is the SQLite extension (`sqlite3_adhara_init`).
22
+ - `--features static` builds SQLite into the library, for Swift (`adhara_register`). This build also registers `simplify` for the litesearch chain. The extension does not, because apsw registers its own `simplify` on a Python connection.
23
+ - A change in tokens needs a new tokenizer name. Do not change the behaviour of an existing name. FTS5 tokenizes old content again on delete, so a changed token corrupts an index.
24
+
25
+ ## Numbers
26
+
27
+ Each speed claim has a row in `RESULTS.md` and a script in `bench/`. Change the number before you change the claim.
28
+
29
+ ## Licence
30
+
31
+ MIT.