diff options
author | ptmcg <ptmcg@austin.rr.com> | 2018-10-27 12:21:59 -0500 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2018-10-27 12:21:59 -0500 |
commit | cd761d30e64c1ecaf3518087efe2f96df052c4fc (patch) | |
tree | fe2ab5e5b3942ab47af11825f680da5347663fcd /examples/greetingInGreek.py | |
parent | ddd2ee7e9fcf5e5b7de6f1672d32ce8e5f94348d (diff) | |
download | pyparsing-git-cd761d30e64c1ecaf3518087efe2f96df052c4fc.tar.gz |
Add unicode character ranges by name
Diffstat (limited to 'examples/greetingInGreek.py')
-rw-r--r-- | examples/greetingInGreek.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/greetingInGreek.py b/examples/greetingInGreek.py index c4d002f..921ac04 100644 --- a/examples/greetingInGreek.py +++ b/examples/greetingInGreek.py @@ -6,15 +6,15 @@ #
# Copyright 2004-2016, by Paul McGuire
#
-from pyparsing import Word
+from pyparsing import Word, pyparsing_unicode
# define grammar
-alphas = ''.join(chr(x) for x in range(0x386, 0x3ce))
+alphas = pyparsing_unicode.Greek.alphas
greet = Word(alphas) + ',' + Word(alphas) + '!'
# input string
-hello = "Καλημέρα, κόσμε!".decode('utf-8')
+hello = "Καλημέρα, κόσμε!"
# parse input string
-print(greet.parseString( hello ))
+print(greet.parseString(hello))
|