Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump dependencies #36

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rust_icu_utrans = { version = "5.0", optional = true }
rust_icu_common = { version = "5.0", optional = true }

# Phonetic
rphonetic = { version = "2.2", optional = true }
rphonetic = { version = "3.0", optional = true }

# Automaton
fst = { version = "0.4", optional = true }
Expand All @@ -60,14 +60,15 @@ thiserror = "1.0"

rustc-hash = "2.0"
derive_builder = { version = "0.20", optional = true }
either = { version = "1.10", optional = true }
either = { version = "1.13", optional = true }
document-features = "0.2"

[dev-dependencies]
lazy_static = "1.4"
tempdir = "0.3"
tempfile = "3.13"
tantivy = "0.22"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
lazy_static = "1.4"
6 changes: 3 additions & 3 deletions examples/beider_morse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tantivy::{doc, Index};
use tantivy_analysis_contrib::phonetic::{
Concat, MaxPhonemeNumber, PhoneticAlgorithm, PhoneticTokenFilter,
};
use tempdir::TempDir;
use tempfile::TempDir;

const ANALYSIS_NAME: &str = "test";
lazy_static! {
Expand All @@ -18,7 +18,7 @@ lazy_static! {

#[allow(clippy::disallowed_macros)]
fn main() -> Result<(), Box<dyn std::error::Error>> {
let index_path = TempDir::new("index")?;
let index_path = TempDir::new_in("target")?;
println!("Temp dir : {index_path:?}");

let options = TextOptions::default()
Expand Down Expand Up @@ -50,7 +50,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let index = Index::create_in_dir(&index_path, schema)?;
index.tokenizers().register(ANALYSIS_NAME, beider_morse);

let mut index_writer = index.writer(3_000_000)?;
let mut index_writer = index.writer(15_000_000)?;
let data = vec![
"Angelo",
"GOLDEN",
Expand Down
6 changes: 3 additions & 3 deletions examples/edge_ngram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use tantivy::{
doc, DocAddress, Index, ReloadPolicy, Score, Searcher, TantivyDocument, TantivyError,
};
use tantivy_analysis_contrib::commons::EdgeNgramTokenFilter;
use tempdir::TempDir;
use tempfile::TempDir;

const ANALYSIS_NAME: &str = "test";

Expand All @@ -34,7 +34,7 @@ fn get_values(

#[allow(clippy::disallowed_macros)]
fn main() -> Result<(), Box<dyn std::error::Error>> {
let index_path = TempDir::new("index")?;
let index_path = TempDir::new_in("target")?;
println!("Temp dir : {index_path:?}");

// Setup everything to index
Expand Down Expand Up @@ -63,7 +63,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
index.tokenizers().register(ANALYSIS_NAME, analysis);

// Index few documents.
let mut index_writer = index.writer(3_000_000)?;
let mut index_writer = index.writer(15_000_000)?;
let data = [
"The quick brown fox jumps over the lazy dog",
"Another test",
Expand Down
8 changes: 4 additions & 4 deletions src/phonetic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
use_alternate.0,
)),
Some(max_code_length) => Ok(EncoderAlgorithm::DoubleMetaphone(
DoubleMetaphone::new(max_code_length),
DoubleMetaphone::new(Some(max_code_length)),
use_alternate.0,
)),
}
Expand All @@ -242,9 +242,9 @@
}
PhoneticAlgorithm::Metaphone(max_code_length) => match max_code_length.0 {
None => Ok(EncoderAlgorithm::Metaphone(Metaphone::default())),
Some(max_code_length) => {
Ok(EncoderAlgorithm::Metaphone(Metaphone::new(max_code_length)))
}
Some(max_code_length) => Ok(EncoderAlgorithm::Metaphone(Metaphone::new(Some(
max_code_length,
)))),

Check warning on line 247 in src/phonetic/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/phonetic/mod.rs#L245-L247

Added lines #L245 - L247 were not covered by tests
},
PhoneticAlgorithm::Nysiis(strict) => match strict.0 {
None => Ok(EncoderAlgorithm::Nysiis(Nysiis::default())),
Expand Down