Skip to content

Instantly share code, notes, and snippets.

@wzulfikar
Created February 12, 2025 13:51
Show Gist options
  • Save wzulfikar/60382768da5963a77888e741442d3b03 to your computer and use it in GitHub Desktop.
Save wzulfikar/60382768da5963a77888e741442d3b03 to your computer and use it in GitHub Desktop.
Blazing fast AI content detector with Rust
pub fn is_ai(text: &str) -> bool {
text.to_lowercase().starts_with("ah, i see")
}
mod is_ai;
use is_ai::is_ai;
// Compile and run: rustc main.rs && ./main
fn main() {
let test_strings = [
"Ah, I see the issue", // AI
"ah, i see", // AI
"Hello world", // Not AI
];
for s in test_strings {
println!("{} → {}", s, if is_ai(s) {"AI"} else {"Not AI"});
}
}
@wzulfikar
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment