diff options
author | Gabor Kovesdan <gabor@FreeBSD.org> | 2011-05-03 19:33:09 +0000 |
---|---|---|
committer | Gabor Kovesdan <gabor@FreeBSD.org> | 2011-05-03 19:33:09 +0000 |
commit | 7e370ebd64e43d1ac59181c51ed9065a094d39d7 (patch) | |
tree | 28a6b48ed3f1eff1d6eab2af016c684746c58035 /python/example.py |
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] |