@whiteslove/parsing-lexicon 0.10.6 → 0.10.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whiteslove/parsing-lexicon",
3
- "version": "0.10.6",
3
+ "version": "0.10.7",
4
4
  "description": "Shared deterministic multilingual parsing lexicon for WhitesLove housing and hiring services",
5
5
  "repository": {
6
6
  "type": "git",
@@ -552,7 +552,10 @@ function collectExplicitStreetCandidates(text) {
552
552
  if (postfix) {
553
553
  // Whatever follows the first comma ("..., Sergeli") is a district or
554
554
  // landmark, not part of the street/house.
555
- const tailText = clean(`${postfix[1]} ${postfix[3].split(/[,;]/u, 1)[0]}`);
555
+ // A building marker after the comma ("58, korpus 2") still belongs to it.
556
+ const afterStreet = postfix[3];
557
+ const cut = afterStreet.search(new RegExp(`[,;](?!\\s*${BUILDING_MARKER}\\s*${NUMBER_TOKEN})`, 'iu'));
558
+ const tailText = clean(`${postfix[1]} ${cut < 0 ? afterStreet : afterStreet.slice(0, cut)}`);
556
559
  const tail = splitAddressTail(tailText);
557
560
  if (tail) {
558
561
  add(result(