diff options
author | ptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b> | 2016-08-09 21:50:19 +0000 |
---|---|---|
committer | ptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b> | 2016-08-09 21:50:19 +0000 |
commit | 0b19bb71ba5a4afa84e673a8239935426fa0db23 (patch) | |
tree | e9abae9c616fdfdfebd9a8a0931d8f21824f30d2 /trunk/src/examples/numerics.py | |
parent | b2c3ade75384efe76b8774b607e17fe98fab92ef (diff) | |
download | pyparsing_2.1.6.tar.gz |
Remove incorrect tag directorypyparsing_2.1.6
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/tags/pyparsing_2.1.6@405 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
Diffstat (limited to 'trunk/src/examples/numerics.py')
-rw-r--r-- | trunk/src/examples/numerics.py | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/trunk/src/examples/numerics.py b/trunk/src/examples/numerics.py deleted file mode 100644 index 5ab99dd..0000000 --- a/trunk/src/examples/numerics.py +++ /dev/null @@ -1,62 +0,0 @@ -#
-# numerics.py
-#
-# Examples of parsing real and integers using various grouping and
-# decimal point characters, varying by locale.
-#
-# Copyright 2016, Paul McGuire
-#
-# Format samples from https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html
-#
-tests = """\
-# Canadian (English and French)
-4 294 967 295,000
-
-# Danish
-4 294 967 295,000
-
-# Finnish
-4 294 967 295,000
-
-# French
-4 294 967 295,000
-
-# German
-4 294 967 295,000
-
-# Italian
-4.294.967.295,000
-
-# Norwegian
-4.294.967.295,000
-
-# Spanish
-4.294.967.295,000
-
-# Swedish
-4 294 967 295,000
-
-# GB-English
-4,294,967,295.000
-
-# US-English
-4,294,967,295.000
-
-# Thai
-4,294,967,295.000
-"""
-
-from pyparsing import Regex
-
-comma_decimal = Regex(r'\d{1,2}(([ .])\d\d\d(\2\d\d\d)*)?,\d*')
-comma_decimal.setParseAction(lambda t: float(t[0].replace(' ','').replace('.','').replace(',','.')))
-
-dot_decimal = Regex(r'\d{1,2}(([ ,])\d\d\d(\2\d\d\d)*)?\.\d*')
-dot_decimal.setParseAction(lambda t: float(t[0].replace(' ','').replace(',','')))
-
-decimal = comma_decimal ^ dot_decimal
-decimal.runTests(tests, parseAll=True)
-
-grouped_integer = Regex(r'\d{1,2}(([ .,])\d\d\d(\2\d\d\d)*)?')
-grouped_integer.setParseAction(lambda t: int(t[0].replace(' ','').replace(',','').replace('.','')))
-grouped_integer.runTests(tests, parseAll=False)
|