pinyin-input-method-engine
Version:
汉语拼音输入法引擎 JavaScript 实现。
44 lines (43 loc) • 942 B
TypeScript
/**
* 短语
*/
export declare class PhraseInfo {
/**
* 输入的拼音
*/
readonly inputYinJieList: string[];
/**
* 纠错后的拼音
*/
readonly yinJieList: string[];
/**
* 短语值
*/
readonly phrase: string;
constructor(inputYinJieList: string[], yinJieList: string[], phrase: string);
}
export declare class Path {
readonly phraseInfoList: PhraseInfo[];
readonly score: number;
constructor(phraseInfoList: PhraseInfo[], score: number);
}
/**
* 优先集
*/
export declare class PrioritySet {
private paths;
private capacity?;
constructor(maxSize?: number);
/**
* 向优先集中添加一个路径
*/
put(item: Path): void;
/**
* 获取所有路径(无序的)
*/
getPaths: () => readonly Path[];
/**
* 获取所有路径(按照从大到小顺序排列)
*/
getSortedPaths: () => Path[];
}