simstring-rust 0.3.1__cp37-abi3-win_amd64.whl

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,5 @@
1
+ from .simstring_rust import *
2
+
3
+ __doc__ = simstring_rust.__doc__
4
+ if hasattr(simstring_rust, "__all__"):
5
+ __all__ = simstring_rust.__all__
Binary file
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.4
2
+ Name: simstring-rust
3
+ Version: 0.3.1
4
+ Classifier: Programming Language :: Rust
5
+ Classifier: Programming Language :: Python :: Implementation :: CPython
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Python :: 3.10
8
+ Classifier: Programming Language :: Python :: 3.11
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: POSIX
13
+ Classifier: Operating System :: MacOS :: MacOS X
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ License-File: LICENSE
16
+ Summary: A fast, native Rust implementation of the SimString algorithm with Python bindings.
17
+ Keywords: string-matching,nlp,simstring,fuzzy
18
+ Home-Page: https://github.com/PyDataBlog/simstring_rs
19
+ Author-email: Bernard Brenyah <bbrenyah@gmail.com>
20
+ License: MIT
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
23
+ Project-URL: Homepage, https://github.com/PyDataBlog/simstring_rs
24
+ Project-URL: Repository, https://github.com/PyDataBlog/simstring_rs
25
+
26
+ # simstring_rust
27
+
28
+ [![Build Status](https://github.com/PyDataBlog/simstring_rs/actions/workflows/CI.yml/badge.svg)](https://github.com/PyDataBlog/simstring_rs/actions)
29
+ [![Crates.io](https://img.shields.io/crates/v/simstring_rust.svg)](https://crates.io/crates/simstring_rust)
30
+ [![PyPI version](https://badge.fury.io/py/simstring-rust.svg)](https://badge.fury.io/py/simstring-rust)
31
+ [![Python versions](https://img.shields.io/pypi/pyversions/simstring-rust.svg)](https://pypi.org/project/simstring-rust)
32
+ [![Documentation](https://docs.rs/simstring_rust/badge.svg)](https://docs.rs/simstring_rust)
33
+ [![Rust](https://img.shields.io/badge/rust-1.63.0%2B-blue.svg?maxAge=3600)](https://github.com/PyDataBlog/simstring_rs)
34
+ [![Codecov](https://img.shields.io/codecov/c/github/PyDataBlog/simstring_rs?token=XJM8O8TD4U)](https://codecov.io/gh/PyDataBlog/simstring_rs)
35
+
36
+ A native Rust implementation of the CPMerge algorithm, designed for approximate string matching. This crate is particularly useful for natural language processing tasks that require the retrieval of strings/texts from very large corpora (big amounts of texts). Currently, this crate supports both character and word-based N-grams feature generation, with plans to allow custom user-defined feature generation methods.
37
+
38
+ ## Features
39
+
40
+ - ✅ Fast algorithm for string matching
41
+ - ✅ 100% exact retrieval
42
+ - ✅ Support for Unicode
43
+ - [ ] Support for building databases directly from text files
44
+ - [ ] Mecab-based tokenizer support
45
+
46
+ ## Supported String Similarity Measures
47
+
48
+ - ✅ Dice coefficient
49
+ - ✅ Jaccard coefficient
50
+ - ✅ Cosine coefficient
51
+ - ✅ Overlap coefficient
52
+ - ✅ Exact match
53
+
54
+ ## Installation
55
+
56
+ Add `simstring_rust` to your `Cargo.toml`:
57
+
58
+ ```toml
59
+ [dependencies]
60
+ simstring_rust = "0.3.0" # change version accordingly
61
+ ```
62
+
63
+ For the latest features, you can add the master branch by specifying the Git repository:
64
+
65
+ ```toml
66
+ [dependencies]
67
+ simstring_rust = { git = "https://github.com/PyDataBlog/simstring_rs.git", branch = "main" }
68
+ ```
69
+
70
+ Note: Using the master branch may include experimental features and potential breakages. Use with caution!
71
+
72
+ To revert to a stable version, ensure your Cargo.toml specifies a specific version number instead of the Git repository.
73
+
74
+ ## Usage
75
+
76
+ Here is a basic example of how to use simstring_rs in your Rust project:
77
+
78
+ ```Rust
79
+ use simstring_rust::database::HashDb;
80
+ use simstring_rust::extractors::CharacterNgrams;
81
+ use simstring_rust::measures::Cosine;
82
+ use simstring_rust::Searcher;
83
+
84
+ use std::sync::Arc;
85
+
86
+ fn main() {
87
+ // 1. Setup the database
88
+ let feature_extractor = Arc::new(CharacterNgrams::new(2, "$"));
89
+ let mut db = HashDb::new(feature_extractor);
90
+
91
+ // 2. Index some strings
92
+ db.insert("hello".to_string());
93
+ db.insert("help".to_string());
94
+ db.insert("halo".to_string());
95
+ db.insert("world".to_string());
96
+
97
+ // 3. Search for strings
98
+ let measure = Cosine;
99
+ let searcher = Searcher::new(&db, measure);
100
+ let query = "hell";
101
+ let alpha = 0.5;
102
+
103
+ if let Ok(results) = searcher.ranked_search(query, alpha) {
104
+ println!("Found {} results for query '{}'", results.len(), query);
105
+ for (item, score) in results {
106
+ println!("- Match: '{}', Score: {:.4}", item, score);
107
+ }
108
+ }
109
+ }
110
+ ```
111
+
112
+ <!-- ## Releasing -->
113
+ <!---->
114
+ <!-- This project uses [`cargo-release`](https://github.com/crate-ci/cargo-release) and [`git-cliff`](https://github.com/orhun/git-cliff) to automate the release process. -->
115
+ <!---->
116
+ <!-- ### Prerequisites -->
117
+ <!---->
118
+ <!-- Before creating a release, ensure you have installed the necessary tools: -->
119
+ <!---->
120
+ <!-- ```bash -->
121
+ <!-- cargo install cargo-release -->
122
+ <!-- cargo install git-cliff -->
123
+ <!-- ``` -->
124
+ <!---->
125
+ <!-- ### Creating a Release -->
126
+ <!---->
127
+ <!-- 1. Ensure your local `main` branch is up-to-date: -->
128
+ <!-- ```bash -->
129
+ <!-- git checkout main -->
130
+ <!-- git pull origin main -->
131
+ <!-- ``` -->
132
+ <!-- 2. Run `cargo release` with the desired release level (`patch`, `minor`, or `major`). The command runs in dry-run mode by default, so you can review the changes. -->
133
+ <!-- ```bash -->
134
+ <!-- cargo release <LEVEL> -->
135
+ <!-- ``` -->
136
+ <!-- 3. Once you have verified the plan, execute the release: -->
137
+ <!-- ```bash -->
138
+ <!-- cargo release <LEVEL> --execute -->
139
+ <!-- ``` -->
140
+ <!---->
141
+ <!-- This will automatically: -->
142
+ <!-- - Generate and update the `CHANGELOG.md`. -->
143
+ <!-- - Bump the version in `Cargo.toml`. -->
144
+ <!-- - Commit the changes and create a new Git tag. -->
145
+ <!-- - Push the commit and tag to GitHub, which triggers the CI/CD pipeline to publish the crate to `crates.io`. -->
146
+
147
+ ## Contributing
148
+
149
+ Contributions are welcome! Please open an issue or submit a pull request on GitHub.
150
+ License
151
+
152
+ This project is licensed under the MIT License.
153
+
154
+ ## Acknowledgements
155
+
156
+ Inspired by the [SimString](https://www.chokkan.org/software/simstring/) project.
157
+
@@ -0,0 +1,6 @@
1
+ simstring_rust-0.3.1.dist-info/METADATA,sha256=zw9jvhMadHiv3ZBrR7ii2DF4iHuE1Vz1cKv2_VAoDmg,6120
2
+ simstring_rust-0.3.1.dist-info/WHEEL,sha256=iDl9G7pX_GSVCfxrG9Zl_jyzUf_sfes26PpBiaYgsMs,94
3
+ simstring_rust-0.3.1.dist-info/licenses/LICENSE,sha256=1h9YYTCkdwcFEQugoPDFIvMfTply9WBS7b0q7BO6wq8,1093
4
+ simstring_rust/__init__.py,sha256=848LALFhj3KZD2jqtwOA_Zd5LkhRP-6Bdp6pagM93I0,139
5
+ simstring_rust/simstring_rust.pyd,sha256=3SXnSI3qB4GcBfbPuG9HZikIBbU3hpHwg3KfJJcqAuc,601088
6
+ simstring_rust-0.3.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.9.6)
3
+ Root-Is-Purelib: false
4
+ Tag: cp37-abi3-win_amd64
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Bernard Brenyah
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.