taipa
Version:
Taiwanese morphological parsing library
36 lines • 1.89 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.unmutateFinalOfPrecedingWord = exports.unmutateFinalOfPrecedingSyllable = exports.unmutateInitialOfFollowingSyllable = void 0;
const analyzer_1 = require("./analyzer");
const lexeme_1 = require("../change/lexeme");
const metaplasm_1 = require("../change/metaplasm");
const metaplasm_2 = require("../metaplasm");
const phraseme_1 = require("../change/phraseme");
function getNoUnmutation(word) {
const mrphs = (0, analyzer_1.morphAnalyzeUnchanging)(word);
const lx = new lexeme_1.TonalUnmutationLexeme(mrphs, new metaplasm_2.TonalZeroUnmutationMetaplasm());
return lx;
}
/** Unmutates the initial of the following syllable. */
function unmutateInitialOfFollowingSyllable(word) {
const ms = (0, analyzer_1.morphAnalyzeUnchanging)(word);
const lx = new lexeme_1.TonalUnmutationLexeme(ms, new metaplasm_1.ConsonantUnmutation());
return lx;
}
exports.unmutateInitialOfFollowingSyllable = unmutateInitialOfFollowingSyllable;
/** Unmutates the final of the preceding syllable. */
function unmutateFinalOfPrecedingSyllable(word) {
const ms = (0, analyzer_1.morphAnalyzeUnchanging)(word);
const lx = new lexeme_1.TonalUnmutationLexeme(ms, new metaplasm_1.FinalConsonantUnmutationInternal());
return lx;
}
exports.unmutateFinalOfPrecedingSyllable = unmutateFinalOfPrecedingSyllable;
/** Unmutates the final of the preceding word. */
function unmutateFinalOfPrecedingWord(preceding, following) {
const lxPreceding = getNoUnmutation(preceding);
const lxFollowing = getNoUnmutation(following);
const phmk = new phraseme_1.TonalUnmutationPhrasemeMaker();
return phmk.makePhraseme(lxPreceding, lxFollowing, new metaplasm_1.FinalConsonantUnmutationExternal());
}
exports.unmutateFinalOfPrecedingWord = unmutateFinalOfPrecedingWord;
//# sourceMappingURL=unmutator.js.map