@andalugeeks/andaluh
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -22,3 +22,3 @@ /** | ||
'bb', 'bc', 'bç', 'bÇ', 'bd', 'bf', 'bg', 'bh', 'bm', 'bn', 'bp', 'bq', 'bt', 'bx', 'by', 'cb', 'cc', | ||
'cç', 'cÇ', 'cd', 'cf', 'cg', 'ch', 'cm', 'cn', 'cp', 'cq', 'ct', 'cx', 'cy', | ||
'cç', 'cÇ', 'cd', 'cf', 'cg', 'ch', 'cm', 'cn', 'cp', 'cq', 'ct', 'cx', 'cy', 'çt', | ||
'db', 'dc', 'dç', 'dÇ', 'dd', 'df', 'dg', 'dh', 'dl', 'dm', 'dn', 'dp', 'dq', 'dt', 'dx', 'dy', | ||
@@ -140,3 +140,4 @@ 'fb', 'fc', 'fç', 'fÇ', 'fd', 'ff', 'fg', 'fh', 'fm', 'fn', 'fp', 'fq', 'ft', 'fx', 'fy', | ||
return text | ||
.replace(/([\\p{L}])?(?<!c)(h)(ua)/gi, function (_, prev_char, h_char, ua_chars) { | ||
.replace(/(c?)(h)(ua|úa|uá)/gi, function (word, prev_char, h_char, ua_chars) { | ||
if (prev_char.toLowerCase() === 'c') { return word }; | ||
if (prev_char === void 0) { prev_char = ''; } | ||
@@ -146,3 +147,4 @@ return prev_char + util.keep_case(h_char, 'g') + ua_chars; | ||
// cacahuete => cacagûete | ||
.replace(/([\\p{L}])?(?<!c)(h)(u)(e)/gi, function (_, prev_char, h_char, u_char, e_char) { | ||
.replace(/(c?)(h)(u)(e)/gi, function (word, prev_char, h_char, u_char, e_char) { | ||
if (prev_char.toLowerCase() === 'c') { return word }; | ||
if (prev_char === void 0) { prev_char = ''; } | ||
@@ -156,3 +158,4 @@ return prev_char + util.keep_case(h_char, 'g') + util.keep_case(u_char, 'ü') + e_char; | ||
} | ||
return word.replace(/(?<!c)(h)(\S?)/gi, function (_, h_char, next_char) { | ||
return word.replace(/(c?)(h)(\S?)/gi, function (word, prev_char, h_char, next_char) { | ||
if (prev_char.toLowerCase() === 'c') { return word }; | ||
return util.keep_case(h_char, next_char); | ||
@@ -172,3 +175,3 @@ }); | ||
// Xilófono roto => Çilófono roto | ||
.replace(/\b(?<!á|é|í|ó|ú|Á|É|Í|Ó|Ú)(x)/gi, function (x_char) { return util.keep_case(x_char, vaf); }); | ||
.replace(/\b(x)/gi, function (x_char) { return util.keep_case(x_char, vaf); }); | ||
}; | ||
@@ -198,3 +201,6 @@ | ||
.replace(/(b)(uen)/gi, function (_, b_char, suffix) { return util.keep_case(b_char, 'g') + suffix; }) | ||
.replace(/(s|a)?(?<!m)(b)(ue)(l|s)/gi, function (_, sa, b, ue, cons) { return sa + util.keep_case(b, 'g') + ue + cons; }); | ||
.replace(/(s|a)?(m?)(b)(ue)(l|s)/gi, function (word, sa, m, b, ue, cons) { | ||
if (m) { return word }; | ||
return sa + util.keep_case(b, 'g') + ue + cons; | ||
}); | ||
}; | ||
@@ -308,3 +314,3 @@ | ||
if (['a', 'e', 'A', 'E', 'á', 'é', 'Á', 'É'].includes(suffix_vowel)) { | ||
if (['a', 'e', 'A', 'E', 'á', 'é', 'Á', 'É'].indexOf(suffix_vowel) >= 0) { | ||
return match.replace(word, prefix + stressed_rules[suffix_vowel]); | ||
@@ -382,2 +388,3 @@ } | ||
var exceptions = Object.keys(exports.ENDING_RULES_EXCEPTION).join('|'); | ||
// FIX giu only works Safari>=v10 Check: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode | ||
var rExceptions = new RegExp('(?=|$|[^\\p{L}])(' + exceptions + ')(?=^|$|[^\\p{L}])', 'giu'); | ||
@@ -399,3 +406,3 @@ | ||
this.transcript = function (text, vaf, vvf, scapeLinks, debug=false) { | ||
this.transcript = function (text, vaf, vvf, scapeLinks) { | ||
if (vaf === void 0) { vaf = exports.VAF; } | ||
@@ -428,6 +435,2 @@ if (vvf === void 0) { vvf = exports.VVF; } | ||
var finalText = rules.reduce(function (substitutedText, rule) { | ||
if (debug) { | ||
//console.log(substitutedText); | ||
} | ||
if (rule === _this.x_rules) | ||
@@ -434,0 +437,0 @@ return _this.x_rules(substitutedText, vaf); |
{ | ||
"name": "@andalugeeks/andaluh", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "andaluh-js", | ||
@@ -5,0 +5,0 @@ "main": "andaluh/epa.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
44011
564
0