MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / _string_similarity

Method _string_similarity

core/error_database.py:87–95  ·  view source on GitHub ↗

Simple string similarity using common words.

(self, s1: str, s2: str)

Source from the content-addressed store, hash-verified

85 return min(1.0, score)
86
87 def _string_similarity(self, s1: str, s2: str) -> float:
88 """Simple string similarity using common words."""
89 words1 = set(re.findall(r'\w+', s1))
90 words2 = set(re.findall(r'\w+', s2))
91 if not words1 or not words2:
92 return 0.0
93 intersection = words1 & words2
94 union = words1 | words2
95 return len(intersection) / len(union) if union else 0.0
96
97
98class ErrorDatabase:

Callers 1

similarity_scoreMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected