From 7e370ebd64e43d1ac59181c51ed9065a094d39d7 Mon Sep 17 00:00:00 2001 From: Gabor Kovesdan Date: Tue, 3 May 2011 19:33:09 +0000 Subject: - Vendor import of TRE 0.8.0 --- python/example.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 python/example.py (limited to 'python/example.py') 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] -- cgit v1.2.3