Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

diff for single lines

Tags:

python

diff

All diff tools I've found are just comparing line by line instead of char by char. Is there any library that gives details on single line strings? Maybe also a percentage difference, though I guess there are separate functions for that?

like image 386
Tor Valamo Avatar asked Jan 09 '10 19:01

Tor Valamo


People also ask

Is diff case sensitive?

git diff does not support a case-insensitive comparison of files.


1 Answers

This algorithm diffs word-by-word:

http://github.com/paulgb/simplediff

available in Python and PHP. It can even spit out HTML formatted output using the <ins> and <del> tags.

like image 69
slebetman Avatar answered Oct 01 '22 16:10

slebetman