inflect to inflect-rs
This commit is contained in:
parent
bec968ac26
commit
2730296c14
5 changed files with 11 additions and 7 deletions
|
|
@ -1,10 +1,10 @@
|
||||||
[package]
|
[package]
|
||||||
name = "inflect"
|
name = "inflect-rs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Lewis Wynne <lewis@llyw.co.uk>"]
|
authors = ["Lewis Wynne <lewis@llyw.co.uk>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = true
|
||||||
description = "inflect is a Rust port of the Python inflect library, used to generate plurals, ordinals, indefinite articles, and to convert numbers to words."
|
description = "inflect-rs is a Rust port of the Python inflect library, used to generate plurals, ordinals, indefinite articles, and to convert numbers to words."
|
||||||
homepage = "https://github.com/llywelwyn/inflect_rs"
|
homepage = "https://github.com/llywelwyn/inflect_rs"
|
||||||
repository = "https://github.com/llywelwyn/inflect_rs"
|
repository = "https://github.com/llywelwyn/inflect_rs"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
|
||||||
|
|
@ -1 +1,3 @@
|
||||||
# inflect
|
# inflect-rs
|
||||||
|
|
||||||
|
inflect-rs is a Rust port of the Python inflect library, used to generate plurals, ordinals, indefinite articles, and to convert numbers to words.
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
mod inflect;
|
mod inflect_rs;
|
||||||
|
|
||||||
/// inflect_rs is a Rust port of the Python inflect library.
|
/// inflect_rs is a Rust port of the Python inflect library.
|
||||||
/// It is used to generate plurals, ordinals, indefinite articles, and to convert numbers to words.
|
/// It is used to generate plurals, ordinals, indefinite articles, and to convert numbers to words.
|
||||||
|
|
||||||
pub use crate::inflect::*;
|
pub use crate::inflect_rs::*;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use inflect::*;
|
use inflect_rs::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_enclose() {
|
fn test_enclose() {
|
||||||
|
|
@ -47,7 +47,9 @@ fn test_si_pron() {
|
||||||
assert_eq!("him", get_si_pron("acc", "them", Some("masculine")));
|
assert_eq!("him", get_si_pron("acc", "them", Some("masculine")));
|
||||||
assert_eq!("her", get_si_pron("acc", "them", Some("feminine")));
|
assert_eq!("her", get_si_pron("acc", "them", Some("feminine")));
|
||||||
assert_eq!("it", get_si_pron("acc", "them", Some("neuter")));
|
assert_eq!("it", get_si_pron("acc", "them", Some("neuter")));
|
||||||
|
assert_eq!("you", get_si_pron("acc", "you", None));
|
||||||
assert_eq!("themselves", get_si_pron("acc", "itself", None));
|
assert_eq!("themselves", get_si_pron("acc", "itself", None));
|
||||||
|
|
||||||
assert_ne!("him", get_si_pron("acc", "them", Some("feminine")));
|
assert_ne!("him", get_si_pron("acc", "them", Some("feminine")));
|
||||||
assert_ne!("her", get_si_pron("acc", "them", Some("masculine")));
|
assert_ne!("her", get_si_pron("acc", "them", Some("masculine")));
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue