Skip to content

Commit

Permalink
drop temp. feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesturk committed Jul 28, 2024
1 parent 87127cd commit 0ac9dfb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name = "jellyfish"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.22.2", features = ["gil-refs"] }
pyo3 = { version = "0.22.2", features = [] }
unicode-segmentation = "^1.6.0"
unicode-normalization = "^0.1"
smallvec = "^1.13"
Expand Down
4 changes: 3 additions & 1 deletion src/rustyfish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ fn hamming_distance(a: &str, b: &str) -> PyResult<usize> {

// Calculates the Jaccard index between two strings.
#[pyfunction]
#[pyo3(signature=(a, b, ngram_size=None))]
fn jaccard_similarity(a: &str, b: &str, ngram_size: Option<usize>) -> PyResult<f64> {
Ok(_jaccard(a, b, ngram_size))
}
Expand All @@ -39,6 +40,7 @@ fn jaro_similarity(a: &str, b: &str) -> PyResult<f64> {

// Calculates the Jaro-Winkler similarity between two strings.
#[pyfunction]
#[pyo3(signature=(a, b, long_tolerance=None))]
fn jaro_winkler_similarity(a: &str, b: &str, long_tolerance: Option<bool>) -> PyResult<f64> {
match long_tolerance {
Some(true) => Ok(_jaro_winkler_long(a, b)),
Expand Down Expand Up @@ -88,7 +90,7 @@ fn metaphone(a: &str) -> PyResult<String> {

/// A Python module implemented in Rust.
#[pymodule]
pub fn _rustyfish(_py: Python, m: &PyModule) -> PyResult<()> {
pub fn _rustyfish(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(damerau_levenshtein_distance, m)?)?;
m.add_function(wrap_pyfunction!(hamming_distance, m)?)?;
m.add_function(wrap_pyfunction!(jaccard_similarity, m)?)?;
Expand Down

0 comments on commit 0ac9dfb

Please sign in to comment.