UNPKG

taipa

Version:

Taiwanese morphological parsing library

30 lines 1.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.infectFollowingWord = exports.infectFollowingSyllable = void 0; const lexeme_1 = require("./lexeme"); const analyzer_1 = require("./analyzer"); const metaplasm_1 = require("../metaplasm"); const metaplasm_2 = require("./metaplasm"); const phraseme_1 = require("./phraseme"); function getNoInfection(word) { const mrphs = (0, analyzer_1.morphAnalyzeChanging)(word); const lx = new lexeme_1.TonalInfectionLexeme(mrphs, new metaplasm_1.TonalZeroInfectionMetaplasm()); return lx; } /** Infect the following syllable with nasalization. */ function infectFollowingSyllable(word) { const ms = (0, analyzer_1.morphAnalyzeChanging)(word); const lx = new lexeme_1.TonalInfectionLexeme(ms, new metaplasm_2.Infection()); return lx; } exports.infectFollowingSyllable = infectFollowingSyllable; /** Infect the following word with nasalization. */ function infectFollowingWord(preceding, following) { const lxPreceding = getNoInfection(preceding); const lxFollowing = getNoInfection(following); const phmk = new phraseme_1.TonalInfectionPhrasemeMaker(); return phmk.makePhraseme(lxPreceding, lxFollowing, new metaplasm_2.InfectionExternal()); } exports.infectFollowingWord = infectFollowingWord; // TODO: infection by m or n? //# sourceMappingURL=infector.js.map