Missing/additional words when comparing texts

192 Views Asked by At

I want to compare two text files. I don't have a problem when there's only a spelling mistake (missing character, a wrong one or an additional one) but the problem is when there is a missing line/word or an additional one. In my research, i found out that a lot of people suggested Levenshtein for comparing texts but I don't see how it can help in this case. example: if text1 was:

Montorgueil
1 Amalfi 8,20
1 Bali   3,90

and text2 was:

H
Montorgueil
bali     3,90

I have to figure out a way to say that I've got an additional line 'H' , a missing line '1 Amalfi 8,20' and a missing letter '1'

Are there any algorithms that I can use it? I am not even looking for code.

0

There are 0 best solutions below