diff --git a/Cargo.toml b/Cargo.toml index dea205c..aa531d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ jieba-macros = { version = "0.8.0", path = "jieba-macros" } c_fixed_string = { version = "0.2" } cedarwood = { version = "0.4" } codspeed-criterion-compat = { version = "3.0.5" } -fxhash = { version = "0.2.1" } +rustc-hash = { version = "2.1" } include-flate = { version = "0.3.1" } ordered-float = { version = "5.0" } phf = { version = "0.13.1" } diff --git a/jieba/Cargo.toml b/jieba/Cargo.toml index ed64bcc..a8e6a38 100644 --- a/jieba/Cargo.toml +++ b/jieba/Cargo.toml @@ -23,7 +23,7 @@ textrank = ["dep:ordered-float"] [dependencies] jieba-macros = { workspace = true } cedarwood = { workspace = true } -fxhash = { workspace = true } +rustc-hash = { workspace = true } include-flate = { workspace = true, optional = true } ordered-float = { workspace = true, optional = true } phf = { workspace = true } diff --git a/jieba/src/keywords/textrank.rs b/jieba/src/keywords/textrank.rs index e22be29..d506070 100644 --- a/jieba/src/keywords/textrank.rs +++ b/jieba/src/keywords/textrank.rs @@ -150,7 +150,7 @@ impl KeywordExtract for TextRank { } let mut word2id: HashMap = - HashMap::with_capacity_and_hasher(tags.len() / 2, fxhash::FxBuildHasher::default()); + HashMap::with_capacity_and_hasher(tags.len() / 2, rustc_hash::FxBuildHasher); let mut unique_words = Vec::with_capacity(tags.len() / 2); for t in &tags { if !allowed_pos_set.is_empty() && !allowed_pos_set.contains(t.tag) { diff --git a/jieba/src/lib.rs b/jieba/src/lib.rs index a54371b..3c9e8a3 100644 --- a/jieba/src/lib.rs +++ b/jieba/src/lib.rs @@ -78,7 +78,7 @@ use std::io::BufRead; use cedarwood::Cedar; use regex::{Match, Matches, Regex}; -pub(crate) type FxHashMap = HashMap; +pub(crate) type FxHashMap = HashMap; pub use crate::errors::Error; #[cfg(feature = "textrank")]