diff options
Diffstat (limited to 'python/example.py')
-rw-r--r-- | python/example.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/python/example.py b/python/example.py new file mode 100644 index 0000000000000..38f23308cc774 --- /dev/null +++ b/python/example.py @@ -0,0 +1,20 @@ +import tre + +fz = tre.Fuzzyness(maxerr = 3) +print fz + +pt = tre.compile("Don(ald( Ervin)?)? Knuth", tre.EXTENDED) +data = """ +In addition to fundamental contributions in several branches of +theoretical computer science, Donnald Erwin Kuth is the creator of the +TeX computer typesetting system, the related METAFONT font definition +language and rendering system, and the Computer Modern family of +typefaces. + +""" + +m = pt.search(data, fz) + +if m: + print m.groups() + print m[0] |