Add English to Katakana and Romaji conversion support

This commit is contained in:
2025-06-11 22:04:43 +09:00
parent 653425bf34
commit a77a8aa9bd
10 changed files with 378 additions and 11 deletions

25
types/kuroshiro.d.ts vendored Normal file
View File

@ -0,0 +1,25 @@
declare module "kuroshiro" {
interface ConvertOptions {
to?: "hiragana" | "katakana" | "romaji";
mode?: "normal" | "spaced" | "okurigana" | "furigana";
romajiSystem?: "nippon" | "passport" | "hepburn";
delimiter_start?: string;
delimiter_end?: string;
}
class Kuroshiro {
constructor();
init(analyzer: any): Promise<void>;
convert(text: string, options?: ConvertOptions): Promise<string>;
}
export = Kuroshiro;
}
declare module "kuroshiro-analyzer-mecab" {
class KuroshiroAnalyzerMecab {
constructor();
}
export = KuroshiroAnalyzerMecab;
}