MCPcopy Create free account
hub / github.com/douglance/devsql / normalize

Method normalize

crates/ccql/src/dedup/mod.rs:89–115  ·  view source on GitHub ↗
(&self, s: &str)

Source from the content-addressed store, hash-verified

87 }
88
89 fn normalize(&self, s: &str) -> String {
90 let s = s.trim().to_lowercase();
91
92 // Filter out code-like content
93 if s.contains("import ")
94 || s.contains("export ")
95 || s.contains("const ")
96 || s.contains("function ")
97 || s.contains("interface ")
98 || s.starts_with("//")
99 || s.starts_with("/*")
100 || s.starts_with("```")
101 || s.contains(".js:")
102 || s.contains(".ts:")
103 || s.contains(".tsx:")
104 || s.contains("chunk-")
105 || s.contains("requestanimationframe")
106 || s.contains("installhook")
107 || s.starts_with('[')
108 || s.starts_with('{')
109 || s.starts_with('<')
110 {
111 return String::new();
112 }
113
114 s
115 }
116
117 fn is_similar(&self, a: &str, b: &str) -> bool {
118 if a == b {

Callers 1

clusterMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected