@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 +1 -1
- package/src/housing-address.js +4 -1
package/package.json
CHANGED
package/src/housing-address.js
CHANGED
|
@@ -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
|
-
|
|
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(
|