Fix 0001160: Regular expressions, dash/separator and non-ASCII characters on ExtractCity

svn: r9568
This commit is contained in:
Brian Matherly 2007-12-23 21:56:41 +00:00
parent 4a77cfdd79
commit 096db6b3a0
2 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2007-12-23 Raphael Ackermann <raphael.ackermann@gmail.com>
* src/plugins/ExtractCity.py: Fix #0001160: Regular expressions,
dash/separator and non-ASCII characters on ExtractCity
2007-12-23 Brian Matherly <brian@gramps-project.org> 2007-12-23 Brian Matherly <brian@gramps-project.org>
* src/plugins/DetAncestralReport.py: * src/plugins/DetAncestralReport.py:
* src/plugins/DetDescendantReport.py: * src/plugins/DetDescendantReport.py:

View File

@ -51,9 +51,9 @@ import GrampsDisplay
from PluginUtils import Tool, register_tool from PluginUtils import Tool, register_tool
import Utils import Utils
CITY_STATE_ZIP = re.compile("((\w|\s)+)\s*,\s*((\w|\s)+)\s*(,\s*((\d|-)+))") CITY_STATE_ZIP = re.compile("((\w|\s)+)\s*,\s*((\w|\s)+)\s*(,\s*((\d|-)+))", re.UNICODE)
CITY_STATE = re.compile("((\w|\s)+)\s*,\s*((\w|\s)+)") CITY_STATE = re.compile("((?:\w|\s)+(?:-(?:\w|\s)+)*),((?:\w|\s)+)", re.UNICODE)
STATE_ZIP = re.compile("(.+)\s+([\d-]+)") STATE_ZIP = re.compile("(.+)\s+([\d-]+)", re.UNICODE)
COUNTRY = ( _(u"United States of America"), _(u"Canada"), _(u"France")) COUNTRY = ( _(u"United States of America"), _(u"Canada"), _(u"France"))
@ -91,7 +91,7 @@ STATE_MAP = {
u"DC" : (u"District of Columbia" , 0), u"DC" : (u"District of Columbia" , 0),
u"D.C." : (u"District of Columbia" , 0), u"D.C." : (u"District of Columbia" , 0),
u"DC." : (u"District of Columbia" , 0), u"DC." : (u"District of Columbia" , 0),
u"DISTRICT OF COLMBIA" : (u"District of Columbia" , 0), u"DISTRICT OF COLUMBIA" : (u"District of Columbia" , 0),
u"FL" : (u"Florida" , 0), u"FL" : (u"Florida" , 0),
u"FL." : (u"Florida" , 0), u"FL." : (u"Florida" , 0),
u"FLA" : (u"Florida" , 0), u"FLA" : (u"Florida" , 0),
@ -419,7 +419,7 @@ class ExtractCity(Tool.BatchTool, ManagedWindow.ManagedWindow):
if match: if match:
data = match.groups() data = match.groups()
city = data[0] city = data[0]
state = data[2] state = data[1]
postal = None postal = None
if state: if state: