@whiteslove/parsing-lexicon 0.7.1 → 0.7.2
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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { findTelegramContacts, parsePhoneNumbers } from './contact.js';
|
|
2
2
|
import { countryPhoneHint } from './country-context.js';
|
|
3
3
|
|
|
4
4
|
const EXPLICIT_FEMALE_RE = /(?:^|[^\p{L}])(?:женщина|женский|девушка|female|ayol)(?=$|[^\p{L}])/iu;
|
|
@@ -91,9 +91,13 @@ export function extractCandidateExperienceYears(value) {
|
|
|
91
91
|
export function extractCandidateContacts(value, country = '') {
|
|
92
92
|
const text = String(value || '');
|
|
93
93
|
const countryHint = countryPhoneHint(country) || undefined;
|
|
94
|
+
// Candidate profiles must only publish normalized, country-aware phone
|
|
95
|
+
// evidence. A broad numeric mask is useful to protect housing money parsing,
|
|
96
|
+
// but it is deliberately permissive and can include dates or identifiers.
|
|
97
|
+
// Falling back to it here turns harmless activity timestamps into direct CV
|
|
98
|
+
// contacts and changes an otherwise platform-only profile's contact type.
|
|
94
99
|
const parsedPhone = parsePhoneNumbers(text, { countryHint, includePossible: true })[0];
|
|
95
|
-
const
|
|
96
|
-
const phone = parsedPhone?.number || broadPhone?.raw || undefined;
|
|
100
|
+
const phone = parsedPhone?.number || undefined;
|
|
97
101
|
const email = text.match(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/iu)?.[0];
|
|
98
102
|
const telegram = findTelegramContacts(text)[0]?.handle;
|
|
99
103
|
return Object.freeze({ ...(phone ? { phone } : {}), ...(email ? { email } : {}), ...(telegram ? { telegram } : {}) });
|