rosaenlg-filter
Advanced tools
Comparing version 4.2.3 to 4.2.4
@@ -54,2 +54,3 @@ "use strict"; | ||
res = 'START. ' + res; | ||
res = languageFilter.protectRawNumbers(res); | ||
res = languageFilter.beforeProtect(res); | ||
@@ -56,0 +57,0 @@ // PROTECT § BLOCKS |
@@ -14,2 +14,3 @@ /** | ||
constructor(languageCommon: LanguageCommon); | ||
abstract protectRawNumbers(input: string): string; | ||
contractions(input: string): string; | ||
@@ -16,0 +17,0 @@ beforeProtect(input: string): string; |
@@ -9,2 +9,3 @@ /** | ||
cleanSpacesPunctuationDoDefault: boolean; | ||
protectRawNumbers(input: string): string; | ||
beforeProtect(input: string): string; | ||
@@ -11,0 +12,0 @@ justBeforeUnprotect(input: string): string; |
@@ -21,2 +21,10 @@ "use strict"; | ||
} | ||
protectRawNumbers(input) { | ||
let res = input; | ||
const regexNumber = new RegExp(`([^\\d])${this.constants.stdBeforeWithParenthesis}((\\d{1,3}(?:\\,\\d{3})*|(?:\\d+))(?:\\.\\d+)?)`, 'g'); | ||
res = res.replace(regexNumber, (_match, before1, before2, content) => { | ||
return before1 + before2 + '§' + content + '§'; | ||
}); | ||
return res; | ||
} | ||
beforeProtect(input) { | ||
@@ -23,0 +31,0 @@ let res = input; |
@@ -9,2 +9,3 @@ /** | ||
cleanSpacesPunctuationDoDefault: boolean; | ||
protectRawNumbers(input: string): string; | ||
private getAfterDeterminer; | ||
@@ -11,0 +12,0 @@ private twoWordsContractions; |
@@ -36,2 +36,10 @@ "use strict"; | ||
} | ||
protectRawNumbers(input) { | ||
let res = input; | ||
const regexNumber = new RegExp(`([^\\d])${this.constants.stdBeforeWithParenthesis}((\\d{1,3}(?:\\s\\d{3})*|(?:\\d+))(?:,\\d+)?)`, 'g'); | ||
res = res.replace(regexNumber, (_match, before1, before2, content) => { | ||
return before1 + before2 + '§' + content + '§'; | ||
}); | ||
return res; | ||
} | ||
getAfterDeterminer(beforeProtect) { | ||
@@ -46,2 +54,3 @@ return `${this.constants.stdBetweenWithParenthesis}(${this.constants.getInBetween(beforeProtect)})([${this.constants.toutesVoyellesMinMaj}hH][${this.constants.tousCaracteresMinMajRe}]*)`; | ||
['de', 'les', 'des'], | ||
['de', 'des', 'de'], | ||
['de', 'lequel', 'duquel'], | ||
@@ -48,0 +57,0 @@ ['de', 'lesquels', 'desquels'], |
@@ -9,2 +9,3 @@ /** | ||
cleanSpacesPunctuationDoDefault: boolean; | ||
protectRawNumbers(input: string): string; | ||
} |
@@ -15,4 +15,13 @@ "use strict"; | ||
} | ||
// same as in French | ||
protectRawNumbers(input) { | ||
let res = input; | ||
const regexNumber = new RegExp(`([^\\d])${this.constants.stdBeforeWithParenthesis}((\\d{1,3}(?:\\s\\d{3})*|(?:\\d+))(?:,\\d+)?)`, 'g'); | ||
res = res.replace(regexNumber, (_match, before1, before2, content) => { | ||
return before1 + before2 + '§' + content + '§'; | ||
}); | ||
return res; | ||
} | ||
} | ||
exports.LanguageFilterGerman = LanguageFilterGerman; | ||
//# sourceMappingURL=LanguageFilterGerman.js.map |
@@ -11,2 +11,3 @@ /** | ||
languageCommon: LanguageCommonItalian; | ||
protectRawNumbers(input: string): string; | ||
private getRegex; | ||
@@ -13,0 +14,0 @@ private getElt; |
@@ -15,2 +15,11 @@ "use strict"; | ||
} | ||
// same as Spanish | ||
protectRawNumbers(input) { | ||
let res = input; | ||
const regexNumber = new RegExp(`([^\\d])${this.constants.stdBeforeWithParenthesis}((\\d{1,3}(?:\\.\\d{3})*|(?:\\d+))(?:\\,\\d+)?)`, 'g'); | ||
res = res.replace(regexNumber, (_match, before1, before2, content) => { | ||
return before1 + before2 + '§' + content + '§'; | ||
}); | ||
return res; | ||
} | ||
getRegex(part) { | ||
@@ -17,0 +26,0 @@ return new RegExp(`${this.constants.stdBeforeWithParenthesis}(${part})${this.constants.stdBetweenWithParenthesis}([${this.constants.tousCaracteresMinMajRe}]*)`, 'g'); |
@@ -9,2 +9,3 @@ /** | ||
cleanSpacesPunctuationDoDefault: boolean; | ||
protectRawNumbers(input: string): string; | ||
} |
@@ -15,4 +15,7 @@ "use strict"; | ||
} | ||
protectRawNumbers(input) { | ||
return input; | ||
} | ||
} | ||
exports.LanguageFilterOther = LanguageFilterOther; | ||
//# sourceMappingURL=LanguageFilterOther.js.map |
@@ -9,2 +9,3 @@ /** | ||
cleanSpacesPunctuationDoDefault: boolean; | ||
protectRawNumbers(input: string): string; | ||
contractions(input: string): string; | ||
@@ -11,0 +12,0 @@ cleanSpacesPunctuation(input: string): string; |
@@ -15,2 +15,10 @@ "use strict"; | ||
} | ||
protectRawNumbers(input) { | ||
let res = input; | ||
const regexNumber = new RegExp(`([^\\d])${this.constants.stdBeforeWithParenthesis}((\\d{1,3}(?:\\.\\d{3})*|(?:\\d+))(?:\\,\\d+)?)`, 'g'); | ||
res = res.replace(regexNumber, (_match, before1, before2, content) => { | ||
return before1 + before2 + '§' + content + '§'; | ||
}); | ||
return res; | ||
} | ||
contractions(input) { | ||
@@ -17,0 +25,0 @@ let res = input; |
{ | ||
"name": "rosaenlg-filter", | ||
"version": "4.2.3", | ||
"version": "4.2.4", | ||
"description": "Filtering feature of RosaeNLG", | ||
@@ -45,6 +45,6 @@ "main": "dist/index.js", | ||
"better-title-case": "^1.0.1", | ||
"english-a-an": "2.2.3", | ||
"english-a-an-list": "2.2.3", | ||
"french-contractions": "4.2.3", | ||
"rosaenlg-commons": "2.2.3", | ||
"english-a-an": "2.2.4", | ||
"english-a-an-list": "2.2.4", | ||
"french-contractions": "4.2.4", | ||
"rosaenlg-commons": "2.2.4", | ||
"titlecase-french": "^1.0.1" | ||
@@ -63,3 +63,3 @@ }, | ||
}, | ||
"gitHead": "5ca572a868727c2fad71e3d92481eb08bd39bd38" | ||
"gitHead": "55785ef79e2c4931c37360e308130b75a7b2cb8d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
91242
1234
+ Addedenglish-a-an@2.2.4(transitive)
+ Addedenglish-a-an-list@2.2.4(transitive)
+ Addedfrench-contractions@4.2.4(transitive)
+ Addedrosaenlg-commons@2.2.4(transitive)
- Removedenglish-a-an@2.2.3(transitive)
- Removedenglish-a-an-list@2.2.3(transitive)
- Removedfrench-contractions@4.2.3(transitive)
- Removedrosaenlg-commons@2.2.3(transitive)
Updatedenglish-a-an@2.2.4
Updatedenglish-a-an-list@2.2.4
Updatedfrench-contractions@4.2.4
Updatedrosaenlg-commons@2.2.4