UNPKG

1.28 kBTypeScriptView Raw
1/**
2 * Created by user on 2018/4/15/015.
3 */
4import { IWord } from '../segment/types';
5import { IDictRow } from 'segment-dict/lib/loader/segment';
6import AbstractTableDictCore, { IDICT, IDICT2, IOptions } from './core';
7export declare type ITableDictRow = {
8 p: number;
9 f: number;
10 s?: boolean;
11};
12export { IDICT, IDICT2, IOptions };
13/**
14 * @todo 掛接其他 dict
15 */
16export declare class TableDict extends AbstractTableDictCore<ITableDictRow> {
17 type: string;
18 TABLE: IDICT<ITableDictRow>;
19 TABLE2: IDICT2<ITableDictRow>;
20 options: IOptions;
21 exists(data: IWord | IDictRow | string): ITableDictRow;
22 protected __handleInput(data: IWord | IDictRow | string): {
23 data: {
24 w: string;
25 p: number;
26 f: number;
27 };
28 plus: (string | number)[];
29 };
30 add(data: IWord | IDictRow | string, skipExists?: boolean): this;
31 protected _add({ w, p, f, s }: {
32 w: string;
33 p: number;
34 f: number;
35 s?: boolean;
36 }): void;
37 remove(target: IWord | IDictRow | string): this;
38 protected _remove({ w, p, f, s }: IWord): this;
39 json(): IDICT<ITableDictRow>;
40 /**
41 * 將目前的 表格 匯出
42 */
43 stringify(LF?: string): string;
44}
45export default TableDict;