MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / edit_distance

Method edit_distance

atomic-core/src/diff/word.rs:394–396  ·  view source on GitHub ↗

Get the edit distance (number of token changes). This counts insertions + deletions, where replacements count as both a deletion and an insertion.

(&self)

Source from the content-addressed store, hash-verified

392 /// This counts insertions + deletions, where replacements count
393 /// as both a deletion and an insertion.
394 pub fn edit_distance(&self) -> usize {
395 self.insertions() + self.deletions()
396 }
397
398 /// Iterate over only the change operations (non-equal).
399 pub fn changes(&self) -> impl Iterator<Item = &WordDiffOp> {

Callers

nothing calls this directly

Calls 2

insertionsMethod · 0.45
deletionsMethod · 0.45

Tested by

no test coverage detected