fix postcode pattern for Mozambique

Optional groups are not implemented yet.
This commit is contained in:
Sarah Hoffmann
2022-06-08 07:42:35 +02:00
parent 7b6ec4fc6c
commit e86db3001f
2 changed files with 3 additions and 3 deletions

View File

@@ -57,7 +57,8 @@ class _PostcodeSanitizer:
if match is None:
return None
return self.matcher.normalize(country, match), ' '.join(match.groups())
return self.matcher.normalize(country, match),\
' '.join(filter(lambda p: p is not None, match.groups()))

View File

@@ -1386,8 +1386,7 @@ mz:
languages: pt
names: !include country-names/mz.yaml
postcode:
pattern: "(dddd)-?(dd)?"
output: \1-\2
pattern: "(dddd)(?:-dd)?"
# Namibia (Namibia)