forked from lingdojo/kana-dojo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkuroshiro.d.ts
More file actions
44 lines (38 loc) · 1.04 KB
/
kuroshiro.d.ts
File metadata and controls
44 lines (38 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
declare module 'kuroshiro' {
interface KuroshiroOptions {
to: 'hiragana' | 'katakana' | 'romaji';
mode?: 'normal' | 'spaced' | 'okurigana' | 'furigana';
romajiSystem?: 'nippon' | 'passport' | 'hepburn';
delimiter_start?: string;
delimiter_end?: string;
}
interface Analyzer {
init(): Promise<void>;
}
class Kuroshiro {
init(analyzer: Analyzer): Promise<void>;
convert(text: string, options: KuroshiroOptions): Promise<string>;
}
export default Kuroshiro;
}
declare module 'kuroshiro-analyzer-kuromoji' {
interface KuromojiToken {
surface_form: string;
pos: string;
pos_detail_1: string;
pos_detail_2: string;
pos_detail_3: string;
conjugated_type: string;
conjugated_form: string;
basic_form: string;
reading: string;
pronunciation: string;
}
class KuromojiAnalyzer {
constructor(options?: { dictPath?: string });
init(): Promise<void>;
parse(text: string): Promise<KuromojiToken[]>;
}
export type { KuromojiToken };
export default KuromojiAnalyzer;
}