Expand description
Shared char-level Levenshtein edit distance and normalized similarity.
Used by implicit_conflict (STALE/CUPMem predicate
conflict detection) and belief_revision (Kumiho
relation-domain check) to compare relation/predicate strings.
Only levenshtein_distance is shared with belief_revision: its relation_similarity
normalizes by byte length (not char length like normalized_similarity below) to
preserve its original pre-existing behavior. Do not consolidate the two normalizations —
they diverge for non-ASCII input and each caller’s threshold was tuned against its own
normalization.
Functions§
- levenshtein_
distance - Char-level Levenshtein edit distance between two strings.
- normalized_
similarity - Normalized Levenshtein similarity between two strings, in
[0.0, 1.0].