Skip to content

Commit

Permalink
Improve wordlists, replacements, and test-cases (#16)
Browse files Browse the repository at this point in the history
* Integrate CG wordlist.
  • Loading branch information
finnbear authored Oct 20, 2023
1 parent e593c7f commit 36d8cf5
Show file tree
Hide file tree
Showing 12 changed files with 7,647 additions and 124 deletions.
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

0 comments on commit 36d8cf5

Please sign in to comment.