@predictive-text-studio/lexical-model-compiler
Version:
Keyman Developer lexical model compiler
27 lines (26 loc) • 1.11 kB
TypeScript
/**
* Re-export the good bits from in the lexical-model-compiler submodule!
*/
import LexicalModelCompiler, { DefaultLexicalModelCompiler, ModelSourceError } from "./lexical-model-compiler";
import { WordList, WordListSource } from './wordlist';
import { LexicalModelSource } from './lexical-model-source';
export default LexicalModelCompiler;
export { DefaultLexicalModelCompiler, ModelSourceError, WordList, };
/**
* Given a {@link LexicalModelSource}, this returns the compiled JavaScript
* model that can be packaged into a .kmp file.
*
* @returns {string} the generated model code
*/
export declare function compileModelFromLexicalModelSource(source: LexicalModelSource): string;
declare type WordWithCount = [string, number];
/**
* A {@link WordListSource} with the data given as an array of [word, count]
* pairs. Useful if you have already parsed out all of the lines in advanced.
*/
export declare class WordListFromArray implements WordListSource {
readonly name: string;
private _data;
constructor(name: string, data: WordWithCount[]);
lines(): Generator<[number, string]>;
}