DiffText2 computes and returns the destination text (all equalities and insertions).
(diffs []Diff)
| 1191 | |
| 1192 | // DiffText2 computes and returns the destination text (all equalities and insertions). |
| 1193 | func (dmp *DiffMatchPatch) DiffText2(diffs []Diff) string { |
| 1194 | var text bytes.Buffer |
| 1195 | |
| 1196 | for _, aDiff := range diffs { |
| 1197 | if aDiff.Type != DiffDelete { |
| 1198 | _, _ = text.WriteString(aDiff.Text) |
| 1199 | } |
| 1200 | } |
| 1201 | return text.String() |
| 1202 | } |
| 1203 | |
| 1204 | // DiffLevenshtein computes the Levenshtein distance that is the number of inserted, deleted or substituted characters. |
| 1205 | func (dmp *DiffMatchPatch) DiffLevenshtein(diffs []Diff) int { |