inflect to inflect-rs

This commit is contained in:
Llywelwyn 2023-09-09 08:57:30 +01:00
parent bec968ac26
commit 2730296c14
5 changed files with 11 additions and 7 deletions

View file

@ -1,10 +1,10 @@
[package]
name = "inflect"
name = "inflect-rs"
version = "0.1.0"
authors = ["Lewis Wynne <lewis@llyw.co.uk>"]
edition = "2021"
publish = false
description = "inflect is a Rust port of the Python inflect library, used to generate plurals, ordinals, indefinite articles, and to convert numbers to words."
publish = true
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"
repository = "https://github.com/llywelwyn/inflect_rs"
readme = "README.md"

View file

@ -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.

View file

@ -1,6 +1,6 @@
mod inflect;
mod inflect_rs;
/// 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.
pub use crate::inflect::*;
pub use crate::inflect_rs::*;

View file

@ -1,4 +1,4 @@
use inflect::*;
use inflect_rs::*;
#[test]
fn test_enclose() {
@ -47,7 +47,9 @@ fn test_si_pron() {
assert_eq!("him", get_si_pron("acc", "them", Some("masculine")));
assert_eq!("her", get_si_pron("acc", "them", Some("feminine")));
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_ne!("him", get_si_pron("acc", "them", Some("feminine")));
assert_ne!("her", get_si_pron("acc", "them", Some("masculine")));
}