Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "vbb-util", | ||
"description": "JavaScript utilites for the VBB API client.", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"main": "./src/index", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -7,4 +7,30 @@ module.exports = { | ||
tokenize: function (string) { | ||
return string; | ||
searchableName: function (name) { | ||
return name | ||
// German umlauts | ||
.replace(/ß/g, 'ss') | ||
.replace(/ä/g, 'ae') | ||
.replace(/ö/g, 'oe') | ||
.replace(/ü/g, 'ue') | ||
// remove abbreviations | ||
.replace(/^[SU](\+[SU])?\W/, ' ') | ||
// expand abbreviations | ||
.toLowerCase() | ||
.replace(/\(pl\)/g, ' polen ') | ||
.replace(/\(berlin\)/g, ' berlin ') | ||
.replace(/\(bln\)/g, ' berlin ') | ||
.replace(/str\.?$/, 'strasse') | ||
.replace(/str\.?\W/g, 'strasse ') | ||
.replace(/bhf\.?$/, 'bahnhof') | ||
.replace(/bhf\.?\W/g, 'bahnhof ') | ||
// special chars | ||
.replace(/[^\w\s]/g, ' ') | ||
.replace(/_/g, ' ') | ||
.replace(/\s{2,}/g, ' ') | ||
.trim(); | ||
}, | ||
@@ -11,0 +37,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12354
471