@whiteslove/parsing-lexicon 0.6.0 → 0.6.1
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,7 @@
|
|
|
1
1
|
import { deepFreeze } from './lexicon-core.js';
|
|
2
2
|
import { parseHousingAmenities } from './housing-text.js';
|
|
3
3
|
import { housingSemanticCanonical } from './housing-display.js';
|
|
4
|
+
import { isDirectOwner } from './housing-commercial.js';
|
|
4
5
|
|
|
5
6
|
const AMENITY_LABELS = Object.freeze({
|
|
6
7
|
dishwasher: 'Dishwasher',
|
|
@@ -152,7 +153,6 @@ export const HOUSING_LISTING_KEYWORD_TAGS = Object.freeze([
|
|
|
152
153
|
['balcony', /\b(balcony|balcon|балкон|лоджи|лоджі|balkon|балкон)/i],
|
|
153
154
|
['elevator', /\b(elevator|lift|ліфт|лифт|lift|лифт)/i],
|
|
154
155
|
['pets ok', /\b(pets? ?(allowed|ok)|se accepta animale|можно с животными|з тваринами|uy hayvon|жануар)/i],
|
|
155
|
-
['no agency', /\b(no agency|fara intermediari|fără comision|без посредник|без агент|собственник|власник|від власника|vositachisiz|egasidan|иесінен)/i],
|
|
156
156
|
['utilities included', /\b(utilities included|utilitati incluse|комунальні включ|коммунальн.*включ|kommunal)/i],
|
|
157
157
|
['studio', /\b(studio|garsonier|студи[яї]|studiya)/i],
|
|
158
158
|
['air conditioning', /\b(air ?condition|\ba\/?c\b|conditioner|кондиционер|кондиціонер|konditsioner|klimat|klima\b|aer condi[țt]ionat)/i],
|
|
@@ -172,6 +172,10 @@ export function matchHousingListingKeywordTags(text) {
|
|
|
172
172
|
for (const [tag, re] of HOUSING_LISTING_KEYWORD_TAGS) {
|
|
173
173
|
if (re.test(value)) tags.push(tag);
|
|
174
174
|
}
|
|
175
|
+
// Owner/no-agency detection is the same signal housing-commercial.js's
|
|
176
|
+
// isDirectOwner already owns; compose it instead of a second regex here
|
|
177
|
+
// so the two can't drift apart.
|
|
178
|
+
if (isDirectOwner(text)) tags.push('no agency');
|
|
175
179
|
return deepFreeze(tags);
|
|
176
180
|
}
|
|
177
181
|
|