Skip to content

Commit

Permalink
Update to 2021 edition
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Molloy committed Dec 13, 2023
1 parent 278af8a commit ed5c5a0
Show file tree
Hide file tree
Showing 11 changed files with 628 additions and 484 deletions.
1,080 changes: 612 additions & 468 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"divvunspell",
"accuracy",
Expand All @@ -12,4 +13,4 @@ opt-level = 1
[profile.release]
debug = true
codegen-units = 1
lto = "fat"
lto = "fat"
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

An implementation of [hfst-ospell](https://github.com/hfst/hfst-ospell) in Rust, with added features like tokenization, case handling, and parallelisation.

[![Actions Status](https://github.com/divvun/divvunspell/workflows/Continuous%20Integration/badge.svg)](https://github.com/divvun/divvunspell/actions)

[![CI](https://github.com/divvun/divvunspell/actions/workflows/ci.yml/badge.svg)](https://github.com/divvun/divvunspell/actions/workflows/ci.yml)

## Building and installing commandline tools

Expand Down
2 changes: 1 addition & 1 deletion accuracy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "accuracy"
version = "1.0.0-beta.1"
authors = ["Brendan Molloy <brendan@bbqsrc.net>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0"
publish = false

Expand Down
2 changes: 1 addition & 1 deletion accuracy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
};

use distance::damerau_levenshtein;
use divvunspell::archive::{SpellerArchive, ZipSpellerArchive, self};
use divvunspell::archive;
use divvunspell::speller::suggestion::Suggestion;
use divvunspell::speller::{CaseHandlingConfig, SpellerConfig};
use indicatif::{ParallelProgressIterator, ProgressBar, ProgressStyle};
Expand Down
6 changes: 3 additions & 3 deletions divvunspell-bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "divvunspell-bin"
description = "Spellchecker for ZHFST/BHFST spellers, with case handling and tokenization support."
version = "1.0.0-beta.3"
version = "1.0.0"
authors = ["Brendan Molloy <brendan@bbqsrc.net>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0"
repository = "https://github.com/divvun/divvunspell"

Expand All @@ -23,4 +23,4 @@ structopt = "0.3.17"

[features]
default = []
gpt2 = ["divvunspell/gpt2"]
gpt2 = ["divvunspell/gpt2"]
2 changes: 1 addition & 1 deletion divvunspell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "divvunspell"
description = "Spell checking library for ZHFST/BHFST spellers, with case handling and tokenization support."
version = "1.0.0-beta.3"
authors = ["Brendan Molloy <brendan@bbqsrc.net>"]
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/divvun/divvunspell"

Expand Down
4 changes: 2 additions & 2 deletions divvunspell/examples/find-path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ fn main() {

match divvunspell::paths::find_speller_path(tag) {
Some(v) => println!("Found: {}", v.display()),
None => println!("Not found!")
None => println!("Not found!"),
}
}
}
4 changes: 2 additions & 2 deletions divvunspell/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ pub extern "C" fn divvun_word_indices_next<'a>(

#[no_mangle]
pub extern "C" fn divvun_word_indices_free<'a>(handle: *mut WordIndices<'a>) {
unsafe { Box::from_raw(handle) };
drop(unsafe { Box::from_raw(handle) });
}

#[no_mangle]
pub extern "C" fn divvun_cstr_free(handle: *mut c_char) {
unsafe { CString::from_raw(handle) };
drop(unsafe { CString::from_raw(handle) });
}

use crate::ffi::fbs::IntoFlatbuffer;
Expand Down
2 changes: 1 addition & 1 deletion divvunspell/src/tokenizer/case_handling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ mod tests {

#[test]
fn test() {
let a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
let _a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
.chars()
.map(|c| SmolStr::from(c.to_string()))
.collect::<Vec<SmolStr>>();
Expand Down
4 changes: 2 additions & 2 deletions thfst-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "thfst-tools"
description = "Support tools for DivvunSpell - convert ZHFST files to BHFST."
version = "1.0.0-beta.3"
authors = ["Brendan Molloy <brendan@bbqsrc.net>"]
edition = "2018"
edition = "2021"
license = "GPL-3.0"
repository = "https://github.com/divvun/divvunspell"

Expand All @@ -12,4 +12,4 @@ serde_json = "1.0.57"
divvunspell = { version = "1.0.0-beta.3", features = ["internal_convert", "compression"], path = "../divvunspell" }
box-format = "0.3.2"
structopt = "0.3.17"
tempfile = "3"
tempfile = "3"

0 comments on commit ed5c5a0

Please sign in to comment.