UNPKG

rosaenlg-commons

Version:

Common technical elements for RosaeNLG

48 lines 1.61 kB
"use strict"; /** * @license * Copyright 2019 Ludan Stoecklé * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); exports.LanguageCommonItalian = void 0; const LanguageCommon_1 = require("./LanguageCommon"); class LanguageCommonItalian extends LanguageCommon_1.LanguageCommon { constructor() { super(); this.iso2 = 'it'; this.validPropsWord = ['G', 'S', 'P']; this.validPropsAdj = ['MS', 'MP', 'FS', 'FP']; } isConsonneImpure(word) { const wordLc = word.toLowerCase(); const begins = ['ps', 'pn', 'gn', 'x', 'z']; for (const begin of begins) { if (wordLc.startsWith(begin)) { return true; } } // s impur (autrement dit un s suivi d'une autre consonne) const regexSImpur = new RegExp('^s[' + this.constants.toutesConsonnes + ']'); if (regexSImpur.test(wordLc)) { return true; } return false; } isIFollowedByVowel(word) { const regexISuiviVoyelle = new RegExp('^[IiYy][' + this.constants.toutesVoyellesMinuscules + ']'); if (regexISuiviVoyelle.test(word)) { return true; } return false; } startsWithVowel(word) { const regexVowel = new RegExp('^[' + this.constants.toutesVoyellesMinuscules + ']'); if (regexVowel.test(word.toLowerCase())) { return true; } return false; } } exports.LanguageCommonItalian = LanguageCommonItalian; //# sourceMappingURL=LanguageCommonItalian.js.map