UNPKG

japanese-db

Version:

Generate Japanese dictionary SQLite database from open source materials

110 lines (109 loc) 2.67 kB
import { FuriganaMatch } from 'furigana'; import * as JMdict from './jmdict'; import * as JMnedict from './jmnedict'; interface NameValuePair { name: string; value: string; } interface KanjiArrayPair { kanji: string; array: string[]; } interface KanjivgTree { element?: string; g?: KanjivgTree[]; } /** * Definitions for each row in the exported database */ export interface DictIndexRow { source: number; id: number; kanji: string | null; reading: string; furigana: FuriganaMatch[] | null; pri_point: number | null; meaning: string; tags: string[] | null; } export declare type JMdictEntitiesRow = NameValuePair; export interface JMdictJsonsRow { ent_seq: number; json: JMdict.entry; } export declare type JMnedictEntitiesRow = NameValuePair; export interface JMnedictJsonsRow { ent_seq: number; json: JMnedict.entry; } export interface KanjiGroupsRow { kanji: string; kanken: number; jlptNew: 5 | 4 | 3 | 2 | 1 | null; } export interface KanjidicRow { sort: number; literal: string; jis208: string | null; jis212: string | null; jis213: string | null; ucs: string | null; rad_classical: number | null; rad_nelson_c: number | null; grade: number | null; stroke_count: number | null; variant: { [key: string]: string; }[] | null; freq: number | null; rad_name: string | null; jlpt: number | null; dic_number: { [key: string]: string; }[] | null; query_code: { [key: string]: string; }[] | null; reading: { [key: string]: string; }[] | null; meaning: string[] | null; nanori: string[] | null; } export interface KanjivgTreeRow { kanji: number; tree_json: KanjivgTree; } export interface MetadataRow { key: number; value: string; } export declare type RelatedAntonymsRow = KanjiArrayPair; export declare type RelatedLookalikesRow = KanjiArrayPair; export declare type RelatedSynonyms = KanjiArrayPair; export declare type RelatedVariants = KanjiArrayPair; export interface WanikaniAudioRow { kanji: string; reading: string; } export interface KanjiAliveRow { kanji: string; kname: string; kstroke: number; kmeaning: string; kgrade: number; kunyomi_ja: string | null; kunyomi: string | null; onyomi_ja: string | null; onyomi: string | null; examples: [string, string][]; radical: string | null; rad_order: number; rad_stroke: number; rad_name_ja: string; rad_name: string; rad_meaning: string; rad_position_ja: string | null; rad_position: string | null; } export {};