UNPKG

phpmorphy

Version:

Original package is located at http://phpmorphy.sourceforge.net/

30 lines (24 loc) 482 B
class SourceInterface { getValue(key) {} } class SourceFsa extends SourceInterface { /** * @param {FsaInterface} fsa */ constructor(fsa) { super(); this.fsa = fsa; this.root = fsa.getRootTrans(); } getFsa() { return this.fsa; } getValue(key) { const result = this.fsa.walk(this.root, key, true); if (result === false || !result.annot) { return false; } return result.annot; } } export { SourceInterface, SourceFsa };