This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Usage: python diff.py FILE1 FILE2 | |
A primitive `diff` in 50 lines of Python. | |
Explained here: http://pynash.org/2013/02/26/diff-in-50-lines.html | |
""" | |
def longest_matching_slice(a, a0, a1, b, b0, b1): | |
sa, sb, n = a0, b0, 0 | |
runs = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
('Abkhazia', 'Abkhazian', 'Abkhazians'); | |
('Afghanistan', 'Afghan', 'Afghans'); | |
('Albania', 'Albanian', 'Albanians'); | |
('Algeria', 'Algerian', 'Algerians'); | |
('American Samoa', 'American Samoan', 'American Samoans'); | |
('Andorra', 'Andorran', 'Andorrans'); | |
('Angola', 'Angolan', 'Angolans'); | |
('Anguilla', 'Anguillan', 'Anguillans'); | |
('Antigua and Barbuda', 'Antiguan', 'Antiguans'); | |
('Argentina', 'Argentinian', 'Argentinians'); |