DiffText2 computes and returns the destination text (all equalities and insertions).
(diffs []Diff)
| 1208 | |
| 1209 | // DiffText2 computes and returns the destination text (all equalities and insertions). |
| 1210 | func (dmp *DiffMatchPatch) DiffText2(diffs []Diff) string { |
| 1211 | var text bytes.Buffer |
| 1212 | |
| 1213 | for _, aDiff := range diffs { |
| 1214 | if aDiff.Type != DiffDelete { |
| 1215 | _, _ = text.WriteString(aDiff.Text) |
| 1216 | } |
| 1217 | } |
| 1218 | return text.String() |
| 1219 | } |
| 1220 | |
| 1221 | // DiffLevenshtein computes the Levenshtein distance that is the number of inserted, deleted or substituted characters. |
| 1222 | func (dmp *DiffMatchPatch) DiffLevenshtein(diffs []Diff) int { |