probe_code/search/
term_exceptions.rs

1use once_cell::sync::Lazy;
2use std::collections::HashSet;
3
4/// Static set of special case terms that should be treated as exceptions
5/// These terms are used in compound word detection and special handling
6pub static EXCEPTION_TERMS: Lazy<HashSet<String>> = Lazy::new(|| {
7    vec![
8        // Network and security related terms
9        "network",
10        "firewall",
11        // Common technology terms
12        "rpc",
13        "api",
14        "http",
15        "json",
16        "xml",
17        "html",
18        "css",
19        "js",
20        "db",
21        "sql",
22        // Common software architecture terms
23        "handler",
24        "controller",
25        "service",
26        "repository",
27        "manager",
28        "factory",
29        "provider",
30        "client",
31        "server",
32        "config",
33        "util",
34        "helper",
35        "storage",
36        "cache",
37        "queue",
38        "worker",
39        "job",
40        "task",
41        "event",
42        "listener",
43        "callback",
44        "middleware",
45        "filter",
46        "validator",
47        "converter",
48        "transformer",
49        "parser",
50        "serializer",
51        "deserializer",
52        "encoder",
53        "decoder",
54        "reader",
55        "writer",
56    ]
57    .into_iter()
58    .map(String::from)
59    .collect()
60});
61
62/// Checks if a term is in the exception list
63pub fn is_exception_term(term: &str) -> bool {
64    EXCEPTION_TERMS.contains(&term.to_lowercase())
65}