1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import TableDictBlacklist from './table/blacklist';
|
8 | import AbstractTableDictCore from './table/core';
|
9 | import { TableDict } from './table/dict';
|
10 | import { TableDictStopword } from './table/stopword';
|
11 | import TableDictSynonym from './table/synonym';
|
12 | import { ISubOptimizer, ISubTokenizer } from './mod';
|
13 | import { EnumDictDatabase } from './const';
|
14 | import { IDICT, IDICT2, IDICT_BLACKLIST, IDICT_STOPWORD, IDICT_SYNONYM, IOptionsDoSegment, IOptionsSegment, ISPLIT, ISPLIT_FILTER, IWord } from './segment/types';
|
15 | import SegmentCore from './segment/core';
|
16 | import { ITSOverwrite } from 'ts-type';
|
17 | import { IUseDefaultOptions } from './defaults/index';
|
18 |
|
19 |
|
20 |
|
21 | export declare class Segment extends SegmentCore {
|
22 | static defaultOptionsDoSegment: IOptionsDoSegment;
|
23 | getDictDatabase<R extends TableDictSynonym>(type: EnumDictDatabase.SYNONYM, autocreate?: boolean, libTableDict?: {
|
24 | new (...argv: any[]): R;
|
25 | }): R;
|
26 | getDictDatabase<R extends TableDict>(type: EnumDictDatabase.TABLE, autocreate?: boolean, libTableDict?: {
|
27 | new (...argv: any[]): R;
|
28 | }): R;
|
29 | getDictDatabase<R extends TableDictStopword>(type: EnumDictDatabase.STOPWORD, autocreate?: boolean, libTableDict?: {
|
30 | new (...argv: any[]): R;
|
31 | }): R;
|
32 | getDictDatabase<R extends TableDictBlacklist>(type: EnumDictDatabase.BLACKLIST, autocreate?: boolean, libTableDict?: {
|
33 | new (...argv: any[]): R;
|
34 | }): R;
|
35 | getDictDatabase<R extends TableDictBlacklist>(type: EnumDictDatabase.BLACKLIST_FOR_OPTIMIZER, autocreate?: boolean, libTableDict?: {
|
36 | new (...argv: any[]): R;
|
37 | }): R;
|
38 | getDictDatabase<R extends TableDictBlacklist>(type: EnumDictDatabase.BLACKLIST_FOR_SYNONYM, autocreate?: boolean, libTableDict?: {
|
39 | new (...argv: any[]): R;
|
40 | }): R;
|
41 | getDictDatabase<R extends AbstractTableDictCore<any>>(type: string | EnumDictDatabase, autocreate?: boolean, libTableDict?: {
|
42 | new (...argv: any[]): R;
|
43 | }): R;
|
44 | |
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | use(mod: ISubOptimizer, ...argv: any[]): any;
|
51 | use(mod: ISubTokenizer, ...argv: any[]): any;
|
52 | use(mod: Array<ISubTokenizer | ISubOptimizer | string>, ...argv: any[]): any;
|
53 | use(mod: string, ...argv: any[]): any;
|
54 | use(mod: any, ...argv: any[]): any;
|
55 | _resolveDictFilename(name: string, pathPlus?: string[], extPlus?: string[]): string | string[];
|
56 | |
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | loadDict(name: string, type?: string, convert_to_lower?: boolean, skipExists?: boolean): this;
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 | loadSynonymDict(name: string, skipExists?: boolean): this;
|
71 | protected _loadBlacklistDict(name: string, type: EnumDictDatabase): this;
|
72 | |
73 |
|
74 |
|
75 | loadBlacklistDict(name: string): this;
|
76 | |
77 |
|
78 |
|
79 |
|
80 | loadBlacklistOptimizerDict(name: string): this;
|
81 | |
82 |
|
83 |
|
84 | loadBlacklistSynonymDict(name: string): this;
|
85 | |
86 |
|
87 |
|
88 |
|
89 |
|
90 | loadStopwordDict(name: string): this;
|
91 | |
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | useDefault(options?: IUseDefaultOptions, ...argv: any[]): any;
|
98 | |
99 |
|
100 |
|
101 | autoInit(options?: IUseDefaultOptions): this;
|
102 | addBlacklist(word: string, remove?: boolean): this;
|
103 | |
104 |
|
105 |
|
106 | doBlacklist(): this;
|
107 | |
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 | doSegment(text: string | Buffer, options: ITSOverwrite<IOptionsDoSegment, {
|
119 | simple: true;
|
120 | }>): string[];
|
121 | doSegment(text: string | Buffer, options?: IOptionsDoSegment): IWord[];
|
122 | }
|
123 | export declare namespace Segment {
|
124 | export { IDICT, IDICT2, IDICT_BLACKLIST, IDICT_STOPWORD, IDICT_SYNONYM, IOptionsDoSegment, IOptionsSegment, ISPLIT, ISPLIT_FILTER, IWord, };
|
125 | }
|
126 | export { IDICT, IDICT2, IDICT_BLACKLIST, IDICT_STOPWORD, IDICT_SYNONYM, IOptionsDoSegment, IOptionsSegment, ISPLIT, ISPLIT_FILTER, IWord, };
|
127 | export default Segment;
|