From 8b14582d1f811ef6ae6d93917370349d0bda94ce Mon Sep 17 00:00:00 2001 From: Grzegorz Grzelachowski Date: Wed, 17 Dec 2025 15:33:14 +0000 Subject: [PATCH 1/3] Improved the parsing of the street name starting with street prefix --- model/countries/PL/PL-parsing-rules.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/model/countries/PL/PL-parsing-rules.yaml b/model/countries/PL/PL-parsing-rules.yaml index 7ede4eb..de013ac 100644 --- a/model/countries/PL/PL-parsing-rules.yaml +++ b/model/countries/PL/PL-parsing-rules.yaml @@ -12,7 +12,7 @@ regex_definitions: # Regular expression to match the prefixes that indicate a house number. kStreetOptionalPrefixRe: - regex_fragment: '(?:(?:ulica|ul\.?)\s*)?' + regex_fragment: '(?:(?:ulica|ul\.?\W)\s*)?' # Regular expression to match the unit-types in Poland. kUnitTypeLiteralRe: @@ -247,3 +247,15 @@ test_parsing_definitions: output: postal-code-prefix: "00" postal-code-suffix: "843" +- id: "Test 17: street name starting with street prefix" + type: street-address-alternative-1 + input: "Ulubiona 9A/m.10" + output: + street-address-alternative-1: "Ulubiona 9A/m.10" + building-location: "Ulubiona 9A/m.10" + street: "Ulubiona" + building-and-unit: "9A/m.10" + building: "9A" + unit: "m.10" + unit-type: "m." + unit-name: "10" From 8206edef97eb6a0451ce7ae789101ce5e083f15f Mon Sep 17 00:00:00 2001 From: Grzegorz Grzelachowski Date: Wed, 17 Dec 2025 15:36:22 +0000 Subject: [PATCH 2/3] Regenerated file added --- docs/model/PL.html | 323 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 320 insertions(+), 3 deletions(-) diff --git a/docs/model/PL.html b/docs/model/PL.html index d58472f..0822fde 100644 --- a/docs/model/PL.html +++ b/docs/model/PL.html @@ -281,6 +281,15 @@ IT + + + + 🇯🇵 + + JP + @@ -799,6 +808,45 @@

Overview of concepts

+ + +
+ + +
+
+ + + postal-code-prefix + - Postal code prefix + + + + +
+ +
+ + + +
+
+ + + postal-code-suffix + - Postal code suffix + + + + +
+ +
+ + +
+ + @@ -1413,6 +1461,10 @@

Example addresses

+ + + + @@ -1520,6 +1572,10 @@

Example addresses

+ + + + country
PL
@@ -1677,6 +1733,10 @@

Example addresses

+ + + + country
PL
@@ -3742,7 +3802,7 @@

Formatting:

Flattened formatting:
address =
-streetbuilding/unit-typeunit-name
postal-codelocality1
country-name +streetbuilding/unit-typeunit-name
postal-code-prefix-postal-code-suffixlocality1
country-name

@@ -4066,7 +4126,7 @@

Parsing:

Regex Reference: kStreetOptionalPrefixRe => - (?:(?:ulica|ul\.?)\s*)? + (?:(?:ulica|ul\.?\W)\s*)? @@ -4485,7 +4545,7 @@

Parsing:

Regex Reference: kStreetOptionalPrefixRe => - (?:(?:ulica|ul\.?)\s*)? + (?:(?:ulica|ul\.?\W)\s*)? @@ -5579,6 +5639,263 @@
Flattened formatting:
+ + + + + + + +

Parsing:

+
+ + + + +
+ Decomposition + + (ParsePostalCodeOptionalSeparatorExpression) + + + Anchor beginning: True
+ + Capture Reference: ParsePostalCodeOptionalSeparatorExpression
+ + + +
+ + + Capture postal-code + + (MATCH_REQUIRED) + + + + Parts:
+
    + +
  • + + +
    + + + Capture postal-code-prefix + + (MATCH_REQUIRED) + + + + Parts:
    +
      + +
    • + + + + Regex Reference: kZipPrefixValueRe => + (?:\d{2}) + + + +
    • + +
    + + + +
    + + +
  • + +
  • + + +
    + + + No capturing pattern + + (MATCH_OPTIONAL) + + + + Parts:
    +
      + +
    • + + + +Separator: Regex Reference kZipCodeSeparatorsRe => + (?:[\s-]+) + + + +
    • + +
    + + + +
    + + +
  • + +
  • + + +
    + + + Capture postal-code-suffix + + (MATCH_OPTIONAL) + + + + Parts:
    +
      + +
    • + + + + Regex Reference: kZipSuffixValueRe => + (?:\d{3}) + + + +
    • + +
    + + + +
    + + +
  • + +
+ + + +
+ + + + + Anchor end: True
+
+ + + + +
+ +
+

Children:

+ +
+ + + + + + + +

Formatting:

+
+postal-code = +postal-code-prefix-postal-code-suffix +
+ +
Flattened formatting:
+
+postal-code =
+postal-code-prefix-postal-code-suffix +
+ +

+ # + + postal-code-prefix +

+
+ +Postal code prefix + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ # + + postal-code-suffix +

+
+ +Postal code suffix + + + + + + + + + + + + + + + + + + + + From 32b23ca82a48dfd8729052e969cbc870c7b23108 Mon Sep 17 00:00:00 2001 From: Grzegorz Grzelachowski Date: Thu, 18 Dec 2025 15:40:33 +0000 Subject: [PATCH 3/3] Added a missing test case --- model/countries/PL/PL-parsing-rules.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/model/countries/PL/PL-parsing-rules.yaml b/model/countries/PL/PL-parsing-rules.yaml index de013ac..90faf41 100644 --- a/model/countries/PL/PL-parsing-rules.yaml +++ b/model/countries/PL/PL-parsing-rules.yaml @@ -259,3 +259,15 @@ test_parsing_definitions: unit: "m.10" unit-type: "m." unit-name: "10" +- id: "Test 18: street name starting with street prefix without separator" + type: street-address-alternative-1 + input: "ul.Ulubiona 9A/m.10" + output: + street-address-alternative-1: "ul.Ulubiona 9A/m.10" + building-location: "ul.Ulubiona 9A/m.10" + street: "Ulubiona" + building-and-unit: "9A/m.10" + building: "9A" + unit: "m.10" + unit-type: "m." + unit-name: "10"