From: olivier Date: Fri, 10 Jul 2009 11:20:59 +0000 (+0000) Subject: migration: improve geo ethno mapping X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c650747d365840409b7a9351f1babd5003d70bdc;p=telemeta-data.git migration: improve geo ethno mapping git-svn-id: http://svn.parisson.org/svn/crem@128 3bf09e05-f825-4182-b9bc-eedd7160adf0 --- diff --git a/trunk/import/migration/tasks/items.py b/trunk/import/migration/tasks/items.py index e11492a..ece7f61 100644 --- a/trunk/import/migration/tasks/items.py +++ b/trunk/import/migration/tasks/items.py @@ -239,6 +239,9 @@ class ItemsLocationsMapper(DataMigrator): def parse_location_str(self, str): str = re.sub("\*", "", str.strip()) str = re.sub(" +", " ", str) + m = re.match("^(\w+)\s*\(\s*(\w+)\s*\)$", str) + if m: + return [m.group(1), m.group(2)] return re.split(" *[,;/] *", str) def find_location_by_sequence(self, sequence, matched = None, unmatched = None):