Skip to content

Commit 676059f

Browse files
committed
Update dependencies
1 parent 77e94d1 commit 676059f

10 files changed

Lines changed: 772 additions & 381 deletions

File tree

Cargo.lock

Lines changed: 736 additions & 323 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
[package]
1616
name = "lingua"
17-
version = "1.8.0"
17+
version = "1.9.0"
1818
authors = ["Peter M. Stahl <pemistahl@gmail.com>"]
1919
description = """
2020
An accurate natural language detection library, suitable for short text and mixed-language text
@@ -68,17 +68,17 @@ harness = false
6868
required-features = ["benchmark"]
6969

7070
[dependencies]
71-
counter = "0.7.0"
72-
dashmap = "6.1.0"
73-
fastrand = { version = "2.3.0", features = ["js"] }
71+
counter = "0.7.1"
72+
dashmap = "6.2.1"
73+
fastrand = { version = "2.5.0", features = ["js"] }
7474
fst = "0.4.7"
7575
include_dir = "0.7.4"
76-
itertools = "0.14.0"
76+
itertools = "0.15.0"
7777
maplit = "1.0.2"
78-
regex = "1.12.2"
79-
serde = { version = "1.0.228", features = ["derive"] }
80-
strum = "0.27.2"
81-
strum_macros = "0.27.2"
78+
regex = "1.13.1"
79+
serde = { version = "1.0.229", features = ["derive"] }
80+
strum = "0.28.0"
81+
strum_macros = "0.28.0"
8282
lingua-afrikaans-language-model = { path = "language-models/af", version = "1.3.0", optional = true }
8383
lingua-albanian-language-model = { path = "language-models/sq", version = "1.3.0", optional = true }
8484
lingua-arabic-language-model = { path = "language-models/ar", version = "1.3.0", optional = true }
@@ -156,20 +156,20 @@ lingua-yoruba-language-model = { path = "language-models/yo", version = "1.3.0",
156156
lingua-zulu-language-model = { path = "language-models/zu", version = "1.3.0", optional = true }
157157

158158
[target.'cfg(not(target_family = "wasm"))'.dependencies]
159-
clap = { version = "4.5.54", optional = true, features = ["derive"] }
159+
clap = { version = "4.6.6", optional = true, features = ["derive"] }
160160
cld2 = { version = "1.0.2", optional = true }
161161
indoc = { version = "2.0.7", optional = true }
162-
polars = { version = "0.51.0", optional = true, features = ["csv", "lazy"] }
163-
pyo3 = { version = "0.27.2", optional = true }
164-
rayon = "1.11.0"
162+
polars = { version = "0.55.2", optional = true, features = ["csv", "lazy"] }
163+
pyo3 = { version = "0.29.2", optional = true }
164+
rayon = "1.12.0"
165165
serde-pickle = { version = "1.2.0", optional = true }
166166
titlecase = { version = "3.6.0", optional = true }
167167
whatlang = { version = "0.18.0", optional = true }
168168
whichlang = { version = "0.1.1", optional = true }
169169

170170
[target.'cfg(target_family = "wasm")'.dependencies]
171171
serde-wasm-bindgen = "0.6.5"
172-
wasm-bindgen = "0.2.106"
172+
wasm-bindgen = "0.2.127"
173173

174174
[workspace.dependencies]
175175
include_dir = "0.7.4"
@@ -178,13 +178,13 @@ include_dir = "0.7.4"
178178
float-cmp = "0.10.0"
179179
indoc = "2.0.7"
180180
rstest = "0.26.1"
181-
tempfile = "3.24.0"
181+
tempfile = "3.27.0"
182182

183183
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
184-
criterion = "0.8.1"
184+
criterion = "0.8.2"
185185

186186
[target.'cfg(target_family = "wasm")'.dev-dependencies]
187-
wasm-bindgen-test = "0.3.56"
187+
wasm-bindgen-test = "0.3.77"
188188

189189
[features]
190190
default = [

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
[project]
1717
name = "lingua-language-detector"
18-
version = "2.2.0"
18+
version = "2.3.0"
1919
authors = [{ name = "Peter M. Stahl", email = "pemistahl@gmail.com" }]
2020
description = "An accurate natural language detection library, suitable for short text and mixed-language text"
2121
readme = "README_PYPI.md"
@@ -104,7 +104,7 @@ homepage = "https://github.com/pemistahl/lingua-py"
104104
repository = "https://github.com/pemistahl/lingua-py"
105105

106106
[project.optional-dependencies]
107-
test = ["pytest == 9.0.1"]
107+
test = ["pytest == 9.1.1"]
108108

109109
[tool.maturin]
110110
module-name = "lingua"

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
maturin == 1.11.5
2-
pytest == 9.0.2
1+
maturin == 1.15.0
2+
pytest == 9.1.1

src/bin/accuracy_reports/dataframe.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,7 @@ pub(crate) fn get_dataframe_detector_name(df: &DataFrame) -> String {
3434
}
3535

3636
pub(crate) fn get_dataframe_probability(df: &DataFrame) -> f64 {
37-
df.get_columns()
38-
.get(1)
39-
.unwrap()
40-
.f64()
41-
.unwrap()
42-
.get(0)
43-
.unwrap()
37+
df.columns().get(1).unwrap().f64().unwrap().get(0).unwrap()
4438
}
4539

4640
pub(crate) fn dataframe_contains_language(df: &DataFrame, language_name: &str) -> bool {
@@ -103,10 +97,10 @@ pub(crate) fn update_dataframe_with_new_probability(
10397
}
10498

10599
pub(crate) fn sort_dataframe(df: DataFrame) -> DataFrame {
106-
let sorted_columns = &mut df.get_column_names_str()[1..]
100+
let sorted_columns = &mut df.get_column_names()[1..]
107101
.iter()
108102
.sorted()
109-
.map(|&it| col(it))
103+
.map(|&it| col(it.as_str()))
110104
.collect_vec();
111105

112106
sorted_columns.insert(0, col("language"));

src/bin/accuracy_reports/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ fn main() {
163163
fs::File::create(&report_file_path).expect("CSV file could not be created");
164164

165165
CsvWriter::new(&mut aggregated_report_file)
166-
.with_null_value("NaN".to_string())
166+
.with_null_value(PlSmallStr::from("NaN"))
167167
.finish(&mut dataframe)
168168
.expect("Data frame could not be written to CSV file");
169169
}

tests/python/test_confidencevalue.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def test_confidence_value_copy():
2424
confidence_copy = copy(confidence)
2525
assert confidence_copy == confidence
2626
assert confidence_copy is not confidence
27-
assert confidence_copy.language == confidence.language
28-
assert confidence_copy.language is not confidence.language
27+
assert confidence_copy.language is confidence.language
2928
assert confidence_copy.value == confidence.value
3029
assert confidence_copy.value is not confidence.value
3130

@@ -35,8 +34,7 @@ def test_confidence_value_deepcopy():
3534
confidence_copy = deepcopy(confidence)
3635
assert confidence_copy == confidence
3736
assert confidence_copy is not confidence
38-
assert confidence_copy.language == confidence.language
39-
assert confidence_copy.language is not confidence.language
37+
assert confidence_copy.language is confidence.language
4038
assert confidence_copy.value == confidence.value
4139
assert confidence_copy.value is not confidence.value
4240

@@ -45,4 +43,4 @@ def test_confidence_value_pickle():
4543
confidence = ConfidenceValue(Language.ENGLISH, 0.95)
4644
serialized = pickle.dumps(confidence)
4745
deserialized = pickle.loads(serialized)
48-
assert deserialized == confidence
46+
assert deserialized == confidence

tests/python/test_detectionresult.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@ def test_detection_result_copy():
2929
result_copy = copy(result)
3030
assert result_copy == result
3131
assert result_copy is not result
32-
assert result_copy.start_index == result.start_index
3332
assert result_copy.start_index is result.start_index
34-
assert result_copy.end_index == result.end_index
3533
assert result_copy.end_index is result.end_index
36-
assert result_copy.word_count == result.word_count
3734
assert result_copy.word_count is result.word_count
38-
assert result_copy.language == result.language
39-
assert result_copy.language is not result.language
35+
assert result_copy.language is result.language
4036

4137

4238
def test_detection_result_deepcopy():
@@ -49,14 +45,10 @@ def test_detection_result_deepcopy():
4945
result_copy = deepcopy(result)
5046
assert result_copy == result
5147
assert result_copy is not result
52-
assert result_copy.start_index == result.start_index
5348
assert result_copy.start_index is result.start_index
54-
assert result_copy.end_index == result.end_index
5549
assert result_copy.end_index is result.end_index
56-
assert result_copy.word_count == result.word_count
5750
assert result_copy.word_count is result.word_count
58-
assert result_copy.language == result.language
59-
assert result_copy.language is not result.language
51+
assert result_copy.language is result.language
6052

6153

6254
def test_detection_result_pickle():

tests/python/test_isocode.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@ def test_iso_code_639_1_is_comparable():
4141

4242
def test_iso_code_639_1_copy():
4343
iso_code_copy = copy(IsoCode639_1.EN)
44-
assert iso_code_copy == IsoCode639_1.EN
45-
assert iso_code_copy is not IsoCode639_1.EN
44+
assert iso_code_copy is IsoCode639_1.EN
4645

4746

4847
def test_iso_code_639_1_deepcopy():
4948
iso_code_copy = deepcopy(IsoCode639_1.EN)
50-
assert iso_code_copy == IsoCode639_1.EN
51-
assert iso_code_copy is not IsoCode639_1.EN
49+
assert iso_code_copy is IsoCode639_1.EN
5250

5351

5452
def test_iso_code_639_1_pickle():
@@ -78,14 +76,12 @@ def test_iso_code_639_3_is_comparable():
7876

7977
def test_iso_code_639_3_copy():
8078
iso_code_copy = copy(IsoCode639_3.ENG)
81-
assert iso_code_copy == IsoCode639_3.ENG
82-
assert iso_code_copy is not IsoCode639_3.ENG
79+
assert iso_code_copy is IsoCode639_3.ENG
8380

8481

8582
def test_iso_code_639_3_deepcopy():
8683
iso_code_copy = deepcopy(IsoCode639_3.ENG)
87-
assert iso_code_copy == IsoCode639_3.ENG
88-
assert iso_code_copy is not IsoCode639_3.ENG
84+
assert iso_code_copy is IsoCode639_3.ENG
8985

9086

9187
def test_iso_code_639_3_pickle():

tests/python/test_language.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,12 @@ def test_language_is_comparable():
4141

4242
def test_language_copy():
4343
language_copy = copy(Language.ENGLISH)
44-
assert language_copy == Language.ENGLISH
45-
assert language_copy is not Language.ENGLISH
44+
assert language_copy is Language.ENGLISH
4645

4746

4847
def test_language_deepcopy():
4948
language_copy = deepcopy(Language.ENGLISH)
50-
assert language_copy == Language.ENGLISH
51-
assert language_copy is not Language.ENGLISH
49+
assert language_copy is Language.ENGLISH
5250

5351

5452
def test_language_pickle():

0 commit comments

Comments
 (0)