1# Any copyright is dedicated to the Public Domain.
2# http://creativecommons.org/publicdomain/zero/1.0/
3
4from bdelta import BDelta
5
6a = u"The quick brown fox jumped over the lazy dog"
7b = u"The quick drowned fox jumped over the lazy dog"
8
9b = BDelta(a, b)
10
11b.b_pass(13, 27, 0) # Find all matches that are at least 27 chars long
12print list(b.matches()) # [(15, 17, 29)])
13
14b.b_pass(3, 5, 0) # Find all matches that are at least 5 chars long
15print list(b.matches()) # [(0, 0, 10), (15, 17, 29)]
16
17b.b_pass(2, 3, 0) # Find all matches that are at least 3 chars long
18print list(b.matches()) # [(0, 0, 10), (11, 11, 4), (15, 17, 29)]
19