Skip to content

Commit

Permalink
Merge pull request #36 from Dalvany/chore/bump_dependencies
Browse files Browse the repository at this point in the history
chore: bump dependencies
  • Loading branch information
Dalvany authored Oct 15, 2024
2 parents 40007e2 + 6faf00f commit 0eec7ef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
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 @@ impl TryFrom<&PhoneticAlgorithm> for EncoderAlgorithm {
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 @@ impl TryFrom<&PhoneticAlgorithm> for EncoderAlgorithm {
}
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,
)))),
},
PhoneticAlgorithm::Nysiis(strict) => match strict.0 {
None => Ok(EncoderAlgorithm::Nysiis(Nysiis::default())),
Expand Down

0 comments on commit 0eec7ef

Please sign in to comment.