yomitan-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +485 -0
- package/dist/anki-connect-BQyCGW3O.cjs +513 -0
- package/dist/anki-connect-BQyCGW3O.cjs.map +1 -0
- package/dist/anki-connect-CPPuhyiQ.js +6 -0
- package/dist/anki-connect-DbrQHphS.js +495 -0
- package/dist/anki-connect-DbrQHphS.js.map +1 -0
- package/dist/anki-connect-DcheJrp-.cjs +6 -0
- package/dist/anki.cjs +1758 -0
- package/dist/anki.cjs.map +1 -0
- package/dist/anki.d.cts +751 -0
- package/dist/anki.d.cts.map +1 -0
- package/dist/anki.d.ts +751 -0
- package/dist/anki.d.ts.map +1 -0
- package/dist/anki.js +1751 -0
- package/dist/anki.js.map +1 -0
- package/dist/audio-D9DvYyB7.d.cts +48 -0
- package/dist/audio-D9DvYyB7.d.cts.map +1 -0
- package/dist/audio-DQulUkDM.d.ts +48 -0
- package/dist/audio-DQulUkDM.d.ts.map +1 -0
- package/dist/audio-url-generator-BXvQaqUi.cjs +4 -0
- package/dist/audio-url-generator-Dy2hb2Mm.cjs +414 -0
- package/dist/audio-url-generator-Dy2hb2Mm.cjs.map +1 -0
- package/dist/audio-url-generator-Qi0rfzHz.js +4 -0
- package/dist/audio-url-generator-pFQAB5Nb.js +390 -0
- package/dist/audio-url-generator-pFQAB5Nb.js.map +1 -0
- package/dist/audio.cjs +7 -0
- package/dist/audio.d.cts +86 -0
- package/dist/audio.d.cts.map +1 -0
- package/dist/audio.d.ts +86 -0
- package/dist/audio.d.ts.map +1 -0
- package/dist/audio.js +4 -0
- package/dist/batch-processor-BR-gB3H3.js +84 -0
- package/dist/batch-processor-BR-gB3H3.js.map +1 -0
- package/dist/batch-processor-CSF1acTw.cjs +3 -0
- package/dist/batch-processor-DFqM_L-_.cjs +91 -0
- package/dist/batch-processor-DFqM_L-_.cjs.map +1 -0
- package/dist/batch-processor-Quo9jUyf.js +3 -0
- package/dist/chunk-BCwAaXi7.cjs +31 -0
- package/dist/cjk-util-Dp0ZU0sh.cjs +167 -0
- package/dist/cjk-util-Dp0ZU0sh.cjs.map +1 -0
- package/dist/cjk-util-DubXBGDG.js +94 -0
- package/dist/cjk-util-DubXBGDG.js.map +1 -0
- package/dist/core-BUpclilG.d.cts +102 -0
- package/dist/core-BUpclilG.d.cts.map +1 -0
- package/dist/core-DFUj5GtA.d.ts +102 -0
- package/dist/core-DFUj5GtA.d.ts.map +1 -0
- package/dist/database.cjs +7 -0
- package/dist/database.d.cts +4 -0
- package/dist/database.d.ts +4 -0
- package/dist/database.js +5 -0
- package/dist/dictionary-D7l-qFt1.d.cts +316 -0
- package/dist/dictionary-D7l-qFt1.d.cts.map +1 -0
- package/dist/dictionary-_vzfBLWi.d.ts +316 -0
- package/dist/dictionary-_vzfBLWi.d.ts.map +1 -0
- package/dist/dictionary-data-util-CHnRdYZ9.cjs +378 -0
- package/dist/dictionary-data-util-CHnRdYZ9.cjs.map +1 -0
- package/dist/dictionary-data-util-CfOLfEDE.js +323 -0
- package/dist/dictionary-data-util-CfOLfEDE.js.map +1 -0
- package/dist/dictionary-database-BDC2f9zc.d.ts +58 -0
- package/dist/dictionary-database-BDC2f9zc.d.ts.map +1 -0
- package/dist/dictionary-database-CU4TsvCC.js +393 -0
- package/dist/dictionary-database-CU4TsvCC.js.map +1 -0
- package/dist/dictionary-database-DsOi04Sg.d.cts +58 -0
- package/dist/dictionary-database-DsOi04Sg.d.cts.map +1 -0
- package/dist/dictionary-database-lvFvftnO.cjs +412 -0
- package/dist/dictionary-database-lvFvftnO.cjs.map +1 -0
- package/dist/dictionary-importer-BkQQSBhm.d.ts +237 -0
- package/dist/dictionary-importer-BkQQSBhm.d.ts.map +1 -0
- package/dist/dictionary-importer-Cen1z6co.js +1821 -0
- package/dist/dictionary-importer-Cen1z6co.js.map +1 -0
- package/dist/dictionary-importer-DYmmWmcX.cjs +8 -0
- package/dist/dictionary-importer-Da3AuTZw.d.cts +237 -0
- package/dist/dictionary-importer-Da3AuTZw.d.cts.map +1 -0
- package/dist/dictionary-importer-Dhn75iZ4.cjs +1834 -0
- package/dist/dictionary-importer-Dhn75iZ4.cjs.map +1 -0
- package/dist/dictionary-importer-xWkel0h-.js +8 -0
- package/dist/dictionary-update-checker-BNE4pGTx.js +4 -0
- package/dist/dictionary-update-checker-Byjvifd2.cjs +75 -0
- package/dist/dictionary-update-checker-Byjvifd2.cjs.map +1 -0
- package/dist/dictionary-update-checker-YdpalZ41.cjs +4 -0
- package/dist/dictionary-update-checker-kKukiovj.js +69 -0
- package/dist/dictionary-update-checker-kKukiovj.js.map +1 -0
- package/dist/display-generator-BGVWiI0t.js +746 -0
- package/dist/display-generator-BGVWiI0t.js.map +1 -0
- package/dist/display-generator-BMQmG5Ov.cjs +9 -0
- package/dist/display-generator-BxZ7mBjP.js +9 -0
- package/dist/display-generator-DyP-HNzP.cjs +758 -0
- package/dist/display-generator-DyP-HNzP.cjs.map +1 -0
- package/dist/errors-BSezaJwm.cjs +35 -0
- package/dist/errors-BSezaJwm.cjs.map +1 -0
- package/dist/errors-DuuDSO5N.js +22 -0
- package/dist/errors-DuuDSO5N.js.map +1 -0
- package/dist/frequency-ranking-BXjfhhUQ.js +3 -0
- package/dist/frequency-ranking-Cx1kkIrw.cjs +3 -0
- package/dist/frequency-ranking-DEJMTMdg.js +159 -0
- package/dist/frequency-ranking-DEJMTMdg.js.map +1 -0
- package/dist/frequency-ranking-DVYxTXN-.cjs +166 -0
- package/dist/frequency-ranking-DVYxTXN-.cjs.map +1 -0
- package/dist/furigana-5HK97CY8.js +4 -0
- package/dist/furigana-9bBI9-qe.d.ts +47 -0
- package/dist/furigana-9bBI9-qe.d.ts.map +1 -0
- package/dist/furigana-B3-0y231.js +471 -0
- package/dist/furigana-B3-0y231.js.map +1 -0
- package/dist/furigana-CjOhzvZt.d.cts +47 -0
- package/dist/furigana-CjOhzvZt.d.cts.map +1 -0
- package/dist/furigana-DpZLcues.cjs +609 -0
- package/dist/furigana-DpZLcues.cjs.map +1 -0
- package/dist/furigana-h3v2ub4-.cjs +4 -0
- package/dist/import.cjs +12 -0
- package/dist/import.d.cts +107 -0
- package/dist/import.d.cts.map +1 -0
- package/dist/import.d.ts +107 -0
- package/dist/import.d.ts.map +1 -0
- package/dist/import.js +9 -0
- package/dist/index.cjs +275 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +211 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +211 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +238 -0
- package/dist/index.js.map +1 -0
- package/dist/json-DGd-cunA.js +17 -0
- package/dist/json-DGd-cunA.js.map +1 -0
- package/dist/json-DKWp-B7Y.cjs +30 -0
- package/dist/json-DKWp-B7Y.cjs.map +1 -0
- package/dist/language-KN_u-nTR.d.ts +104 -0
- package/dist/language-KN_u-nTR.d.ts.map +1 -0
- package/dist/language-xAbQxgXc.d.cts +104 -0
- package/dist/language-xAbQxgXc.d.cts.map +1 -0
- package/dist/language.cjs +15626 -0
- package/dist/language.cjs.map +1 -0
- package/dist/language.d.cts +959 -0
- package/dist/language.d.cts.map +1 -0
- package/dist/language.d.ts +959 -0
- package/dist/language.d.ts.map +1 -0
- package/dist/language.js +15522 -0
- package/dist/language.js.map +1 -0
- package/dist/log-D8KtR3aP.cjs +67 -0
- package/dist/log-D8KtR3aP.cjs.map +1 -0
- package/dist/log-hgSll-dS.js +60 -0
- package/dist/log-hgSll-dS.js.map +1 -0
- package/dist/lookup.cjs +13 -0
- package/dist/lookup.d.cts +161 -0
- package/dist/lookup.d.cts.map +1 -0
- package/dist/lookup.d.ts +161 -0
- package/dist/lookup.d.ts.map +1 -0
- package/dist/lookup.js +10 -0
- package/dist/media-loader-BABA_E4W.js +3 -0
- package/dist/media-loader-Ce9cuANS.cjs +21 -0
- package/dist/media-loader-Ce9cuANS.cjs.map +1 -0
- package/dist/media-loader-qRti-Q6h.js +14 -0
- package/dist/media-loader-qRti-Q6h.js.map +1 -0
- package/dist/media-loader-xlUGaJrx.cjs +3 -0
- package/dist/multi-language-transformer-AlxOM6b3.js +637 -0
- package/dist/multi-language-transformer-AlxOM6b3.js.map +1 -0
- package/dist/multi-language-transformer-MdbQBBOt.cjs +685 -0
- package/dist/multi-language-transformer-MdbQBBOt.cjs.map +1 -0
- package/dist/multi-language-transformer-SEhcJXEB.d.ts +63 -0
- package/dist/multi-language-transformer-SEhcJXEB.d.ts.map +1 -0
- package/dist/multi-language-transformer-Ul9mbRce.d.cts +63 -0
- package/dist/multi-language-transformer-Ul9mbRce.d.cts.map +1 -0
- package/dist/pronunciation-generator-BtBc4q_V.js +397 -0
- package/dist/pronunciation-generator-BtBc4q_V.js.map +1 -0
- package/dist/pronunciation-generator-CBYdXYou.js +4 -0
- package/dist/pronunciation-generator-CFbZlf5J.cjs +445 -0
- package/dist/pronunciation-generator-CFbZlf5J.cjs.map +1 -0
- package/dist/pronunciation-generator-DOz9hEuk.cjs +4 -0
- package/dist/render.cjs +2796 -0
- package/dist/render.cjs.map +1 -0
- package/dist/render.d.cts +424 -0
- package/dist/render.d.cts.map +1 -0
- package/dist/render.d.ts +424 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +2777 -0
- package/dist/render.js.map +1 -0
- package/dist/sentence-parser-BPAJNzqW.js +126 -0
- package/dist/sentence-parser-BPAJNzqW.js.map +1 -0
- package/dist/sentence-parser-BVIOI64h.cjs +132 -0
- package/dist/sentence-parser-BVIOI64h.cjs.map +1 -0
- package/dist/sentence-parser-BoHO3cHn.js +5 -0
- package/dist/sentence-parser-DQVLSW0z.cjs +5 -0
- package/dist/structured-content-generator-BtOApkTW.cjs +4 -0
- package/dist/structured-content-generator-Bx62RYa8.js +4 -0
- package/dist/structured-content-generator-CLnybumI.js +276 -0
- package/dist/structured-content-generator-CLnybumI.js.map +1 -0
- package/dist/structured-content-generator-DrwkB0-k.cjs +282 -0
- package/dist/structured-content-generator-DrwkB0-k.cjs.map +1 -0
- package/dist/text-utilities-B7PIythe.js +8 -0
- package/dist/text-utilities-B7PIythe.js.map +1 -0
- package/dist/text-utilities-Del2Ivkg.cjs +15 -0
- package/dist/text-utilities-Del2Ivkg.cjs.map +1 -0
- package/dist/translator-CRPlPzqi.cjs +1545 -0
- package/dist/translator-CRPlPzqi.cjs.map +1 -0
- package/dist/translator-CWgG5drA.js +1539 -0
- package/dist/translator-CWgG5drA.js.map +1 -0
- package/dist/translator-CaGtJvnQ.cjs +6 -0
- package/dist/translator-Cc6OGxrW.d.ts +180 -0
- package/dist/translator-Cc6OGxrW.d.ts.map +1 -0
- package/dist/translator-CcA-s-W4.d.cts +180 -0
- package/dist/translator-CcA-s-W4.d.cts.map +1 -0
- package/dist/translator-CuJOTK6l.js +6 -0
- package/dist/utilities-C-lbZaJE.cjs +52 -0
- package/dist/utilities-C-lbZaJE.cjs.map +1 -0
- package/dist/utilities-bi3EF-q5.js +33 -0
- package/dist/utilities-bi3EF-q5.js.map +1 -0
- package/package.json +102 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary-importer-Cen1z6co.js","names":["path: string","mediaType: string","_validators: CompiledSchemaValidators | null","dictionaryIndexSchema","dictionaryTermBankV1Schema","dictionaryTermBankV3Schema","dictionaryTermMetaBankV3Schema","dictionaryKanjiBankV1Schema","dictionaryKanjiBankV3Schema","dictionaryKanjiMetaBankV3Schema","dictionaryTagBankV3Schema","mediaLoader?: MediaLoader","onProgress?: DictionaryImporter.OnProgressCallback","dictionaryDatabase: DictionaryDB","archiveContent: ArrayBuffer","details: DictionaryImporter.ImportDetails","errors: Error[]","objectStoreName: DictionaryDatabase.ObjectStoreName","entries: unknown[]","queryDetails: DictionaryImporter.QueryDetails","counts: DictionaryImporter.SummaryCounts","summaryDetails: DictionaryImporter.SummaryDetails","requirements: DictionaryImporter.ImportRequirement[]","fileMap: DictionaryImporter.ArchiveFileMap","index: unknown","count: number","dictionaryTitle: string","version: number","index: DictionaryData.Index","details: DictionaryImporter.SummaryDetails","summary: DictionaryImporter.Summary","description","string: string | undefined","schema: import('ajv').ValidateFunction","fileName: string","termBank: DictionaryImporter.CompiledSchemaName","termMetaBank: DictionaryImporter.CompiledSchemaName","kanjiBank: DictionaryImporter.CompiledSchemaName","kanjiMetaBank: DictionaryImporter.CompiledSchemaName","tagBank: DictionaryImporter.CompiledSchemaName","css: string","data:\n | DictionaryData.TermGlossaryText\n | DictionaryData.TermGlossaryImage\n | DictionaryData.TermGlossaryStructuredContent","entry: DictionaryDatabase.DatabaseTermEntry","data: DictionaryData.TermGlossaryImage","target: DictionaryData.TermGlossaryImage","data: DictionaryData.TermGlossaryStructuredContent","content: StructuredContent.Content","content: StructuredContent.ImageElement","target: StructuredContent.ImageElement","context: DictionaryImporter.ImportRequirementContext","requirement: DictionaryImporter.ImportRequirement","source: DictionaryData.TermGlossaryImage","source: StructuredContent.ImageElement","target: StructuredContent.ImageElementBase","source: StructuredContent.ImageElementBase","path: string","message: string","width: number","height: number","entry: DictionaryData.TermV1","dictionary: string","entry: DictionaryData.TermV3","entry: DictionaryData.TermMeta","entry: DictionaryData.KanjiV1","entry: DictionaryData.KanjiV3","entry: DictionaryData.KanjiMeta","entry: DictionaryData.Tag","results: DictionaryDatabase.Tag[]","results: DictionaryImporter.QueryResult","files: Entry[]","convertEntry: (entry: TEntry, dictionaryTitle: string) => TResult","results: TResult[]","entries: unknown","file: Entry","schemaName: DictionaryImporter.CompiledSchemaName","metaList: DictionaryDatabase.DatabaseTermMeta[] | DictionaryDatabase.DatabaseKanjiMeta[]","counts: DictionaryImporter.SummaryMetaCount","entry: Entry","writer: Writer<T> | WritableWriter"],"sources":["../src/util/media-util.ts","../src/import/schemas/dictionary-index-schema.json","../src/import/schemas/dictionary-kanji-bank-v1-schema.json","../src/import/schemas/dictionary-kanji-bank-v3-schema.json","../src/import/schemas/dictionary-kanji-meta-bank-v3-schema.json","../src/import/schemas/dictionary-tag-bank-v3-schema.json","../src/import/schemas/dictionary-term-bank-v1-schema.json","../src/import/schemas/dictionary-term-bank-v3-schema.json","../src/import/schemas/dictionary-term-meta-bank-v3-schema.json","../src/import/schema-validators.ts","../src/import/dictionary-importer.ts"],"sourcesContent":["/**\n * Gets the file extension of a file path.\n */\nexport function getFileNameExtension(path: string): string {\n const match = /\\.[^./\\\\]*$/.exec(path);\n return match !== null ? match[0] : '';\n}\n\n/**\n * Gets an image file's media type using a file path.\n */\nexport function getImageMediaTypeFromFileName(path: string): string | null {\n switch (getFileNameExtension(path).toLowerCase()) {\n case '.apng':\n return 'image/apng';\n case '.avif':\n return 'image/avif';\n case '.bmp':\n return 'image/bmp';\n case '.gif':\n return 'image/gif';\n case '.ico':\n case '.cur':\n return 'image/x-icon';\n case '.jpg':\n case '.jpeg':\n case '.jfif':\n case '.pjpeg':\n case '.pjp':\n return 'image/jpeg';\n case '.png':\n return 'image/png';\n case '.svg':\n return 'image/svg+xml';\n case '.tif':\n case '.tiff':\n return 'image/tiff';\n case '.webp':\n return 'image/webp';\n default:\n return null;\n }\n}\n\n/**\n * Gets the file extension for a corresponding image media type.\n */\nexport function getFileExtensionFromImageMediaType(mediaType: string): string | null {\n switch (mediaType) {\n case 'image/apng':\n return '.apng';\n case 'image/avif':\n return '.avif';\n case 'image/bmp':\n return '.bmp';\n case 'image/gif':\n return '.gif';\n case 'image/x-icon':\n return '.ico';\n case 'image/jpeg':\n return '.jpeg';\n case 'image/png':\n return '.png';\n case 'image/svg+xml':\n return '.svg';\n case 'image/tiff':\n return '.tiff';\n case 'image/webp':\n return '.webp';\n default:\n return null;\n }\n}\n\n/**\n * Gets the file extension for a corresponding audio media type.\n */\nexport function getFileExtensionFromAudioMediaType(mediaType: string): string | null {\n switch (mediaType) {\n case 'audio/aac':\n return '.aac';\n case 'audio/mpeg':\n case 'audio/mp3':\n return '.mp3';\n case 'audio/mp4':\n return '.mp4';\n case 'audio/ogg':\n case 'audio/vorbis':\n case 'application/ogg':\n return '.ogg';\n case 'audio/vnd.wav':\n case 'audio/wave':\n case 'audio/wav':\n case 'audio/x-wav':\n case 'audio/x-pn-wav':\n return '.wav';\n case 'audio/flac':\n return '.flac';\n case 'audio/webm':\n return '.webm';\n default:\n return null;\n }\n}\n","{\n \"$id\": \"dictionaryIndex\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"definitions\": {\n \"isoLanguageCode\": {\n \"type\": \"string\",\n \"description\": \"ISO language code (ISO 639-1 where possible, ISO 639-3 otherwise).\",\n \"pattern\": \"^[a-z]{2,3}$\"\n }\n },\n \"type\": \"object\",\n \"description\": \"Index file containing information about the data contained in the dictionary.\",\n \"required\": [\n \"title\",\n \"revision\"\n ],\n \"properties\": {\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Title of the dictionary.\"\n },\n \"revision\": {\n \"type\": \"string\",\n \"description\": \"Revision of the dictionary. This value is displayed, and used to check for dictionary updates.\"\n },\n \"minimumYomitanVersion\": {\n \"type\": \"string\",\n \"description\": \"Minimum version of Yomitan that is compatible with this dictionary.\"\n },\n \"sequenced\": {\n \"type\": \"boolean\",\n \"default\": false,\n \"description\": \"Whether or not this dictionary contains sequencing information for related terms.\"\n },\n \"format\": {\n \"type\": \"integer\",\n \"description\": \"Format of data found in the JSON data files.\",\n \"enum\": [1, 2, 3]\n },\n \"version\": {\n \"type\": \"integer\",\n \"description\": \"Alias for format.\",\n \"enum\": [1, 2, 3]\n },\n \"author\": {\n \"type\": \"string\",\n \"description\": \"Creator of the dictionary.\"\n },\n \"isUpdatable\": {\n \"type\": \"boolean\",\n \"const\": true,\n \"description\": \"Whether this dictionary contains links to its latest version.\"\n },\n \"indexUrl\": {\n \"type\": \"string\",\n \"description\": \"URL for the index file of the latest revision of the dictionary, used to check for updates.\"\n },\n \"downloadUrl\": {\n \"type\": \"string\",\n \"description\": \"URL for the download of the latest revision of the dictionary.\"\n },\n \"url\": {\n \"type\": \"string\",\n \"description\": \"URL for the source of the dictionary, displayed in the dictionary details.\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"Description of the dictionary data.\"\n },\n \"attribution\": {\n \"type\": \"string\",\n \"description\": \"Attribution information for the dictionary data.\"\n },\n \"sourceLanguage\": {\n \"$ref\": \"#/definitions/isoLanguageCode\",\n \"description\": \"Language of the terms in the dictionary.\"\n },\n \"targetLanguage\": {\n \"$ref\": \"#/definitions/isoLanguageCode\",\n \"description\": \"Main language of the definitions in the dictionary.\"\n },\n \"frequencyMode\": {\n \"type\": \"string\",\n \"enum\": [\"occurrence-based\", \"rank-based\"]\n },\n \"tagMeta\": {\n \"type\": \"object\",\n \"description\": \"Tag information for terms and kanji. This object is obsolete and individual tag files should be used instead.\",\n \"additionalProperties\": {\n \"type\": \"object\",\n \"description\": \"Information about a single tag. The object key is the name of the tag.\",\n \"properties\": {\n \"category\": {\n \"type\": \"string\",\n \"description\": \"Category for the tag.\"\n },\n \"order\": {\n \"type\": \"number\",\n \"description\": \"Sorting order for the tag.\"\n },\n \"notes\": {\n \"type\": \"string\",\n \"description\": \"Notes for the tag.\"\n },\n \"score\": {\n \"type\": \"number\",\n \"description\": \"Score used to determine popularity. Negative values are more rare and positive values are more frequent. This score is also used to sort search results.\"\n }\n },\n \"additionalProperties\": false\n }\n }\n },\n \"anyOf\": [\n {\n \"required\": [\"format\"]\n },\n {\n \"required\": [\"version\"]\n }\n ],\n \"dependencies\": {\n \"isUpdatable\": [\"indexUrl\", \"downloadUrl\"]\n }\n}\n","{\n \"$id\": \"dictionaryKanjiBankV1\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"array\",\n \"description\": \"Data file containing kanji information.\",\n \"items\": {\n \"type\": \"array\",\n \"description\": \"Information about a single kanji character.\",\n \"minItems\": 4,\n \"maxItems\": 4,\n \"items\": [\n {\n \"type\": \"string\",\n \"description\": \"Kanji character.\",\n \"minLength\": 1\n },\n {\n \"type\": \"string\",\n \"description\": \"String of space-separated onyomi readings for the kanji character. An empty string is treated as no readings.\"\n },\n {\n \"type\": \"string\",\n \"description\": \"String of space-separated kunyomi readings for the kanji character. An empty string is treated as no readings.\"\n },\n {\n \"type\": \"string\",\n \"description\": \"String of space-separated tags for the kanji character. An empty string is treated as no tags.\"\n }\n ],\n \"additionalItems\": {\n \"type\": \"string\",\n \"description\": \"A meaning for the kanji character.\"\n }\n }\n}\n","{\n \"$id\": \"dictionaryKanjiBankV3\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"array\",\n \"description\": \"Data file containing kanji information.\",\n \"items\": {\n \"type\": \"array\",\n \"description\": \"Information about a single kanji character.\",\n \"minItems\": 6,\n \"maxItems\": 6,\n \"additionalItems\": false,\n \"items\": [\n {\n \"type\": \"string\",\n \"description\": \"Kanji character.\",\n \"minLength\": 1\n },\n {\n \"type\": \"string\",\n \"description\": \"String of space-separated onyomi readings for the kanji character. An empty string is treated as no readings.\"\n },\n {\n \"type\": \"string\",\n \"description\": \"String of space-separated kunyomi readings for the kanji character. An empty string is treated as no readings.\"\n },\n {\n \"type\": \"string\",\n \"description\": \"String of space-separated tags for the kanji character. An empty string is treated as no tags.\"\n },\n {\n \"type\": \"array\",\n \"description\": \"Array of meanings for the kanji character.\",\n \"items\": {\n \"type\": \"string\",\n \"description\": \"A meaning for the kanji character.\"\n }\n },\n {\n \"type\": \"object\",\n \"description\": \"Various stats for the kanji character.\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n }\n ]\n }\n}\n","{\n \"$id\": \"dictionaryKanjiMetaBankV3\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"definitions\": {\n \"frequency\": {\n \"oneOf\": [\n {\n \"type\": [\"string\", \"number\"]\n },\n {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\n \"value\"\n ],\n \"properties\": {\n \"value\": {\n \"type\": \"number\"\n },\n \"displayValue\": {\n \"type\": \"string\"\n }\n }\n }\n ]\n }\n },\n \"type\": \"array\",\n \"description\": \"Custom metadata for kanji characters.\",\n \"items\": {\n \"type\": \"array\",\n \"description\": \"Metadata about a single kanji character.\",\n \"minItems\": 3,\n \"maxItems\": 3,\n \"additionalItems\": false,\n \"items\": [\n {\n \"type\": \"string\",\n \"minLength\": 1\n },\n {\n \"type\": \"string\",\n \"const\": \"freq\",\n \"description\": \"Type of data. \\\"freq\\\" corresponds to frequency information.\"\n },\n {\n \"$ref\": \"#/definitions/frequency\",\n \"description\": \"Data for the character.\"\n }\n ]\n }\n}\n","{\n \"$id\": \"dictionaryTagBankV3\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"array\",\n \"description\": \"Data file containing tag information for terms and kanji.\",\n \"items\": {\n \"type\": \"array\",\n \"description\": \"Information about a single tag.\",\n \"minItems\": 5,\n \"maxItems\": 5,\n \"additionalItems\": false,\n \"items\": [\n {\n \"type\": \"string\",\n \"description\": \"Tag name.\"\n },\n {\n \"type\": \"string\",\n \"description\": \"Category for the tag.\"\n },\n {\n \"type\": \"number\",\n \"description\": \"Sorting order for the tag.\"\n },\n {\n \"type\": \"string\",\n \"description\": \"Notes for the tag.\"\n },\n {\n \"type\": \"number\",\n \"description\": \"Score used to determine popularity. Negative values are more rare and positive values are more frequent. This score is also used to sort search results.\"\n }\n ]\n }\n}\n","{\n \"$id\": \"dictionaryTermBankV1\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"type\": \"array\",\n \"description\": \"Data file containing term information.\",\n \"items\": {\n \"type\": \"array\",\n \"description\": \"Information about a single term.\",\n \"minItems\": 5,\n \"maxItems\": 5,\n \"items\": [\n {\n \"type\": \"string\",\n \"description\": \"The text for the term.\"\n },\n {\n \"type\": \"string\",\n \"description\": \"Reading of the term, or an empty string if the reading is the same as the term.\"\n },\n {\n \"type\": [\"string\", \"null\"],\n \"description\": \"String of space-separated tags for the definition. An empty string is treated as no tags.\"\n },\n {\n \"type\": \"string\",\n \"description\": \"String of space-separated rule identifiers for the definition which is used to validate delinflection. Valid rule identifiers are: v1: ichidan verb; v5: godan verb; vs: suru verb; vz: zuru verb; vk: kuru verb; adj-i: i-adjective. An empty string corresponds to words which aren't inflected, such as nouns.\"\n },\n {\n \"type\": \"number\",\n \"description\": \"Score used to determine popularity. Negative values are more rare and positive values are more frequent. This score is also used to sort search results.\"\n }\n ],\n \"additionalItems\": {\n \"type\": \"string\",\n \"description\": \"Single definition for the term.\"\n }\n }\n}\n","{\n \"$id\": \"dictionaryTermBankV3\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"definitions\": {\n \"structuredContent\": {\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"description\": \"Represents a text node.\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/definitions/structuredContent\",\n \"description\": \"An array of child content.\"\n }\n },\n {\n \"type\": \"object\",\n \"oneOf\": [\n {\n \"type\": \"object\",\n \"description\": \"Empty tags.\",\n \"required\": [\n \"tag\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"tag\": {\n \"type\": \"string\",\n \"const\": \"br\"\n },\n \"data\": {\n \"$ref\": \"#/definitions/structuredContentData\"\n }\n }\n },\n {\n \"type\": \"object\",\n \"description\": \"Generic container tags.\",\n \"required\": [\n \"tag\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"tag\": {\n \"type\": \"string\",\n \"enum\": [\"ruby\", \"rt\", \"rp\", \"table\", \"thead\", \"tbody\", \"tfoot\", \"tr\"]\n },\n \"content\": {\n \"$ref\": \"#/definitions/structuredContent\"\n },\n \"data\": {\n \"$ref\": \"#/definitions/structuredContentData\"\n },\n \"lang\": {\n \"type\": \"string\",\n \"description\": \"Defines the language of an element in the format defined by RFC 5646.\"\n }\n }\n },\n {\n \"type\": \"object\",\n \"description\": \"Table tags.\",\n \"required\": [\n \"tag\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"tag\": {\n \"type\": \"string\",\n \"enum\": [\"td\", \"th\"]\n },\n \"content\": {\n \"$ref\": \"#/definitions/structuredContent\"\n },\n \"data\": {\n \"$ref\": \"#/definitions/structuredContentData\"\n },\n \"colSpan\": {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n \"rowSpan\": {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n \"style\": {\n \"$ref\": \"#/definitions/structuredContentStyle\"\n },\n \"lang\": {\n \"type\": \"string\",\n \"description\": \"Defines the language of an element in the format defined by RFC 5646.\"\n }\n }\n },\n {\n \"type\": \"object\",\n \"description\": \"Container tags supporting configurable styles.\",\n \"required\": [\n \"tag\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"tag\": {\n \"type\": \"string\",\n \"enum\": [\"span\", \"div\", \"ol\", \"ul\", \"li\", \"details\", \"summary\"]\n },\n \"content\": {\n \"$ref\": \"#/definitions/structuredContent\"\n },\n \"data\": {\n \"$ref\": \"#/definitions/structuredContentData\"\n },\n \"style\": {\n \"$ref\": \"#/definitions/structuredContentStyle\"\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Hover text for the element.\"\n },\n \"open\": {\n \"type\": \"boolean\",\n \"description\": \"Whether or not the details element is open by default.\"\n },\n \"lang\": {\n \"type\": \"string\",\n \"description\": \"Defines the language of an element in the format defined by RFC 5646.\"\n }\n }\n },\n {\n \"type\": \"object\",\n \"description\": \"Image tag.\",\n \"required\": [\n \"tag\",\n \"path\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"tag\": {\n \"type\": \"string\",\n \"const\": \"img\"\n },\n \"data\": {\n \"$ref\": \"#/definitions/structuredContentData\"\n },\n \"path\": {\n \"type\": \"string\",\n \"description\": \"Path to the image file in the archive.\"\n },\n \"width\": {\n \"type\": \"number\",\n \"description\": \"Preferred width of the image.\",\n \"minimum\": 0\n },\n \"height\": {\n \"type\": \"number\",\n \"description\": \"Preferred height of the image.\",\n \"minimum\": 0\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Hover text for the image.\"\n },\n \"alt\": {\n \"type\": \"string\",\n \"description\": \"Alt text for the image.\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"Description of the image.\"\n },\n \"pixelated\": {\n \"type\": \"boolean\",\n \"description\": \"Whether or not the image should appear pixelated at sizes larger than the image's native resolution.\",\n \"default\": false\n },\n \"imageRendering\": {\n \"type\": \"string\",\n \"description\": \"Controls how the image is rendered. The value of this field supersedes the pixelated field.\",\n \"enum\": [\"auto\", \"pixelated\", \"crisp-edges\"],\n \"default\": \"auto\"\n },\n \"appearance\": {\n \"type\": \"string\",\n \"description\": \"Controls the appearance of the image. The \\\"monochrome\\\" value will mask the opaque parts of the image using the current text color.\",\n \"enum\": [\"auto\", \"monochrome\"],\n \"default\": \"auto\"\n },\n \"background\": {\n \"type\": \"boolean\",\n \"description\": \"Whether or not a background color is displayed behind the image.\",\n \"default\": true\n },\n \"collapsed\": {\n \"type\": \"boolean\",\n \"description\": \"Whether or not the image is collapsed by default.\",\n \"default\": false\n },\n \"collapsible\": {\n \"type\": \"boolean\",\n \"description\": \"Whether or not the image can be collapsed.\",\n \"default\": false\n },\n \"verticalAlign\": {\n \"type\": \"string\",\n \"description\": \"The vertical alignment of the image.\",\n \"enum\": [\"baseline\", \"sub\", \"super\", \"text-top\", \"text-bottom\", \"middle\", \"top\", \"bottom\"]\n },\n \"border\": {\n \"type\": \"string\",\n \"description\": \"Shorthand for border width, style, and color.\"\n },\n \"borderRadius\": {\n \"type\": \"string\",\n \"description\": \"Roundness of the corners of the image's outer border edge.\"\n },\n \"sizeUnits\": {\n \"type\": \"string\",\n \"description\": \"The units for the width and height.\",\n \"enum\": [\"px\", \"em\"]\n }\n }\n },\n {\n \"type\": \"object\",\n \"description\": \"Link tag.\",\n \"required\": [\n \"tag\",\n \"href\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"tag\": {\n \"type\": \"string\",\n \"const\": \"a\"\n },\n \"content\": {\n \"$ref\": \"#/definitions/structuredContent\"\n },\n \"href\": {\n \"type\": \"string\",\n \"description\": \"The URL for the link. URLs starting with a ? are treated as internal links to other dictionary content.\",\n \"pattern\": \"^(?:https?:|\\\\?)[\\\\w\\\\W]*\"\n },\n \"lang\": {\n \"type\": \"string\",\n \"description\": \"Defines the language of an element in the format defined by RFC 5646.\"\n }\n }\n }\n ]\n }\n ]\n },\n \"structuredContentData\": {\n \"type\": \"object\",\n \"description\": \"Generic data attributes that should be added to the element.\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n },\n \"structuredContentStyle\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"fontStyle\": {\n \"type\": \"string\",\n \"enum\": [\"normal\", \"italic\"],\n \"default\": \"normal\"\n },\n \"fontWeight\": {\n \"type\": \"string\",\n \"enum\": [\"normal\", \"bold\"],\n \"default\": \"normal\"\n },\n \"fontSize\": {\n \"type\": \"string\",\n \"default\": \"medium\"\n },\n \"color\": {\n \"type\": \"string\"\n },\n \"background\": {\n \"type\": \"string\"\n },\n \"backgroundColor\": {\n \"type\": \"string\"\n },\n \"textDecorationLine\": {\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"enum\": [\"none\", \"underline\", \"overline\", \"line-through\"],\n \"default\": \"none\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\",\n \"enum\": [\"underline\", \"overline\", \"line-through\"],\n \"default\": \"none\"\n }\n }\n ]\n },\n \"textDecorationStyle\": {\n \"type\": \"string\",\n \"enum\": [\"solid\", \"double\", \"dotted\", \"dashed\", \"wavy\"],\n \"default\": \"solid\"\n },\n \"textDecorationColor\": {\n \"type\": \"string\"\n },\n \"borderColor\": {\n \"type\": \"string\"\n },\n \"borderStyle\": {\n \"type\": \"string\"\n },\n \"borderRadius\": {\n \"type\": \"string\"\n },\n \"borderWidth\": {\n \"type\": \"string\"\n },\n \"clipPath\": {\n \"type\": \"string\"\n },\n \"verticalAlign\": {\n \"type\": \"string\",\n \"enum\": [\"baseline\", \"sub\", \"super\", \"text-top\", \"text-bottom\", \"middle\", \"top\", \"bottom\"],\n \"default\": \"baseline\"\n },\n \"textAlign\": {\n \"type\": \"string\",\n \"enum\": [\"start\", \"end\", \"left\", \"right\", \"center\", \"justify\", \"justify-all\", \"match-parent\"],\n \"default\": \"start\"\n },\n \"textEmphasis\": {\n \"type\": \"string\"\n },\n \"textShadow\": {\n \"type\": \"string\"\n },\n \"margin\": {\n \"type\": \"string\"\n },\n \"marginTop\": {\n \"type\": [\"number\", \"string\"],\n \"default\": 0\n },\n \"marginLeft\": {\n \"type\": [\"number\", \"string\"],\n \"default\": 0\n },\n \"marginRight\": {\n \"type\": [\"number\", \"string\"],\n \"default\": 0\n },\n \"marginBottom\": {\n \"type\": [\"number\", \"string\"],\n \"default\": 0\n },\n \"padding\": {\n \"type\": \"string\"\n },\n \"paddingTop\": {\n \"type\": \"string\"\n },\n \"paddingLeft\": {\n \"type\": \"string\"\n },\n \"paddingRight\": {\n \"type\": \"string\"\n },\n \"paddingBottom\": {\n \"type\": \"string\"\n },\n \"wordBreak\": {\n \"type\": \"string\",\n \"enum\": [\"normal\", \"break-all\", \"keep-all\"],\n \"default\": \"normal\"\n },\n \"whiteSpace\": {\n \"type\": \"string\",\n \"default\": \"normal\"\n },\n \"cursor\": {\n \"type\": \"string\",\n \"default\": \"auto\"\n },\n \"listStyleType\": {\n \"type\": \"string\",\n \"default\": \"disc\"\n }\n }\n }\n },\n \"type\": \"array\",\n \"description\": \"Data file containing term information.\",\n \"items\": {\n \"type\": \"array\",\n \"description\": \"Information about a single term.\",\n \"minItems\": 8,\n \"maxItems\": 8,\n \"additionalItems\": false,\n \"items\": [\n {\n \"type\": \"string\",\n \"description\": \"The text for the term.\"\n },\n {\n \"type\": \"string\",\n \"description\": \"Reading of the term, or an empty string if the reading is the same as the term.\"\n },\n {\n \"type\": [\"string\", \"null\"],\n \"description\": \"String of space-separated tags for the definition. An empty string is treated as no tags.\"\n },\n {\n \"type\": \"string\",\n \"description\": \"String of space-separated rule identifiers for the definition which is used to validate deinflection. An empty string should be used for words which aren't inflected.\"\n },\n {\n \"type\": \"number\",\n \"description\": \"Score used to determine popularity. Negative values are more rare and positive values are more frequent. This score is also used to sort search results.\"\n },\n {\n \"type\": \"array\",\n \"description\": \"Array of definitions for the term.\",\n \"items\": {\n \"oneOf\": [\n {\n \"type\": \"string\",\n \"description\": \"Single definition for the term.\"\n },\n {\n \"type\": \"object\",\n \"description\": \"Single detailed definition for the term.\",\n \"required\": [\n \"type\"\n ],\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"description\": \"The type of the data for this definition.\",\n \"enum\": [\"text\", \"image\", \"structured-content\"]\n }\n },\n \"oneOf\": [\n {\n \"required\": [\n \"type\",\n \"text\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"const\": \"text\"\n },\n \"text\": {\n \"type\": \"string\",\n \"description\": \"Single definition for the term.\"\n }\n }\n },\n {\n \"required\": [\n \"type\",\n \"content\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"const\": \"structured-content\"\n },\n \"content\": {\n \"$ref\": \"#/definitions/structuredContent\",\n \"description\": \"Single definition for the term using a structured content object.\"\n }\n }\n },\n {\n \"required\": [\n \"type\",\n \"path\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"const\": \"image\"\n },\n \"path\": {\n \"type\": \"string\",\n \"description\": \"Path to the image file in the archive.\"\n },\n \"width\": {\n \"type\": \"integer\",\n \"description\": \"Preferred width of the image.\",\n \"minimum\": 1\n },\n \"height\": {\n \"type\": \"integer\",\n \"description\": \"Preferred height of the image.\",\n \"minimum\": 1\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Hover text for the image.\"\n },\n \"alt\": {\n \"type\": \"string\",\n \"description\": \"Alt text for the image.\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"Description of the image.\"\n },\n \"pixelated\": {\n \"type\": \"boolean\",\n \"description\": \"Whether or not the image should appear pixelated at sizes larger than the image's native resolution.\",\n \"default\": false\n },\n \"imageRendering\": {\n \"type\": \"string\",\n \"description\": \"Controls how the image is rendered. The value of this field supersedes the pixelated field.\",\n \"enum\": [\"auto\", \"pixelated\", \"crisp-edges\"],\n \"default\": \"auto\"\n },\n \"appearance\": {\n \"type\": \"string\",\n \"description\": \"Controls the appearance of the image. The \\\"monochrome\\\" value will mask the opaque parts of the image using the current text color.\",\n \"enum\": [\"auto\", \"monochrome\"],\n \"default\": \"auto\"\n },\n \"background\": {\n \"type\": \"boolean\",\n \"description\": \"Whether or not a background color is displayed behind the image.\",\n \"default\": true\n },\n \"collapsed\": {\n \"type\": \"boolean\",\n \"description\": \"Whether or not the image is collapsed by default.\",\n \"default\": false\n },\n \"collapsible\": {\n \"type\": \"boolean\",\n \"description\": \"Whether or not the image can be collapsed.\",\n \"default\": true\n }\n }\n }\n ]\n },\n {\n \"type\": \"array\",\n \"description\": \"Deinflection of the term to an uninflected term.\",\n \"minItems\": 2,\n \"maxItems\": 2,\n \"items\": [\n {\n \"type\": \"string\",\n \"description\": \"The uninflected term.\"\n },\n {\n \"type\": \"array\",\n \"description\": \"A chain of inflection rules that produced the inflected term\",\n \"items\": {\n \"type\": \"string\",\n \"description\": \"A single inflection rule.\"\n }\n }\n ]\n }\n ]\n }\n },\n {\n \"type\": \"integer\",\n \"description\": \"Sequence number for the term. Terms with the same sequence number can be shown together when the \\\"resultOutputMode\\\" option is set to \\\"merge\\\".\"\n },\n {\n \"type\": \"string\",\n \"description\": \"String of space-separated tags for the term. An empty string is treated as no tags.\"\n }\n ]\n }\n}\n","{\n \"$id\": \"dictionaryTermMetaBankV3\",\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"definitions\": {\n \"frequency\": {\n \"oneOf\": [\n {\n \"type\": [\"string\", \"number\"]\n },\n {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\n \"value\"\n ],\n \"properties\": {\n \"value\": {\n \"type\": \"number\"\n },\n \"displayValue\": {\n \"type\": \"string\"\n }\n }\n }\n ]\n }\n },\n \"type\": \"array\",\n \"description\": \"Custom metadata for terms.\",\n \"items\": {\n \"type\": \"array\",\n \"description\": \"Metadata about a single term.\",\n \"minItems\": 3,\n \"maxItems\": 3,\n \"additionalItems\": false,\n \"items\": [\n {\n \"type\": \"string\",\n \"description\": \"The text for the term.\"\n },\n {\n \"type\": \"string\",\n \"enum\": [\"freq\", \"pitch\", \"ipa\"],\n \"description\": \"Type of data. \\\"freq\\\" corresponds to frequency information; \\\"pitch\\\" corresponds to pitch information. \\\"ipa\\\" corresponds to IPA transcription.\"\n },\n {\n \"description\": \"Data for the term.\"\n }\n ],\n \"oneOf\": [\n {\n \"minItems\": 3,\n \"maxItems\": 3,\n \"items\": [\n {},\n {\"const\": \"freq\"},\n {\n \"oneOf\": [\n {\n \"$ref\": \"#/definitions/frequency\",\n \"description\": \"Frequency information for the term.\"\n },\n {\n \"type\": \"object\",\n \"required\": [\n \"reading\",\n \"frequency\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"reading\": {\n \"type\": \"string\",\n \"description\": \"Reading for the term.\"\n },\n \"frequency\": {\n \"$ref\": \"#/definitions/frequency\",\n \"description\": \"Frequency information for the term.\"\n }\n }\n }\n ]\n }\n ]\n },\n {\n \"minItems\": 3,\n \"maxItems\": 3,\n \"items\": [\n {},\n {\"const\": \"pitch\"},\n {\n \"type\": \"object\",\n \"description\": \"Pitch accent information for the term.\",\n \"required\": [\n \"reading\",\n \"pitches\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"reading\": {\n \"type\": \"string\",\n \"description\": \"Reading for the term.\"\n },\n \"pitches\": {\n \"type\": \"array\",\n \"description\": \"List of different pitch accent information for the term and reading combination.\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"position\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"position\": {\n \"oneOf\": [\n {\n \"type\": \"integer\",\n \"description\": \"Mora position of the pitch accent downstep. A value of 0 indicates that the word does not have a downstep (heiban).\",\n \"minimum\": 0\n },\n {\n \"type\": \"string\",\n \"description\": \"Pitch level of each mora with H representing high and L representing low. For example: HHLL for a 4 mora word.\",\n \"pattern\": \"^[HL]+$\"\n }\n ]\n },\n \"nasal\": {\n \"oneOf\": [\n {\n \"type\": \"integer\",\n \"description\": \"Position of a mora with nasal sound.\",\n \"minimum\": 0\n },\n {\n \"type\": \"array\",\n \"description\": \"Positions of morae with nasal sound.\",\n \"items\": {\n \"type\": \"integer\",\n \"minimum\": 0\n }\n }\n ]\n },\n \"devoice\": {\n \"oneOf\": [\n {\n \"type\": \"integer\",\n \"description\": \"Position of a mora with devoiced sound.\",\n \"minimum\": 0\n },\n {\n \"type\": \"array\",\n \"description\": \"Positions of morae with devoiced sound.\",\n \"items\": {\n \"type\": \"integer\",\n \"minimum\": 0\n }\n }\n ]\n },\n \"tags\": {\n \"type\": \"array\",\n \"description\": \"List of tags for this pitch accent.\",\n \"items\": {\n \"type\": \"string\",\n \"description\": \"Tag for this pitch accent. This typically corresponds to a certain type of part of speech.\"\n }\n }\n }\n }\n }\n }\n }\n ]\n },\n {\n \"minItems\": 3,\n \"maxItems\": 3,\n \"items\": [\n {},\n {\"const\": \"ipa\"},\n {\n \"type\": [\"object\"],\n \"description\": \"IPA transcription information for the term.\",\n \"required\": [\n \"reading\",\n \"transcriptions\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"reading\": {\n \"type\": \"string\",\n \"description\": \"Reading for the term.\"\n },\n \"transcriptions\": {\n \"type\": \"array\",\n \"description\": \"List of different IPA transcription information for the term and reading combination.\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"ipa\"\n ],\n \"additionalProperties\": false,\n \"properties\": {\n \"ipa\": {\n \"type\": \"string\",\n \"description\": \"IPA transcription for the term.\"\n },\n \"tags\": {\n \"type\": \"array\",\n \"description\": \"List of tags for this IPA transcription.\",\n \"items\": {\n \"type\": \"string\",\n \"description\": \"Tag for this IPA transcription.\"\n }\n }\n }\n }\n }\n }\n }\n ]\n }\n ]\n }\n}\n","import Ajv from 'ajv';\nimport type { CompiledSchemaValidators } from '../types/dictionary-importer';\n\nimport dictionaryIndexSchema from './schemas/dictionary-index-schema.json';\nimport dictionaryKanjiBankV1Schema from './schemas/dictionary-kanji-bank-v1-schema.json';\nimport dictionaryKanjiBankV3Schema from './schemas/dictionary-kanji-bank-v3-schema.json';\nimport dictionaryKanjiMetaBankV3Schema from './schemas/dictionary-kanji-meta-bank-v3-schema.json';\nimport dictionaryTagBankV3Schema from './schemas/dictionary-tag-bank-v3-schema.json';\nimport dictionaryTermBankV1Schema from './schemas/dictionary-term-bank-v1-schema.json';\nimport dictionaryTermBankV3Schema from './schemas/dictionary-term-bank-v3-schema.json';\nimport dictionaryTermMetaBankV3Schema from './schemas/dictionary-term-meta-bank-v3-schema.json';\n\nlet _validators: CompiledSchemaValidators | null = null;\n\n/**\n * Returns compiled AJV schema validators for all dictionary data bank types.\n * Validators are compiled once on first call and cached for subsequent calls.\n */\nexport function getSchemaValidators(): CompiledSchemaValidators {\n if (_validators !== null) {\n return _validators;\n }\n\n const ajv = new Ajv({\n allowUnionTypes: true,\n });\n\n _validators = {\n dictionaryIndex: ajv.compile(dictionaryIndexSchema),\n dictionaryTermBankV1: ajv.compile(dictionaryTermBankV1Schema),\n dictionaryTermBankV3: ajv.compile(dictionaryTermBankV3Schema),\n dictionaryTermMetaBankV3: ajv.compile(dictionaryTermMetaBankV3Schema),\n dictionaryKanjiBankV1: ajv.compile(dictionaryKanjiBankV1Schema),\n dictionaryKanjiBankV3: ajv.compile(dictionaryKanjiBankV3Schema),\n dictionaryKanjiMetaBankV3: ajv.compile(dictionaryKanjiMetaBankV3Schema),\n dictionaryTagBankV3: ajv.compile(dictionaryTagBankV3Schema),\n };\n\n return _validators;\n}\n","import { BlobWriter, TextWriter, Uint8ArrayReader, ZipReader } from '@zip.js/zip.js';\nimport type { Entry, WritableWriter, Writer } from '@zip.js/zip.js';\nimport type { DictionaryDB } from '../database/dictionary-database';\nimport type * as DictionaryData from '../types/dictionary-data';\nimport type * as DictionaryDatabase from '../types/dictionary-database';\nimport type * as DictionaryImporter from '../types/dictionary-importer';\nimport type * as StructuredContent from '../types/structured-content';\nimport { compareRevisions } from '../util/dictionary-data-util';\nimport { YomitanError, toError } from '../util/errors';\nimport { parseJson } from '../util/json';\nimport { getFileExtensionFromImageMediaType, getImageMediaTypeFromFileName } from '../util/media-util';\nimport { stringReverse } from '../util/utilities';\nimport type { MediaLoader } from './media-loader';\nimport { NoOpMediaLoader } from './media-loader';\nimport { getSchemaValidators } from './schema-validators';\n\nconst INDEX_FILE_NAME = 'index.json';\n\nexport class DictionaryImporterClass {\n private _mediaLoader: MediaLoader;\n private _onProgress: DictionaryImporter.OnProgressCallback;\n private _progressData: DictionaryImporter.ProgressData;\n\n constructor(mediaLoader?: MediaLoader, onProgress?: DictionaryImporter.OnProgressCallback) {\n this._mediaLoader = mediaLoader ?? new NoOpMediaLoader();\n this._onProgress = typeof onProgress === 'function' ? onProgress : () => {};\n this._progressData = this._createProgressData();\n }\n\n async importDictionary(\n dictionaryDatabase: DictionaryDB,\n archiveContent: ArrayBuffer,\n details: DictionaryImporter.ImportDetails,\n ): Promise<DictionaryImporter.ImportResult> {\n if (!dictionaryDatabase) {\n throw new Error('Invalid database');\n }\n if (!dictionaryDatabase.isOpen) {\n throw new Error('Database is not ready');\n }\n\n const errors: Error[] = [];\n const maxTransactionLength = 1000;\n const bulkAddProgressAllowance = 1000;\n\n const bulkAdd = async (\n objectStoreName: DictionaryDatabase.ObjectStoreName,\n entries: unknown[],\n ): Promise<void> => {\n const entryCount = entries.length;\n\n let progressIndexIncrease = bulkAddProgressAllowance / Math.ceil(entryCount / maxTransactionLength);\n if (entryCount < maxTransactionLength) {\n progressIndexIncrease = bulkAddProgressAllowance;\n }\n if (entryCount === 0) {\n this._progressData.index += progressIndexIncrease;\n }\n\n for (let i = 0; i < entryCount; i += maxTransactionLength) {\n const count = Math.min(maxTransactionLength, entryCount - i);\n\n try {\n await dictionaryDatabase.bulkAdd(objectStoreName, entries, i, count);\n } catch (e) {\n errors.push(toError(e));\n }\n\n this._progressData.index += progressIndexIncrease;\n this._progress();\n }\n };\n\n this._progressReset();\n\n // Read archive\n const fileMap = await this._getFilesFromArchive(archiveContent);\n const index = await this._readAndValidateIndex(fileMap);\n\n const dictionaryTitle = index.title;\n const version = (\n typeof index.format === 'number' ? index.format : index.version\n ) as DictionaryData.IndexVersion;\n\n // Verify database is not already imported\n if (await dictionaryDatabase.dictionaryExists(dictionaryTitle)) {\n return {\n errors: [new Error(`Dictionary ${dictionaryTitle} is already imported, skipped it.`)],\n result: null,\n };\n }\n\n // Load schemas\n this._progressNextStep(0);\n const dataBankSchemas = this._getDataBankSchemas(version);\n\n // Files\n const queryDetails: DictionaryImporter.QueryDetails = [\n ['termFiles', /^term_bank_(\\d+)\\.json$/],\n ['termMetaFiles', /^term_meta_bank_(\\d+)\\.json$/],\n ['kanjiFiles', /^kanji_bank_(\\d+)\\.json$/],\n ['kanjiMetaFiles', /^kanji_meta_bank_(\\d+)\\.json$/],\n ['tagFiles', /^tag_bank_(\\d+)\\.json$/],\n ];\n const archiveFiles = Object.fromEntries(this._getArchiveFiles(fileMap, queryDetails));\n const termFiles = archiveFiles.termFiles as Entry[];\n const termMetaFiles = archiveFiles.termMetaFiles as Entry[];\n const kanjiFiles = archiveFiles.kanjiFiles as Entry[];\n const kanjiMetaFiles = archiveFiles.kanjiMetaFiles as Entry[];\n const tagFiles = archiveFiles.tagFiles as Entry[];\n\n // Load data\n const prefixWildcardsSupported = !!details.prefixWildcardsSupported;\n\n this._progressNextStep(\n termFiles.length + termMetaFiles.length + kanjiFiles.length + kanjiMetaFiles.length + tagFiles.length,\n );\n\n for (const termFile of termFiles) {\n await this._validateFile(termFile, dataBankSchemas[0]);\n }\n for (const termMetaFile of termMetaFiles) {\n await this._validateFile(termMetaFile, dataBankSchemas[1]);\n }\n for (const kanjiFile of kanjiFiles) {\n await this._validateFile(kanjiFile, dataBankSchemas[2]);\n }\n for (const kanjiMetaFile of kanjiMetaFiles) {\n await this._validateFile(kanjiMetaFile, dataBankSchemas[3]);\n }\n for (const tagFile of tagFiles) {\n await this._validateFile(tagFile, dataBankSchemas[4]);\n }\n\n // termFiles is doubled due to media importing\n this._progressNextStep(\n (termFiles.length * 2 +\n termMetaFiles.length +\n kanjiFiles.length +\n kanjiMetaFiles.length +\n tagFiles.length) *\n bulkAddProgressAllowance,\n );\n\n let importSuccess = false;\n\n const counts: DictionaryImporter.SummaryCounts = {\n terms: { total: 0 },\n termMeta: { total: 0 },\n kanji: { total: 0 },\n kanjiMeta: { total: 0 },\n tagMeta: { total: 0 },\n media: { total: 0 },\n };\n\n const yomitanVersion = details.yomitanVersion;\n let summaryDetails: DictionaryImporter.SummaryDetails = {\n prefixWildcardsSupported,\n counts,\n styles: '',\n yomitanVersion,\n importSuccess,\n };\n\n let summary = this._createSummary(dictionaryTitle, version, index, summaryDetails);\n const primaryKey = await dictionaryDatabase.addWithResult('dictionaries', summary);\n\n try {\n const uniqueMediaPaths = new Set<string>();\n for (const termFile of termFiles) {\n const requirements: DictionaryImporter.ImportRequirement[] = [];\n let termList = await (version === 1\n ? this._readFileSequence<DictionaryData.TermV1, DictionaryDatabase.DatabaseTermEntry>(\n [termFile],\n this._convertTermBankEntryV1.bind(this),\n dictionaryTitle,\n )\n : this._readFileSequence<DictionaryData.TermV3, DictionaryDatabase.DatabaseTermEntry>(\n [termFile],\n this._convertTermBankEntryV3.bind(this),\n dictionaryTitle,\n ));\n\n // Prefix wildcard support\n if (prefixWildcardsSupported) {\n for (const entry of termList) {\n entry.expressionReverse = stringReverse(entry.expression);\n entry.readingReverse = stringReverse(entry.reading);\n }\n }\n\n // Extended data support\n for (let i = 0, ii = termList.length; i < ii; ++i) {\n const entry = termList[i];\n const glossaryList = entry.glossary;\n for (let j = 0, jj = glossaryList.length; j < jj; ++j) {\n const glossary = glossaryList[j];\n if (typeof glossary !== 'object' || glossary === null || Array.isArray(glossary)) {\n continue;\n }\n glossaryList[j] = this._formatDictionaryTermGlossaryObject(\n glossary as\n | DictionaryData.TermGlossaryText\n | DictionaryData.TermGlossaryImage\n | DictionaryData.TermGlossaryStructuredContent,\n entry,\n requirements,\n );\n }\n }\n\n const alreadyAddedRequirements = requirements.filter((x) => {\n return uniqueMediaPaths.has(x.source.path);\n });\n const notAddedRequirements = requirements.filter((x) => {\n return !uniqueMediaPaths.has(x.source.path);\n });\n for (const requirement of requirements) {\n uniqueMediaPaths.add(requirement.source.path);\n }\n\n await this._resolveAsyncRequirements(alreadyAddedRequirements, fileMap); // already added must also be resolved for the term dict to have correct data\n let { media } = await this._resolveAsyncRequirements(notAddedRequirements, fileMap);\n await bulkAdd('media', media);\n counts.media.total += media.length;\n\n this._progress();\n\n await bulkAdd('terms', termList);\n counts.terms.total += termList.length;\n\n this._progress();\n\n termList = [];\n media = [];\n }\n\n for (const termMetaFile of termMetaFiles) {\n let termMetaList = await this._readFileSequence<\n DictionaryData.TermMeta,\n DictionaryDatabase.DatabaseTermMeta\n >([termMetaFile], this._convertTermMetaBankEntry.bind(this), dictionaryTitle);\n\n await bulkAdd('termMeta', termMetaList);\n for (const [key, value] of Object.entries(this._getMetaCounts(termMetaList))) {\n if (key in counts.termMeta) {\n counts.termMeta[key] += value;\n } else {\n counts.termMeta[key] = value;\n }\n }\n\n this._progress();\n\n termMetaList = [];\n }\n\n for (const kanjiFile of kanjiFiles) {\n let kanjiList = await (version === 1\n ? this._readFileSequence<DictionaryData.KanjiV1, DictionaryDatabase.DatabaseKanjiEntry>(\n [kanjiFile],\n this._convertKanjiBankEntryV1.bind(this),\n dictionaryTitle,\n )\n : this._readFileSequence<DictionaryData.KanjiV3, DictionaryDatabase.DatabaseKanjiEntry>(\n [kanjiFile],\n this._convertKanjiBankEntryV3.bind(this),\n dictionaryTitle,\n ));\n\n await bulkAdd('kanji', kanjiList);\n counts.kanji.total += kanjiList.length;\n\n this._progress();\n\n kanjiList = [];\n }\n\n for (const kanjiMetaFile of kanjiMetaFiles) {\n let kanjiMetaList = await this._readFileSequence<\n DictionaryData.KanjiMeta,\n DictionaryDatabase.DatabaseKanjiMeta\n >([kanjiMetaFile], this._convertKanjiMetaBankEntry.bind(this), dictionaryTitle);\n\n await bulkAdd('kanjiMeta', kanjiMetaList);\n for (const [key, value] of Object.entries(this._getMetaCounts(kanjiMetaList))) {\n if (key in counts.kanjiMeta) {\n counts.kanjiMeta[key] += value;\n } else {\n counts.kanjiMeta[key] = value;\n }\n }\n\n this._progress();\n\n kanjiMetaList = [];\n }\n\n for (const tagFile of tagFiles) {\n let tagList = await this._readFileSequence<DictionaryData.Tag, DictionaryDatabase.Tag>(\n [tagFile],\n this._convertTagBankEntry.bind(this),\n dictionaryTitle,\n );\n this._addOldIndexTags(index, tagList, dictionaryTitle);\n\n await bulkAdd('tagMeta', tagList);\n counts.tagMeta.total += tagList.length;\n\n this._progress();\n\n tagList = [];\n }\n\n importSuccess = true;\n } catch (e) {\n errors.push(toError(e));\n }\n\n // Update dictionary descriptor\n this._progressNextStep(0);\n\n const stylesFileName = 'styles.css';\n const stylesFile = fileMap.get(stylesFileName);\n let styles = '';\n if (typeof stylesFile !== 'undefined') {\n styles = await this._getData(stylesFile as Entry, new TextWriter());\n const cssErrors = this._validateCss(styles);\n if (cssErrors.length > 0) {\n return {\n errors: cssErrors,\n result: null,\n };\n }\n }\n\n summaryDetails = { prefixWildcardsSupported, counts, styles, yomitanVersion, importSuccess };\n summary = this._createSummary(dictionaryTitle, version, index, summaryDetails);\n await dictionaryDatabase.bulkUpdate('dictionaries', [{ data: summary, primaryKey }], 0, 1);\n\n this._progress();\n\n return { result: summary, errors };\n }\n\n // Archive reading\n\n private async _getFilesFromArchive(archiveContent: ArrayBuffer): Promise<DictionaryImporter.ArchiveFileMap> {\n const zipFileReader = new Uint8ArrayReader(new Uint8Array(archiveContent));\n const zipReader = new ZipReader(zipFileReader, { useWebWorkers: false });\n const zipEntries = await zipReader.getEntries();\n const fileMap: DictionaryImporter.ArchiveFileMap = new Map();\n for (const entry of zipEntries) {\n fileMap.set(entry.filename, entry);\n }\n return fileMap;\n }\n\n private _findRedundantDirectories(fileMap: DictionaryImporter.ArchiveFileMap): string | null {\n let indexPath = '';\n for (const file of fileMap) {\n if (file[0].replace(/.*\\//, '') === INDEX_FILE_NAME) {\n indexPath = file[0];\n }\n }\n const redundantDirectoriesRegex = new RegExp(`.*(?=${INDEX_FILE_NAME.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')})`);\n const redundantDirectories = indexPath.match(redundantDirectoriesRegex);\n return redundantDirectories ? redundantDirectories[0] : null;\n }\n\n private async _readAndValidateIndex(fileMap: DictionaryImporter.ArchiveFileMap): Promise<DictionaryData.Index> {\n const indexFile = fileMap.get(INDEX_FILE_NAME);\n if (typeof indexFile === 'undefined') {\n const redundantDirectories = this._findRedundantDirectories(fileMap);\n if (redundantDirectories) {\n throw new Error(\n `Dictionary index found nested in redundant directories: \"${redundantDirectories}\" when it must be in the archive\\'s root directory`,\n );\n }\n throw new Error('No dictionary index found in archive');\n }\n\n const indexContent = await this._getData(indexFile as Entry, new TextWriter());\n const index: unknown = parseJson(indexContent);\n\n const ajvSchemas = getSchemaValidators();\n if (!ajvSchemas.dictionaryIndex(index)) {\n throw this._formatAjvSchemaError(ajvSchemas.dictionaryIndex, INDEX_FILE_NAME);\n }\n\n const validIndex = index as DictionaryData.Index;\n\n const version = typeof validIndex.format === 'number' ? validIndex.format : validIndex.version;\n validIndex.version = version;\n\n const { title, revision } = validIndex;\n if (typeof version !== 'number' || !title || !revision) {\n throw new Error('Unrecognized dictionary format');\n }\n\n return validIndex;\n }\n\n // Progress tracking\n\n private _createProgressData(): DictionaryImporter.ProgressData {\n return {\n index: 0,\n count: 0,\n };\n }\n\n private _progressReset(): void {\n this._progressData = this._createProgressData();\n this._progress(true);\n }\n\n private _progressNextStep(count: number): void {\n this._progressData.index = 0;\n this._progressData.count = count;\n this._progress(true);\n }\n\n private _progress(nextStep = false): void {\n this._onProgress({ ...this._progressData, nextStep });\n }\n\n // Summary creation\n\n private _createSummary(\n dictionaryTitle: string,\n version: number,\n index: DictionaryData.Index,\n details: DictionaryImporter.SummaryDetails,\n ): DictionaryImporter.Summary {\n const indexSequenced = index.sequenced;\n const { prefixWildcardsSupported, counts, styles, importSuccess } = details;\n const summary: DictionaryImporter.Summary = {\n title: dictionaryTitle,\n revision: index.revision,\n sequenced: typeof indexSequenced === 'boolean' && indexSequenced,\n version,\n importDate: Date.now(),\n prefixWildcardsSupported,\n counts,\n styles,\n importSuccess,\n };\n\n const {\n minimumYomitanVersion,\n author,\n url,\n description,\n attribution,\n frequencyMode,\n isUpdatable,\n sourceLanguage,\n targetLanguage,\n } = index;\n if (typeof minimumYomitanVersion === 'string') {\n if (details.yomitanVersion === '0.0.0.0') {\n // Running a development version\n } else if (compareRevisions(details.yomitanVersion, minimumYomitanVersion)) {\n throw new Error(\n `Dictionary is incompatible with this version of Yomitan (${details.yomitanVersion}; minimum required: ${minimumYomitanVersion})`,\n );\n }\n summary.minimumYomitanVersion = minimumYomitanVersion;\n }\n if (typeof author === 'string') {\n summary.author = author;\n }\n if (typeof url === 'string') {\n summary.url = url;\n }\n if (typeof description === 'string') {\n summary.description = description;\n }\n if (typeof attribution === 'string') {\n summary.attribution = attribution;\n }\n if (typeof frequencyMode === 'string') {\n summary.frequencyMode = frequencyMode;\n }\n if (typeof sourceLanguage === 'string') {\n summary.sourceLanguage = sourceLanguage;\n }\n if (typeof targetLanguage === 'string') {\n summary.targetLanguage = targetLanguage;\n }\n if (typeof isUpdatable === 'boolean') {\n const { indexUrl, downloadUrl } = index;\n if (!isUpdatable || !this._validateUrl(indexUrl) || !this._validateUrl(downloadUrl)) {\n throw new Error('Invalid index data for updatable dictionary');\n }\n summary.isUpdatable = isUpdatable;\n summary.indexUrl = indexUrl;\n summary.downloadUrl = downloadUrl;\n }\n return summary;\n }\n\n private _validateUrl(string: string | undefined): boolean {\n if (typeof string !== 'string') {\n return false;\n }\n let url;\n try {\n url = new URL(string);\n } catch (_) {\n return false;\n }\n return url.protocol === 'http:' || url.protocol === 'https:';\n }\n\n // Schema validation\n\n private _formatAjvSchemaError(schema: import('ajv').ValidateFunction, fileName: string): YomitanError {\n const e = new YomitanError(`Dictionary has invalid data in '${fileName}' '${JSON.stringify(schema.errors)}'`);\n e.data = schema.errors;\n return e;\n }\n\n private _getDataBankSchemas(version: number): DictionaryImporter.CompiledSchemaNameArray {\n const termBank: DictionaryImporter.CompiledSchemaName =\n version === 1 ? 'dictionaryTermBankV1' : 'dictionaryTermBankV3';\n const termMetaBank: DictionaryImporter.CompiledSchemaName = 'dictionaryTermMetaBankV3';\n const kanjiBank: DictionaryImporter.CompiledSchemaName =\n version === 1 ? 'dictionaryKanjiBankV1' : 'dictionaryKanjiBankV3';\n const kanjiMetaBank: DictionaryImporter.CompiledSchemaName = 'dictionaryKanjiMetaBankV3';\n const tagBank: DictionaryImporter.CompiledSchemaName = 'dictionaryTagBankV3';\n\n return [termBank, termMetaBank, kanjiBank, kanjiMetaBank, tagBank];\n }\n\n private _validateCss(css: string): Error[] {\n return css ? [] : [new Error('No styles found')];\n }\n\n // Term glossary formatting\n\n private _formatDictionaryTermGlossaryObject(\n data:\n | DictionaryData.TermGlossaryText\n | DictionaryData.TermGlossaryImage\n | DictionaryData.TermGlossaryStructuredContent,\n entry: DictionaryDatabase.DatabaseTermEntry,\n requirements: DictionaryImporter.ImportRequirement[],\n ): DictionaryData.TermGlossary {\n switch (data.type) {\n case 'text':\n return data.text;\n case 'image':\n return this._formatDictionaryTermGlossaryImage(data, entry, requirements);\n case 'structured-content':\n return this._formatStructuredContent(data, entry, requirements);\n default:\n throw new Error(`Unhandled data type: ${(data as { type: string }).type}`);\n }\n }\n\n private _formatDictionaryTermGlossaryImage(\n data: DictionaryData.TermGlossaryImage,\n entry: DictionaryDatabase.DatabaseTermEntry,\n requirements: DictionaryImporter.ImportRequirement[],\n ): DictionaryData.TermGlossaryImage {\n const target: DictionaryData.TermGlossaryImage = {\n type: 'image',\n path: '', // Will be populated during requirement resolution\n };\n requirements.push({ type: 'image', target, source: data, entry });\n return target;\n }\n\n private _formatStructuredContent(\n data: DictionaryData.TermGlossaryStructuredContent,\n entry: DictionaryDatabase.DatabaseTermEntry,\n requirements: DictionaryImporter.ImportRequirement[],\n ): DictionaryData.TermGlossaryStructuredContent {\n const content = this._prepareStructuredContent(data.content, entry, requirements);\n return {\n type: 'structured-content',\n content,\n };\n }\n\n private _prepareStructuredContent(\n content: StructuredContent.Content,\n entry: DictionaryDatabase.DatabaseTermEntry,\n requirements: DictionaryImporter.ImportRequirement[],\n ): StructuredContent.Content {\n if (typeof content === 'string' || !(typeof content === 'object' && content !== null)) {\n return content;\n }\n if (Array.isArray(content)) {\n for (let i = 0, ii = content.length; i < ii; ++i) {\n content[i] = this._prepareStructuredContent(content[i], entry, requirements);\n }\n return content;\n }\n const { tag } = content;\n switch (tag) {\n case 'img':\n return this._prepareStructuredContentImage(\n content as StructuredContent.ImageElement,\n entry,\n requirements,\n );\n }\n const childContent = content.content;\n if (typeof childContent !== 'undefined') {\n content.content = this._prepareStructuredContent(childContent, entry, requirements);\n }\n return content;\n }\n\n private _prepareStructuredContentImage(\n content: StructuredContent.ImageElement,\n entry: DictionaryDatabase.DatabaseTermEntry,\n requirements: DictionaryImporter.ImportRequirement[],\n ): StructuredContent.ImageElement {\n const target: StructuredContent.ImageElement = {\n tag: 'img',\n path: '', // Will be populated during requirement resolution\n };\n requirements.push({ type: 'structured-content-image', target, source: content, entry });\n return target;\n }\n\n // Async requirement resolution\n\n private async _resolveAsyncRequirements(\n requirements: DictionaryImporter.ImportRequirement[],\n fileMap: DictionaryImporter.ArchiveFileMap,\n ): Promise<{ media: DictionaryDatabase.MediaDataArrayBufferContent[] }> {\n const media = new Map<string, DictionaryDatabase.MediaDataArrayBufferContent>();\n const context: DictionaryImporter.ImportRequirementContext = { fileMap, media };\n\n for (const requirement of requirements) {\n await this._resolveAsyncRequirement(context, requirement);\n }\n\n return {\n media: [...media.values()],\n };\n }\n\n private async _resolveAsyncRequirement(\n context: DictionaryImporter.ImportRequirementContext,\n requirement: DictionaryImporter.ImportRequirement,\n ): Promise<void> {\n switch (requirement.type) {\n case 'image':\n await this._resolveDictionaryTermGlossaryImage(\n context,\n requirement.target,\n requirement.source,\n requirement.entry,\n );\n break;\n case 'structured-content-image':\n await this._resolveStructuredContentImage(\n context,\n requirement.target,\n requirement.source,\n requirement.entry,\n );\n break;\n default:\n return;\n }\n }\n\n private async _resolveDictionaryTermGlossaryImage(\n context: DictionaryImporter.ImportRequirementContext,\n target: DictionaryData.TermGlossaryImage,\n source: DictionaryData.TermGlossaryImage,\n entry: DictionaryDatabase.DatabaseTermEntry,\n ): Promise<void> {\n await this._createImageData(context, target, source, entry);\n }\n\n private async _resolveStructuredContentImage(\n context: DictionaryImporter.ImportRequirementContext,\n target: StructuredContent.ImageElement,\n source: StructuredContent.ImageElement,\n entry: DictionaryDatabase.DatabaseTermEntry,\n ): Promise<void> {\n const { verticalAlign, border, borderRadius, sizeUnits } = source;\n await this._createImageData(context, target, source, entry);\n if (typeof verticalAlign === 'string') {\n target.verticalAlign = verticalAlign;\n }\n if (typeof border === 'string') {\n target.border = border;\n }\n if (typeof borderRadius === 'string') {\n target.borderRadius = borderRadius;\n }\n if (typeof sizeUnits === 'string') {\n target.sizeUnits = sizeUnits;\n }\n }\n\n private async _createImageData(\n context: DictionaryImporter.ImportRequirementContext,\n target: StructuredContent.ImageElementBase,\n source: StructuredContent.ImageElementBase,\n entry: DictionaryDatabase.DatabaseTermEntry,\n ): Promise<void> {\n const {\n path,\n width: preferredWidth,\n height: preferredHeight,\n title,\n alt,\n description,\n pixelated,\n imageRendering,\n appearance,\n background,\n collapsed,\n collapsible,\n } = source;\n const { width, height } = await this._getImageMedia(context, path, entry);\n target.path = path;\n target.width = width;\n target.height = height;\n if (typeof preferredWidth === 'number') {\n target.preferredWidth = preferredWidth;\n }\n if (typeof preferredHeight === 'number') {\n target.preferredHeight = preferredHeight;\n }\n if (typeof title === 'string') {\n target.title = title;\n }\n if (typeof alt === 'string') {\n target.alt = alt;\n }\n if (typeof description === 'string') {\n target.description = description;\n }\n if (typeof pixelated === 'boolean') {\n target.pixelated = pixelated;\n }\n if (typeof imageRendering === 'string') {\n target.imageRendering = imageRendering;\n }\n if (typeof appearance === 'string') {\n target.appearance = appearance;\n }\n if (typeof background === 'boolean') {\n target.background = background;\n }\n if (typeof collapsed === 'boolean') {\n target.collapsed = collapsed;\n }\n if (typeof collapsible === 'boolean') {\n target.collapsible = collapsible;\n }\n }\n\n private async _getImageMedia(\n context: DictionaryImporter.ImportRequirementContext,\n path: string,\n entry: DictionaryDatabase.DatabaseTermEntry,\n ): Promise<DictionaryDatabase.MediaDataArrayBufferContent> {\n const { media } = context;\n const { dictionary } = entry;\n\n const createError = (message: string): Error => {\n const { expression, reading } = entry;\n const readingSource = reading.length > 0 ? ` (${reading})` : '';\n return new Error(\n `${message} at path ${JSON.stringify(path)} for ${expression}${readingSource} in ${dictionary}`,\n );\n };\n\n // Check if already added\n let mediaData = media.get(path);\n if (typeof mediaData !== 'undefined') {\n if (getFileExtensionFromImageMediaType(mediaData.mediaType) === null) {\n throw createError('Media file is not a valid image');\n }\n return mediaData;\n }\n\n // Find file in archive\n const file = context.fileMap.get(path);\n if (typeof file === 'undefined') {\n throw createError('Could not find image');\n }\n\n // Load file content\n let content = await (await this._getData(file as Entry, new BlobWriter())).arrayBuffer();\n\n const mediaType = getImageMediaTypeFromFileName(path);\n if (mediaType === null) {\n throw createError('Could not determine media type for image');\n }\n\n // Load image data\n let width: number;\n let height: number;\n try {\n ({ content, width, height } = await this._mediaLoader.getImageDetails(content, mediaType));\n } catch (e) {\n throw createError('Could not load image');\n }\n\n // Create image data\n mediaData = {\n dictionary,\n path,\n mediaType,\n width,\n height,\n content,\n };\n media.set(path, mediaData);\n\n return mediaData;\n }\n\n // Bank entry converters\n\n private _convertTermBankEntryV1(\n entry: DictionaryData.TermV1,\n dictionary: string,\n ): DictionaryDatabase.DatabaseTermEntry {\n let [expression, reading, definitionTags, rules, score, ...glossary] = entry;\n reading = reading.length > 0 ? reading : expression;\n return { expression, reading, definitionTags, rules, score, glossary, dictionary };\n }\n\n private _convertTermBankEntryV3(\n entry: DictionaryData.TermV3,\n dictionary: string,\n ): DictionaryDatabase.DatabaseTermEntry {\n let [expression, reading, definitionTags, rules, score, glossary, sequence, termTags] = entry;\n reading = reading.length > 0 ? reading : expression;\n return { expression, reading, definitionTags, rules, score, glossary, sequence, termTags, dictionary };\n }\n\n private _convertTermMetaBankEntry(\n entry: DictionaryData.TermMeta,\n dictionary: string,\n ): DictionaryDatabase.DatabaseTermMeta {\n const [expression, mode, data] = entry;\n return { expression, mode, data, dictionary } as DictionaryDatabase.DatabaseTermMeta;\n }\n\n private _convertKanjiBankEntryV1(\n entry: DictionaryData.KanjiV1,\n dictionary: string,\n ): DictionaryDatabase.DatabaseKanjiEntry {\n const [character, onyomi, kunyomi, tags, ...meanings] = entry;\n return { character, onyomi, kunyomi, tags, meanings, dictionary };\n }\n\n private _convertKanjiBankEntryV3(\n entry: DictionaryData.KanjiV3,\n dictionary: string,\n ): DictionaryDatabase.DatabaseKanjiEntry {\n const [character, onyomi, kunyomi, tags, meanings, stats] = entry;\n return { character, onyomi, kunyomi, tags, meanings, stats, dictionary };\n }\n\n private _convertKanjiMetaBankEntry(\n entry: DictionaryData.KanjiMeta,\n dictionary: string,\n ): DictionaryDatabase.DatabaseKanjiMeta {\n const [character, mode, data] = entry;\n return { character, mode, data, dictionary };\n }\n\n private _convertTagBankEntry(entry: DictionaryData.Tag, dictionary: string): DictionaryDatabase.Tag {\n const [name, category, order, notes, score] = entry;\n return { name, category, order, notes, score, dictionary };\n }\n\n private _addOldIndexTags(index: DictionaryData.Index, results: DictionaryDatabase.Tag[], dictionary: string): void {\n const { tagMeta } = index;\n if (typeof tagMeta !== 'object' || tagMeta === null) {\n return;\n }\n for (const [name, value] of Object.entries(tagMeta)) {\n const { category, order, notes, score } = value;\n results.push({ name, category, order, notes, score, dictionary });\n }\n }\n\n // Archive file helpers\n\n private _getArchiveFiles(\n fileMap: DictionaryImporter.ArchiveFileMap,\n queryDetails: DictionaryImporter.QueryDetails,\n ): DictionaryImporter.QueryResult {\n const results: DictionaryImporter.QueryResult = new Map();\n\n for (const [fileType] of queryDetails) {\n results.set(fileType, []);\n }\n\n for (const [fileName, fileEntry] of fileMap.entries()) {\n for (const [fileType, fileNameFormat] of queryDetails) {\n if (!fileNameFormat.test(fileName)) {\n continue;\n }\n const entries = results.get(fileType);\n\n if (typeof entries !== 'undefined') {\n entries.push(fileEntry);\n break;\n }\n }\n }\n return results;\n }\n\n private async _readFileSequence<TEntry = unknown, TResult = unknown>(\n files: Entry[],\n convertEntry: (entry: TEntry, dictionaryTitle: string) => TResult,\n dictionaryTitle: string,\n ): Promise<TResult[]> {\n const results: TResult[] = [];\n for (const file of files) {\n const content = await this._getData(file, new TextWriter());\n let entries: unknown;\n\n try {\n entries = parseJson(content);\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`${error.message} in '${file.filename}'`);\n }\n }\n\n if (Array.isArray(entries)) {\n for (const entry of entries as TEntry[]) {\n results.push(convertEntry(entry, dictionaryTitle));\n }\n }\n }\n return results;\n }\n\n private async _validateFile(file: Entry, schemaName: DictionaryImporter.CompiledSchemaName): Promise<boolean> {\n const content = await this._getData(file, new TextWriter());\n let entries: unknown;\n\n try {\n entries = parseJson(content);\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`${error.message} in '${file.filename}'`);\n }\n }\n\n const ajvSchemas = getSchemaValidators();\n const schema = ajvSchemas[schemaName];\n if (!schema(entries)) {\n throw this._formatAjvSchemaError(schema, file.filename);\n }\n\n ++this._progressData.index;\n this._progress();\n\n return true;\n }\n\n // Meta counts\n\n private _getMetaCounts(\n metaList: DictionaryDatabase.DatabaseTermMeta[] | DictionaryDatabase.DatabaseKanjiMeta[],\n ): DictionaryImporter.SummaryMetaCount {\n const countsMap = new Map<string, number>();\n for (const { mode } of metaList) {\n let count = countsMap.get(mode);\n count = typeof count !== 'undefined' ? count + 1 : 1;\n countsMap.set(mode, count);\n }\n const counts: DictionaryImporter.SummaryMetaCount = { total: metaList.length };\n for (const [key, value] of countsMap.entries()) {\n if (Object.prototype.hasOwnProperty.call(counts, key)) {\n continue;\n }\n counts[key] = value;\n }\n return counts;\n }\n\n // Data extraction\n\n private async _getData<T = unknown>(entry: Entry, writer: Writer<T> | WritableWriter): Promise<T> {\n if (typeof (entry as any).getData === 'undefined') {\n throw new Error(`Cannot read ${entry.filename}`);\n }\n return await (entry as any).getData(writer);\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGA,SAAgB,qBAAqBA,MAAsB;CACvD,MAAM,QAAQ,cAAc,KAAK,KAAK;AACtC,QAAO,UAAU,OAAO,MAAM,KAAK;AACtC;;;;AAKD,SAAgB,8BAA8BA,MAA6B;AACvE,SAAQ,qBAAqB,KAAK,CAAC,aAAa,EAAhD;EACI,KAAK,QACD,QAAO;EACX,KAAK,QACD,QAAO;EACX,KAAK,OACD,QAAO;EACX,KAAK,OACD,QAAO;EACX,KAAK;EACL,KAAK,OACD,QAAO;EACX,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,OACD,QAAO;EACX,KAAK,OACD,QAAO;EACX,KAAK,OACD,QAAO;EACX,KAAK;EACL,KAAK,QACD,QAAO;EACX,KAAK,QACD,QAAO;EACX,QACI,QAAO;CACd;AACJ;;;;AAKD,SAAgB,mCAAmCC,WAAkC;AACjF,SAAQ,WAAR;EACI,KAAK,aACD,QAAO;EACX,KAAK,aACD,QAAO;EACX,KAAK,YACD,QAAO;EACX,KAAK,YACD,QAAO;EACX,KAAK,eACD,QAAO;EACX,KAAK,aACD,QAAO;EACX,KAAK,YACD,QAAO;EACX,KAAK,gBACD,QAAO;EACX,KAAK,aACD,QAAO;EACX,KAAK,aACD,QAAO;EACX,QACI,QAAO;CACd;AACJ;;;;YCvEU;gBACI;oBACI,EACX,mBAAmB;CACf,QAAQ;CACR,eAAe;CACf,W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|
|
|
1
|
+
require('./utilities-C-lbZaJE.cjs');
|
|
2
|
+
require('./errors-BSezaJwm.cjs');
|
|
3
|
+
require('./dictionary-data-util-CHnRdYZ9.cjs');
|
|
4
|
+
require('./json-DKWp-B7Y.cjs');
|
|
5
|
+
const require_dictionary_importer = require('./dictionary-importer-Dhn75iZ4.cjs');
|
|
6
|
+
require('./media-loader-Ce9cuANS.cjs');
|
|
7
|
+
|
|
8
|
+
exports.DictionaryImporterClass = require_dictionary_importer.DictionaryImporterClass
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { GenericFrequencyData, ImageElement, TermGlossary, TermGlossaryImage, TermMetaFrequencyDataWithReading, TermMetaPhoneticData, TermMetaPitchData, TermSourceMatchSource, TermSourceMatchType } from "./dictionary-D7l-qFt1.cjs";
|
|
2
|
+
import * as ajv0 from "ajv";
|
|
3
|
+
import * as ajv1 from "ajv";
|
|
4
|
+
import * as ajv2 from "ajv";
|
|
5
|
+
import * as ajv3 from "ajv";
|
|
6
|
+
import * as ajv4 from "ajv";
|
|
7
|
+
import * as ajv5 from "ajv";
|
|
8
|
+
import * as ajv6 from "ajv";
|
|
9
|
+
import * as ajv7 from "ajv";
|
|
10
|
+
|
|
11
|
+
//#region src/types/dictionary-database.d.ts
|
|
12
|
+
type MediaDataBase<TContentType = unknown> = {
|
|
13
|
+
dictionary: string;
|
|
14
|
+
path: string;
|
|
15
|
+
mediaType: string;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
content: TContentType;
|
|
19
|
+
};
|
|
20
|
+
type MediaDataArrayBufferContent = MediaDataBase<ArrayBuffer>;
|
|
21
|
+
type Media<T extends ArrayBuffer | string | null = ArrayBuffer> = {
|
|
22
|
+
index: number;
|
|
23
|
+
} & MediaDataBase<T>;
|
|
24
|
+
type DatabaseTermEntry = {
|
|
25
|
+
expression: string;
|
|
26
|
+
reading: string;
|
|
27
|
+
expressionReverse?: string;
|
|
28
|
+
readingReverse?: string;
|
|
29
|
+
definitionTags: string | null;
|
|
30
|
+
tags?: string;
|
|
31
|
+
rules: string;
|
|
32
|
+
score: number;
|
|
33
|
+
glossary: TermGlossary[];
|
|
34
|
+
sequence?: number;
|
|
35
|
+
termTags?: string;
|
|
36
|
+
dictionary: string;
|
|
37
|
+
};
|
|
38
|
+
type TermEntry = {
|
|
39
|
+
index: number;
|
|
40
|
+
matchType: MatchType;
|
|
41
|
+
matchSource: MatchSource;
|
|
42
|
+
term: string;
|
|
43
|
+
reading: string;
|
|
44
|
+
definitionTags: string[];
|
|
45
|
+
termTags: string[];
|
|
46
|
+
rules: string[];
|
|
47
|
+
definitions: TermGlossary[];
|
|
48
|
+
score: number;
|
|
49
|
+
dictionary: string;
|
|
50
|
+
id: number;
|
|
51
|
+
sequence: number;
|
|
52
|
+
};
|
|
53
|
+
type KanjiEntry = {
|
|
54
|
+
index: number;
|
|
55
|
+
character: string;
|
|
56
|
+
onyomi: string[];
|
|
57
|
+
kunyomi: string[];
|
|
58
|
+
tags: string[];
|
|
59
|
+
definitions: string[];
|
|
60
|
+
stats: {
|
|
61
|
+
[name: string]: string;
|
|
62
|
+
};
|
|
63
|
+
dictionary: string;
|
|
64
|
+
};
|
|
65
|
+
type Tag = {
|
|
66
|
+
name: string;
|
|
67
|
+
category: string;
|
|
68
|
+
order: number;
|
|
69
|
+
notes: string;
|
|
70
|
+
score: number;
|
|
71
|
+
dictionary: string;
|
|
72
|
+
};
|
|
73
|
+
type TermMeta = TermMetaFrequency | TermMetaPitch | TermMetaPhoneticData$1;
|
|
74
|
+
type TermMetaFrequency = {
|
|
75
|
+
index: number;
|
|
76
|
+
term: string;
|
|
77
|
+
mode: 'freq';
|
|
78
|
+
data: GenericFrequencyData | TermMetaFrequencyDataWithReading;
|
|
79
|
+
dictionary: string;
|
|
80
|
+
};
|
|
81
|
+
type TermMetaPitch = {
|
|
82
|
+
mode: 'pitch';
|
|
83
|
+
index: number;
|
|
84
|
+
term: string;
|
|
85
|
+
data: TermMetaPitchData;
|
|
86
|
+
dictionary: string;
|
|
87
|
+
};
|
|
88
|
+
type TermMetaPhoneticData$1 = {
|
|
89
|
+
mode: 'ipa';
|
|
90
|
+
index: number;
|
|
91
|
+
term: string;
|
|
92
|
+
data: TermMetaPhoneticData;
|
|
93
|
+
dictionary: string;
|
|
94
|
+
};
|
|
95
|
+
type KanjiMeta = KanjiMetaFrequency;
|
|
96
|
+
type KanjiMetaFrequency = {
|
|
97
|
+
index: number;
|
|
98
|
+
character: string;
|
|
99
|
+
mode: 'freq';
|
|
100
|
+
data: GenericFrequencyData;
|
|
101
|
+
dictionary: string;
|
|
102
|
+
};
|
|
103
|
+
type DictionaryCounts = {
|
|
104
|
+
total: DictionaryCountGroup | null;
|
|
105
|
+
counts: DictionaryCountGroup[];
|
|
106
|
+
};
|
|
107
|
+
type DictionaryCountGroup = {
|
|
108
|
+
[key: string]: number;
|
|
109
|
+
};
|
|
110
|
+
type ObjectStoreName = 'dictionaries' | 'terms' | 'termMeta' | 'kanji' | 'kanjiMeta' | 'tagMeta' | 'media';
|
|
111
|
+
type DeleteDictionaryProgressData = {
|
|
112
|
+
count: number;
|
|
113
|
+
processed: number;
|
|
114
|
+
storeCount: number;
|
|
115
|
+
storesProcesed: number;
|
|
116
|
+
};
|
|
117
|
+
type DeleteDictionaryProgressCallback = (data: DeleteDictionaryProgressData) => void;
|
|
118
|
+
type MatchType = TermSourceMatchType;
|
|
119
|
+
type MatchSource = TermSourceMatchSource;
|
|
120
|
+
type DictionaryAndQueryRequest = {
|
|
121
|
+
query: string | number;
|
|
122
|
+
dictionary: string;
|
|
123
|
+
};
|
|
124
|
+
type TermExactRequest = {
|
|
125
|
+
term: string;
|
|
126
|
+
reading: string;
|
|
127
|
+
};
|
|
128
|
+
type MediaRequest = {
|
|
129
|
+
path: string;
|
|
130
|
+
dictionary: string;
|
|
131
|
+
};
|
|
132
|
+
type DictionarySet = {
|
|
133
|
+
has(value: string): boolean;
|
|
134
|
+
}; //#endregion
|
|
135
|
+
//#region src/types/dictionary-importer.d.ts
|
|
136
|
+
|
|
137
|
+
//# sourceMappingURL=dictionary-database.d.ts.map
|
|
138
|
+
type OnProgressCallback = (data: ProgressData) => void;
|
|
139
|
+
type ImportStep = {
|
|
140
|
+
label: string;
|
|
141
|
+
callback?: () => void;
|
|
142
|
+
};
|
|
143
|
+
type ImportSteps = ImportStep[];
|
|
144
|
+
type ProgressData = {
|
|
145
|
+
index: number;
|
|
146
|
+
count: number;
|
|
147
|
+
nextStep?: boolean;
|
|
148
|
+
};
|
|
149
|
+
type ImportResult = {
|
|
150
|
+
result: Summary | null;
|
|
151
|
+
errors: Error[];
|
|
152
|
+
};
|
|
153
|
+
type ImportDetails = {
|
|
154
|
+
prefixWildcardsSupported: boolean;
|
|
155
|
+
yomitanVersion: string;
|
|
156
|
+
};
|
|
157
|
+
type Summary = {
|
|
158
|
+
title: string;
|
|
159
|
+
revision: string;
|
|
160
|
+
sequenced: boolean;
|
|
161
|
+
minimumYomitanVersion?: string;
|
|
162
|
+
version: number;
|
|
163
|
+
importDate: number;
|
|
164
|
+
prefixWildcardsSupported: boolean;
|
|
165
|
+
counts?: SummaryCounts;
|
|
166
|
+
styles: string;
|
|
167
|
+
isUpdatable?: boolean;
|
|
168
|
+
indexUrl?: string;
|
|
169
|
+
downloadUrl?: string;
|
|
170
|
+
author?: string;
|
|
171
|
+
url?: string;
|
|
172
|
+
description?: string;
|
|
173
|
+
attribution?: string;
|
|
174
|
+
sourceLanguage?: string;
|
|
175
|
+
targetLanguage?: string;
|
|
176
|
+
frequencyMode?: 'occurrence-based' | 'rank-based';
|
|
177
|
+
importSuccess?: boolean;
|
|
178
|
+
};
|
|
179
|
+
type SummaryDetails = {
|
|
180
|
+
prefixWildcardsSupported: boolean;
|
|
181
|
+
counts: SummaryCounts;
|
|
182
|
+
styles: string;
|
|
183
|
+
yomitanVersion: string;
|
|
184
|
+
importSuccess: boolean;
|
|
185
|
+
};
|
|
186
|
+
type SummaryCounts = {
|
|
187
|
+
terms: SummaryItemCount;
|
|
188
|
+
termMeta: SummaryMetaCount;
|
|
189
|
+
kanji: SummaryItemCount;
|
|
190
|
+
kanjiMeta: SummaryMetaCount;
|
|
191
|
+
tagMeta: SummaryItemCount;
|
|
192
|
+
media: SummaryItemCount;
|
|
193
|
+
};
|
|
194
|
+
type SummaryItemCount = {
|
|
195
|
+
total: number;
|
|
196
|
+
};
|
|
197
|
+
type SummaryMetaCount = {
|
|
198
|
+
[key: string]: number;
|
|
199
|
+
};
|
|
200
|
+
type ImportRequirement = ImageImportRequirement | StructuredContentImageImportRequirement;
|
|
201
|
+
type ImageImportRequirement = {
|
|
202
|
+
type: 'image';
|
|
203
|
+
target: TermGlossaryImage;
|
|
204
|
+
source: TermGlossaryImage;
|
|
205
|
+
entry: DatabaseTermEntry;
|
|
206
|
+
};
|
|
207
|
+
type StructuredContentImageImportRequirement = {
|
|
208
|
+
type: 'structured-content-image';
|
|
209
|
+
target: ImageElement;
|
|
210
|
+
source: ImageElement;
|
|
211
|
+
entry: DatabaseTermEntry;
|
|
212
|
+
};
|
|
213
|
+
type ImportRequirementContext = {
|
|
214
|
+
fileMap: ArchiveFileMap;
|
|
215
|
+
media: Map<string, MediaDataArrayBufferContent>;
|
|
216
|
+
};
|
|
217
|
+
type ArchiveFileMap = Map<string, unknown>;
|
|
218
|
+
type QueryDetails = [fileType: string, fileNameFormat: RegExp][];
|
|
219
|
+
type QueryResult = Map<string, unknown[]>;
|
|
220
|
+
type CompiledSchemaValidators = {
|
|
221
|
+
dictionaryIndex: ajv0.ValidateFunction;
|
|
222
|
+
dictionaryTermBankV1: ajv1.ValidateFunction;
|
|
223
|
+
dictionaryTermBankV3: ajv2.ValidateFunction;
|
|
224
|
+
dictionaryTermMetaBankV3: ajv3.ValidateFunction;
|
|
225
|
+
dictionaryKanjiBankV1: ajv4.ValidateFunction;
|
|
226
|
+
dictionaryKanjiBankV3: ajv5.ValidateFunction;
|
|
227
|
+
dictionaryKanjiMetaBankV3: ajv6.ValidateFunction;
|
|
228
|
+
dictionaryTagBankV3: ajv7.ValidateFunction;
|
|
229
|
+
};
|
|
230
|
+
type CompiledSchemaName = keyof CompiledSchemaValidators;
|
|
231
|
+
type CompiledSchemaNameArray = [termBank: CompiledSchemaName, termMetaBank: CompiledSchemaName, kanjiBank: CompiledSchemaName, kanjiMetaBank: CompiledSchemaName, tagBank: CompiledSchemaName];
|
|
232
|
+
|
|
233
|
+
//#endregion
|
|
234
|
+
//# sourceMappingURL=dictionary-importer.d.ts.map
|
|
235
|
+
|
|
236
|
+
export { ArchiveFileMap, CompiledSchemaName, CompiledSchemaNameArray, CompiledSchemaValidators, DeleteDictionaryProgressCallback, DictionaryAndQueryRequest, DictionaryCounts, DictionarySet, ImageImportRequirement, ImportDetails, ImportRequirement, ImportRequirementContext, ImportResult, ImportStep, ImportSteps, KanjiEntry, KanjiMeta, MatchType, Media, MediaRequest, ObjectStoreName, OnProgressCallback, ProgressData, QueryDetails, QueryResult, StructuredContentImageImportRequirement, Summary, SummaryCounts, SummaryDetails, SummaryItemCount, SummaryMetaCount, Tag, TermEntry, TermExactRequest, TermMeta };
|
|
237
|
+
//# sourceMappingURL=dictionary-importer-Da3AuTZw.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary-importer-Da3AuTZw.d.cts","names":[],"sources":["../src/types/dictionary-database.ts","../src/types/dictionary-importer.ts"],"sourcesContent":null,"mappings":";;;;;;;;;;;KAQY;;;;;;EAAA,OAAA,EAMC,YANY;AASzB,CAAA;AAAuC,KAA3B,2BAAA,GAA8B,aAAH,CAAiB,WAAjB,CAAA;AAAG,KAI9B,KAJ8B,CAAA,UAId,WAJc,GAAA,MAAA,GAAA,IAAA,GAIgB,WAJhB,CAAA,GAAA;EAAa,KAAA,EAAA,MAAA;AAIvD,CAAA,GAA6F,aAA5E,CAA0F,CAA1F,CAAA;AAAA,KAEL,iBAAA,GAFK;EAAA,UAAW,EAAA,MAAA;EAAW,OAAmB,EAAA,M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