(text: &str)
| 414 | } |
| 415 | |
| 416 | fn significant_terms(text: &str) -> Vec<&str> { |
| 417 | text.split(|ch: char| !ch.is_alphanumeric() && ch != '_') |
| 418 | .filter(|term| term.len() >= 4) |
| 419 | .filter(|term| { |
| 420 | !matches!( |
| 421 | *term, |
| 422 | "agent" |
| 423 | | "task" |
| 424 | | "with" |
| 425 | | "that" |
| 426 | | "this" |
| 427 | | "from" |
| 428 | | "only" |
| 429 | | "read" |
| 430 | | "write" |
| 431 | | "code" |
| 432 | | "file" |
| 433 | | "files" |
| 434 | ) |
| 435 | }) |
| 436 | .collect() |
| 437 | } |
| 438 | |
| 439 | fn contains_any(text: &str, terms: &[&str]) -> bool { |
| 440 | terms.iter().any(|term| text.contains(term)) |
no test coverage detected