UNPKG

taipa

Version:

Taiwanese morphological parsing library

30 lines 1.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.uninfectFollowingWord = exports.uninfectFollowingSyllable = exports.getNoUninfection = void 0; const analyzer_1 = require("./analyzer"); const lexeme_1 = require("../change/lexeme"); const phraseme_1 = require("../change/phraseme"); const metaplasm_1 = require("../change/metaplasm"); const metaplasm_2 = require("../metaplasm"); function getNoUninfection(word) { const mrphs = (0, analyzer_1.morphAnalyzeUnchanging)(word); const lx = new lexeme_1.TonalUninfectionLexeme(mrphs, new metaplasm_2.TonalZeroUninfectionMetaplasm()); return lx; } exports.getNoUninfection = getNoUninfection; /** Uninfect the following syllable which is infected by a nasalization. */ function uninfectFollowingSyllable(word) { const ms = (0, analyzer_1.morphAnalyzeUnchanging)(word); const lx = new lexeme_1.TonalUninfectionLexeme(ms, new metaplasm_1.Uninfection()); return lx; } exports.uninfectFollowingSyllable = uninfectFollowingSyllable; /** Uninfect the following word which is infected by a nasalization. */ function uninfectFollowingWord(preceding, following) { const lxPreceding = getNoUninfection(preceding); const lxFollowing = getNoUninfection(following); const phmk = new phraseme_1.TonalUninfectionPhrasemeMaker(); return phmk.makePhraseme(lxPreceding, lxFollowing, new metaplasm_1.UninfectionExternal()); } exports.uninfectFollowingWord = uninfectFollowingWord; //# sourceMappingURL=uninfector.js.map