Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve wordlists, replacements, and test-cases #16

Merged
merged 11 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rustrict"
authors = ["Finn Bear"]
version = "0.7.10"
version = "0.7.11"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/finnbear/rustrict/"
Expand Down Expand Up @@ -71,7 +71,7 @@ serde = {version = "1", features=["derive"], optional = true}
rand = "0.8"
csv = "1.1"
censor_crate = {package = "censor", version = "0.3.0"}
rustrict_old = {package = "rustrict", version = "0.7.5"}
rustrict_old = {package = "rustrict", version = "0.7.10"}
serial_test = "0.5"
bincode = "1.3.3"
serde_json = "1"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ is used as a dataset. Positive accuracy is the percentage of profanity detected

| Crate | Accuracy | Positive Accuracy | Negative Accuracy | Time |
|-------|----------|-------------------|-------------------|------|
| [rustrict](https://crates.io/crates/rustrict) | 89.37% | 92.79% | 88.51% | 8s |
| [rustrict](https://crates.io/crates/rustrict) | 88.32% | 93.25% | 87.09% | 8s |
| [censor](https://crates.io/crates/censor) | 76.16% | 72.76% | 77.01% | 23s |

## Development
Expand Down
5 changes: 3 additions & 2 deletions src/censor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,8 +1028,9 @@ mod tests {
#[test]
#[serial]
fn censor() {
let censored = Censor::from_str("HELLO fučk Shit nigga WORLD!")
let censored = Censor::from_str("HELLO fučk Shit nudes WORLD!")
.with_censor_replacement('#')
.with_censor_first_character_threshold(Type::SEXUAL & Type::SEVERE)
.censor();

assert_eq!(censored, "HELLO f### S### ##### WORLD!");
Expand Down Expand Up @@ -1139,7 +1140,7 @@ mod tests {
"https://crates.io/crates/rustrict",
rustrict,
false, // true,
None, // Some(rustrict_old),
None // Some(rustrict_old),
);
print_accuracy("https://crates.io/crates/censor", censor, false, None);
}
Expand Down
Loading
Loading