diff --git a/.gitignore b/.gitignore index e177713..a19c938 100755 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ *.zip data/**/*.css +!data/styles.css *.txt !instructions.txt diff --git a/3-tidy-up.js b/3-tidy-up.js index 06fed75..2441604 100644 --- a/3-tidy-up.js +++ b/3-tidy-up.js @@ -54,15 +54,16 @@ function isInflectionGloss(glosses, formOf) { } /** - * @param {GlossTree} glossTree + * @param {GlossTwig} glossTwig * @param {number} level - * @returns {*} + * @returns {import('types').TermBank.StructuredContent[]} */ -function handleLevel(glossTree, level) { +function handleLevel(glossTwig, level) { + /** @type {import('types').TermBank.StructuredContent[]} */ const nestDefs = []; let defIndex = 0; - for (const [def, children] of glossTree) { + for (const [def, children] of glossTwig) { defIndex += 1; if(children.size > 0) { @@ -70,6 +71,7 @@ function handleLevel(glossTree, level) { const childDefs = handleLevel(children, nextLevel); const listType = level === 1 ? "li" : "number"; + /** @type {import('types').TermBank.StructuredContent} */ const content = level === 1 ? def : [{ "tag": "span", "data": { "listType": "number" }, "content": `${defIndex}. ` }, def]; nestDefs.push([ @@ -85,11 +87,11 @@ function handleLevel(glossTree, level) { } /** - * @param {GlossTree} glossTree + * @param {GlossTwig} glossTwig * @param {SenseInfo} sense */ -function handleNest(glossTree, sense) { - const nestedGloss = handleLevel(glossTree, 1); +function handleNest(glossTwig, sense) { + const nestedGloss = handleLevel(glossTwig, 1); if (nestedGloss.length > 0) { for (const entry of nestedGloss) { @@ -227,18 +229,108 @@ function handleLine(parsedLine) { saveIpaResult(word, readings, pos, ipaObj); } - /** @type {GlossTree} */ + const glossTree = getGlossTree(sensesWithoutInflectionGlosses); + + for (const [gloss, branches] of glossTree) { + const tags = branches.get('_tags') || []; + const examples = branches.get('_examples') || []; + branches.delete('_tags'); + branches.delete('_examples'); + + /** @type {SenseInfo} */ + const currSense = { glosses: [], tags, examples }; + if(branches.size === 0) { + if(examples.length > 0) { + currSense.glosses.push({ + "type": "structured-content", + "content": [ + gloss, + getStructuredExamples(examples) + ] + }); + } else { + currSense.glosses.push(gloss); + } + + } else { + /** @type {GlossBranch} */ + const syntheticBranch = new Map(); + syntheticBranch.set(gloss, branches); + handleNest(syntheticBranch, currSense); + } + + if (currSense.glosses.length > 0) { + saveSenseResult(word, readings, pos, currSense); + } + } +} + +/** + * @param {Example[]} examples + * @returns {import('types').TermBank.StructuredContent[]} + */ +function getStructuredExamples(examples) { + return examples.map(({text, english}) => { + return { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag":"div", + "data": { + "content": "example-sentence" + }, + "content":[{ + "tag": "div", + "data": { + "content": "example-sentence-a", + }, + "content": text + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": english + } + ]} + } + }); +} + +/** + * @param {TidySense[]} sensesWithoutInflectionGlosses + * @returns {GlossTree} + */ +function getGlossTree(sensesWithoutInflectionGlosses) { const glossTree = new Map(); for (const sense of sensesWithoutInflectionGlosses) { const { glossesArray, tags } = sense; + let { examples = [] } = sense; + + examples = examples + .filter(({text, english}) => text && (text.length <= 70 || text.length <= 90 && !english)) // Filter out verbose examples + .map((example, index) => ({ ...example, originalIndex: index })) // Step 1: Decorate with original index + .sort(({ english: englishA, originalIndex: indexA }, { english: englishB, originalIndex: indexB }) => { + if (englishA && !englishB) return -1; // English items first + if (!englishA && englishB) return 1; // Non-English items last + return indexA - indexB; // Step 2: Stable sort by original index if equal + }) + .map(({text, english}) => ({text, english})) // Step 3: Pick only properties that will be used + .slice(0, 2); + + let temp = glossTree; for (const [levelIndex, levelGloss] of glossesArray.entries()) { let curr = temp.get(levelGloss); - if(!curr) { + if (!curr) { curr = new Map(); temp.set(levelGloss, curr); - if(levelIndex === 0) { + if (levelIndex === 0) { curr.set('_tags', tags); + curr.set('_examples', examples); } } else if (levelIndex === 0) { curr.set('_tags', tags.filter(value => curr?.get('_tags')?.includes(value))); @@ -246,26 +338,7 @@ function handleLine(parsedLine) { temp = curr; } } - - for (const [gloss, children] of glossTree) { - const tags = children.get('_tags') || []; - children.delete('_tags'); - - /** @type {SenseInfo} */ - const currSense = { glosses: [], tags }; - if(children.size === 0) { - currSense.glosses.push(gloss); - } else { - /** @type {GlossTree} */ - const branch = new Map(); - branch.set(gloss, children); - handleNest(branch, currSense); - } - - if (currSense.glosses.length > 0) { - saveSenseResult(word, readings, pos, currSense); - } - } + return glossTree; } /** diff --git a/4-make-yomitan.js b/4-make-yomitan.js index 5942af4..18014dd 100644 --- a/4-make-yomitan.js +++ b/4-make-yomitan.js @@ -1,4 +1,3 @@ -//@ts-nocheck const path = require('path'); const { readFileSync, writeFileSync, existsSync, readdirSync, mkdirSync, unlinkSync } = require('fs'); const { sortTags, writeInBatches, consoleOverwrite, @@ -12,7 +11,7 @@ const { DICT_NAME, tidy_folder: readFolder, temp_folder: writeFolder -} = process.env; +} = /** @type {MakeYomitanEnv} */(process.env); const latestDownloadLink = 'https://github.com/yomidevs/kaikki-to-yomitan/releases/latest/download/'; @@ -32,7 +31,11 @@ if (!existsSync(`data/language/${source_iso}/${target_iso}`)) { mkdirSync(`data/language/${source_iso}/${target_iso}`, {recursive: true}); } +const termDictStyles = readFileSync('data/styles.css', 'utf8'); + +/** @type {WhitelistedTag[]} */ const targetLanguageTermTags = loadJsonArray(`data/language/target-language-tags/${target_iso}/tag_bank_term.json`); +/** @type {WhitelistedTag[]} */ const languageTermTags = loadJsonArray(`data/language/${source_iso}/${target_iso}/tag_bank_term.json`); const termTags = [...targetLanguageTermTags, ...languageTermTags]; @@ -44,7 +47,7 @@ const partsOfSpeech = loadJsonArray(`data/language/target-language-tags/${target const multiwordInflections = loadJsonArray(`data/language/${source_iso}/${target_iso}/multiword_inflections.json`); const tagStylesFile = `data/language/target-language-tags/${target_iso}/tag_styles.json`; -const tagStyles = existsSync(tagStylesFile) ? JSON.parse(readFileSync(tagStylesFile)) : {}; +const tagStyles = existsSync(tagStylesFile) ? JSON.parse(readFileSync(tagStylesFile, 'utf8')) : {}; const tagModifiers = [ ['chiefly', 'chief'], @@ -56,6 +59,11 @@ const tagModifiers = [ ['slightly', 'sli'], ] +/** + * @param {WhitelistedTag[]} tags + * @param {string} tag + * @returns {null|import('types').TagBank.TagInformation} + */ function findTag(tags, tag) { const fullTag = tags.find((x) => { if (typeof x[3] === 'string') { @@ -66,21 +74,27 @@ function findTag(tags, tag) { return false; }); - const result = fullTag ? [...fullTag] : null; + if(!fullTag) return null; + + const result = [...fullTag]; - if(result && Array.isArray(result[3])){ - result[3] = result[3][0]; + if(Array.isArray(result[3])){ + result[3] = result[3][0]; // this makes it fit the yomitan tag format } - return result; + return /** @type {import('types').TagBank.TagInformation}*/ (result); } +/** + * @param {string} tag + * @returns {null|import('types').TagBank.TagInformation} + */ function findModifiedTag(tag){ let modifiedTag = null; tagModifiers.forEach((modifier) => { const regex = new RegExp(`^${modifier[0]} `); if (regex.test(tag)){ - fullTag = findTag(termTags, tag.replace(regex, '')); + const fullTag = findTag(termTags, tag.replace(regex, '')); if (fullTag){ modifiedTag = [ `${modifier[1]}-${fullTag[0]}`, @@ -96,8 +110,12 @@ function findModifiedTag(tag){ return modifiedTag; } +/** @type {FormsMap} */ const formsMap = new Map(); +/** + * @type {{ipa: Object, dict: Object}} + */ const ymtTags = { ipa: {}, dict: {} @@ -114,16 +132,18 @@ let lastTermBankIndex = 0; { const ymtLemmas = []; + /** @type {import('types').TermBankMeta.TermPhoneticTranscription[]} */ const ymtIpa = []; consoleOverwrite(`4-make-yomitan.js: reading lemmas...`); const lemmasFile = `${readFolder}/${source_iso}-${target_iso}-lemmas.json`; - const lemmaDict = JSON.parse(readFileSync(path.resolve(__dirname, lemmasFile))); + /** @type {LemmaDict} */ + const lemmaDict = JSON.parse(readFileSync(path.resolve(__dirname, lemmasFile), 'utf8')); consoleOverwrite('4-make-yomitan.js: processing lemmas...'); for (const [lemma, readings] of Object.entries(lemmaDict)) { for (const [reading, partsOfSpeechOfWord] of Object.entries(readings)) { - normalizedLemma = normalizeOrthography(lemma); + const normalizedLemma = normalizeOrthography(lemma); let term = normalizedLemma; if(lemma !== normalizedLemma && lemma !== reading){ @@ -140,7 +160,10 @@ let lastTermBankIndex = 0; anyForms.push(message); } } - + + /** + * @param {any} word + */ function debug(word) { if (normalizedLemma === DEBUG_WORD) { console.log('-------------------'); @@ -153,18 +176,23 @@ let lastTermBankIndex = 0; for (const [pos, info] of Object.entries(partsOfSpeechOfWord)) { const {senses} = info; - const lemmaTags = [pos, ...(info.tags || [])]; + const lemmaTags = [pos]; ipa.push(...info.ipa); + + /** @type {Object} */ const entries = {}; for (const sense of senses) { - const {glosses, tags} = sense; + const {glosses, tags, examples} = sense; const senseTags = [...lemmaTags, ...tags] glosses.forEach((gloss) => { debug(gloss); + /** + * @param {string} joinedTags + */ function addGlossToEntries(joinedTags) { if(!gloss) return; if (entries[joinedTags]) { @@ -211,6 +239,7 @@ let lastTermBankIndex = 0; } } + /** @type {{ ipa: string; tags?: string[]; }[]} */ const mergedIpas = ipa.reduce((result, item) => { ipaCount++; item.tags = item.tags @@ -228,12 +257,16 @@ let lastTermBankIndex = 0; const existingIpa = result.find((x) => x.ipa === item.ipa); if (existingIpa) { - existingIpa.tags = [...new Set([...existingIpa.tags, ...item.tags])]; + existingIpa.tags = [ + ...new Set([ + ...(existingIpa.tags || []), + ...item.tags]) + ]; } else { result.push(item); } return result; - }, []); + }, /** @type {{ ipa: string; tags?: string[]; }[]} */ ([])); if (mergedIpas.length) { ymtIpa.push([ @@ -253,9 +286,7 @@ let lastTermBankIndex = 0; writeIndex('dict'); writeTags('dict'); const dictTagStyles = getTagStyles('dict'); - if(dictTagStyles){ - writeStyles('dict', dictTagStyles); - } + writeStyles('dict', dictTagStyles); lastTermBankIndex = writeBanks('dict', ymtLemmas, lastTermBankIndex); writeIndex('ipa'); writeTags('ipa'); @@ -268,13 +299,15 @@ let lastTermBankIndex = 0; } { + /** @type {CondensedFormEntries} */ let ymtFormData = []; let formCounter = 0; consoleOverwrite('4-make-yomitan.js: Processing forms...'); const formsFiles = readdirSync(readFolder).filter((file) => file.startsWith(`${source_iso}-${target_iso}-forms-`)); for (const file of formsFiles) { - const formsPart = JSON.parse(readFileSync(path.resolve(__dirname, readFolder, file)), mapJsonReviver); + /** @type {FormsMap} */ + const formsPart = JSON.parse(readFileSync(path.resolve(__dirname, readFolder, file), 'utf8'), mapJsonReviver); for (const [lemma, forms] of formsPart.entries()) { formsMap.set(lemma, forms); } @@ -304,8 +337,9 @@ let lastTermBankIndex = 0; // TODO: generalize this if(target_iso === 'en'){ - hypotheses = gloss.split(' and ') - hypotheses = hypotheses.map((hypothesis) => hypothesis.split(' ')); + hypotheses = gloss + .split(' and ') + .map((hypothesis) => hypothesis.split(' ')); } if(target_iso === 'fr'){ @@ -331,6 +365,7 @@ let lastTermBankIndex = 0; return hypotheses; }); + /** @type {string[][]} */ const uniqueHypotheses = []; for (const hypothesis of inflectionHypotheses) { @@ -341,6 +376,7 @@ let lastTermBankIndex = 0; } } + /** @type {[ uninflectedTerm: string, inflectionRules: string[]][]} */ const deinflectionDefinitions = uniqueHypotheses.map((hypothesis) => [ lemma, hypothesis @@ -394,7 +430,12 @@ writeFileSync(`data/language/${source_iso}/${target_iso}/skippedPartsOfSpeech.js console.log('4-make-yomitan.js: Done!') +/** + * @param {CondensedFormEntries} ymtFormData + * @returns {CondensedFormEntries} + */ function writeYmtFormData(ymtFormData) { + /** @type {import('types').TermBank.TermInformation[]} */ const ymtForms = ymtFormData.map((form, index) => { const [term, reading, definitions] = form; return [ @@ -414,6 +455,12 @@ function writeYmtFormData(ymtFormData) { return ymtFormData; } +/** + * @param {string} folder + * @param {import('types').TermBank.DictionaryTermBankV3 | import('types').TermBankMeta.DictionaryTermMetaBankV3} data + * @param {number} bankIndex + * @returns + */ function writeBanks(folder, data, bankIndex = 0) { if(folder === 'form') folder = 'dict'; @@ -428,14 +475,29 @@ function writeBanks(folder, data, bankIndex = 0) { return writeInBatches(writeFolder, data, `${folder}/${filename}`, 25000, bankIndex); } +/** + * @param {'dict'|'ipa'} folder + */ function writeTags(folder) { writeFileSync(`${writeFolder}/${folder}/tag_bank_1.json`, JSON.stringify(Object.values(ymtTags[folder]))); } -function writeStyles(folder, tagStyles){ - writeFileSync(`${writeFolder}/${folder}/styles.css`, tagStyles); +/** + * @param {'dict'|'ipa'} folder + * @param {string} styles + */ +function writeStyles(folder, styles){ + if(folder === 'dict') { + styles = styles + '\n' + termDictStyles; + } + if(!styles) return; + writeFileSync(`${writeFolder}/${folder}/styles.css`, styles); } +/** + * @param {'dict'|'ipa'} folder + * @returns {string} + */ function getTagStyles(folder){ let styles = ""; for (const fullTag of Object.values(ymtTags[folder])) { @@ -447,6 +509,9 @@ function getTagStyles(folder){ return styles; } +/** + * @param {'dict'|'ipa'} folder + */ function writeIndex(folder) { const title = `${DICT_NAME}-${source_iso}-${target_iso}` + (folder === 'dict' ? '' : '-ipa'); writeFileSync(`${writeFolder}/${folder}/index.json`, JSON.stringify({ @@ -458,13 +523,21 @@ function writeIndex(folder) { })); } +/** + * @param {string[]} lemmaTags + * @param {string[]} senseTags + * @param {string[]} parenthesesTags + * @param {string} pos + * @returns + */ function processTags(lemmaTags, senseTags, parenthesesTags, pos) { + /** @type {string[]} */ let recognizedTags = []; const allEntryTags = [...new Set([...lemmaTags, ...senseTags, ...parenthesesTags])]; termTagCount += allEntryTags.length; - unrecognizedTags = allEntryTags + const unrecognizedTags = allEntryTags .map((tag) => { const fullTag = findTag(termTags, tag); @@ -487,16 +560,24 @@ function processTags(lemmaTags, senseTags, parenthesesTags, pos) { }) .filter(Boolean); - leftoverTags = unrecognizedTags.length ? `(${unrecognizedTags.join(', ')}) ` : ''; + const leftoverTags = unrecognizedTags.length ? `(${unrecognizedTags.join(', ')}) ` : ''; recognizedTags = [...new Set(recognizedTags)]; return { leftoverTags, recognizedTags }; } +/** + * @param {*} obj + * @returns + */ function sortBreakdown(obj){ return Object.fromEntries(Object.entries(obj).sort((a, b) => b[1] - a[1])); } +/** + * @param {string} term + * @returns {string} + */ function normalizeOrthography(term) { switch (source_iso) { case 'ar': diff --git a/data/styles.css b/data/styles.css new file mode 100644 index 0000000..6c080b7 --- /dev/null +++ b/data/styles.css @@ -0,0 +1,20 @@ +div[data-sc-content="extra-info"] { + margin-left: 0.5em; +} +div[data-sc-content="example-sentence"] { + background-color: color-mix(in srgb, var(--text-color, var(--fg, #333)) 5%, transparent); + border-color: var(--text-color, var(--fg, #333)); + border-style: none none none solid; + border-radius: 0.4rem; + border-width: calc(3em / var(--font-size-no-units, 14)); + margin-top: 0.5rem; + margin-bottom: 0.5rem; + padding: 0.1rem 0.5rem; +} +div[data-sc-content="example-sentence-a"] { + font-size: 1.1em; + font-style: italic; +} +div[data-sc-content="example-sentence-b"] { + font-size: 0.8em; +} \ No newline at end of file diff --git a/data/test/dict/cs/en/term_bank_1.json b/data/test/dict/cs/en/term_bank_1.json index 3bba80f..0f81e90 100644 --- a/data/test/dict/cs/en/term_bank_1.json +++ b/data/test/dict/cs/en/term_bank_1.json @@ -6,8 +6,134 @@ "n", 0, [ - "message", - "report" + { + "type": "structured-content", + "content": [ + "message", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "textová zpráva" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "text message" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Chcete nechat zprávu?" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Would you like to leave a message?" + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "report", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "lékařská zpráva" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "medical report" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "podat zprávu" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to file a report" + } + ] + } + } + ] + ] + } ], 0, "" @@ -19,7 +145,42 @@ "prep", 0, [ - "for" + { + "type": "structured-content", + "content": [ + "for", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Zabili ho pro peníze." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "They killed him for his money." + } + ] + } + } + ] + ] + } ], 0, "" diff --git a/data/test/dict/de/en/tag_bank_1.json b/data/test/dict/de/en/tag_bank_1.json index 721d192..4204bc4 100644 --- a/data/test/dict/de/en/tag_bank_1.json +++ b/data/test/dict/de/en/tag_bank_1.json @@ -62,13 +62,6 @@ "military", 0 ], - [ - "cards", - "", - 0, - "card games", - 0 - ], [ "arch", "archaism", @@ -97,6 +90,13 @@ "rare", -1 ], + [ + "cards", + "", + 0, + "card games", + 0 + ], [ "prep", "partOfSpeech", diff --git a/data/test/dict/de/en/term_bank_1.json b/data/test/dict/de/en/term_bank_1.json index 78d4cd3..35a95c0 100644 --- a/data/test/dict/de/en/term_bank_1.json +++ b/data/test/dict/de/en/term_bank_1.json @@ -235,8 +235,79 @@ "n", 0, [ - "fox (animal)", + { + "type": "structured-content", + "content": [ + "fox (animal)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Fuchs, du hast die Gans gestohlen. Gib sie wieder her!" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "(line from a popular children’s song)" + } + ] + } + } + ] + ] + }, "pledge (prospective member of a fraternity)", + { + "type": "structured-content", + "content": [ + "(card games) In Doppelkopf, the ace of diamonds, which earns a side of players an extra point if they win it from the other side", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Ich hatte nur vier Trümpfe und darunter beide Füchse." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I had only four trumps and among them were both aces of diamonds." + } + ] + } + } + ] + ] + }, "a fox in radiosport foxhunt" ], 0, @@ -249,8 +320,78 @@ "n", 0, [ - "a clever or cunning person", - "a red-haired person or horse." + { + "type": "structured-content", + "content": [ + "(informal) a clever or cunning person", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Er ist ein ganz schöner Fuchs." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "He is a really handsome fox." + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "(informal) a red-haired person or horse.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Unser Paul ist ja ein kleiner Fuchs." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Our Paul is a little redhead." + } + ] + } + } + ] + ] + } ], 0, "" @@ -267,18 +408,6 @@ 0, "" ], - [ - "Fuchs", - "", - "n masc strong cards", - "n", - 0, - [ - "In Doppelkopf, the ace of diamonds, which earns a side of players an extra point if they win it from the other side" - ], - 0, - "" - ], [ "Fuchs", "", @@ -359,11 +488,270 @@ "prep", 0, [ - "from", - "of, belonging to (often replacing genitive; see usage note below)", - "by (with passive voice)", - "about, of (a topic)", - "on, with (a resource)" + { + "type": "structured-content", + "content": [ + "from", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Ich fahre von Köln nach Hamburg." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I'm travelling from Cologne to Hamburg." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Ich hab’s von meiner Schwester gehört." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I heard it from my sister." + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "of, belonging to (often replacing genitive; see usage note below)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "das Auto meines Vaters = das Auto von meinem Vater" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "my father’s car / the car of my father" + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "by (with passive voice)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Das Hotel wird von der Firma bezahlt." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "The hotel is paid for by the company." + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "about, of (a topic)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Er hat von seiner Jugend erzählt." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "He told about his youth." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Von dem Nomine Substantivo, oder dem Hauptworte." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "About the substantive noun, or the [alternative term]. (headline)" + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "on, with (a resource)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Von welchem Geld soll ich als Arbeitsloser in Urlaub fahren?" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Being unemployed, on what money should I go on holidays?" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Man kann nicht nur von Luft und Liebe leben." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "You can’t live on air and love alone. (proverb)" + } + ] + } + } + ] + ] + } ], 0, "" diff --git a/data/test/dict/en/en/term_bank_1.json b/data/test/dict/en/en/term_bank_1.json index d452b34..163253b 100644 --- a/data/test/dict/en/en/term_bank_1.json +++ b/data/test/dict/en/en/term_bank_1.json @@ -6,7 +6,41 @@ "v", 0, [ - "To transport toward somebody/somewhere." + { + "type": "structured-content", + "content": [ + "(transitive, ditransitive) To transport toward somebody/somewhere.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Waiter, please bring me a single malt whiskey." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], 0, "" @@ -18,7 +52,41 @@ "v", 0, [ - "To supply or contribute." + { + "type": "structured-content", + "content": [ + "(transitive, figuratively) To supply or contribute.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "The new company director brought a fresh perspective on sales and marketing." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], 0, "" @@ -30,7 +98,41 @@ "v", 0, [ - "To occasion or bring about.", + { + "type": "structured-content", + "content": [ + "(transitive) To occasion or bring about.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "The controversial TV broadcast brought a storm of complaints." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + }, "To raise (a lawsuit, charges, etc.) against somebody." ], 0, @@ -44,8 +146,76 @@ 0, [ "To persuade; to induce; to draw; to lead; to guide.", - "To produce in exchange; to sell for; to fetch.", - "(baseball) To pitch, often referring to a particularly hard thrown fastball." + { + "type": "structured-content", + "content": [ + "To produce in exchange; to sell for; to fetch.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "What does coal bring per ton?" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "(baseball) To pitch, often referring to a particularly hard thrown fastball.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "The closer Jones can really bring it." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], 0, "" @@ -57,7 +227,41 @@ "n", 0, [ - "A wagon; a four-wheeled cart for hauling loads, usually pulled by horses or oxen." + { + "type": "structured-content", + "content": [ + "(archaic or literary) A wagon; a four-wheeled cart for hauling loads, usually pulled by horses or oxen.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "\"The Hay Wain\" is a famous painting by John Constable." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], 0, "" diff --git a/data/test/dict/es/en/term_bank_1.json b/data/test/dict/es/en/term_bank_1.json index e6514c8..4cccb1d 100644 --- a/data/test/dict/es/en/term_bank_1.json +++ b/data/test/dict/es/en/term_bank_1.json @@ -7,8 +7,106 @@ 0, [ "to live; to be alive", - "to make a living, to live on", - "to live in, reside, inhabit" + { + "type": "structured-content", + "content": [ + "(intransitive) to make a living, to live on", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Vive de migas, nada más." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "He lives on crumbs, nothing more." + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "(intransitive) to live in, reside, inhabit", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Vive en la casa roja." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "She lives in the red house." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "La pobrecita vive con dos hermanas crueles." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "The poor girl lives with two cruel sisters." + } + ] + } + } + ] + ] + } ], 0, "" diff --git a/data/test/dict/fa/en/term_bank_1.json b/data/test/dict/fa/en/term_bank_1.json index 9e1f608..6accc6f 100644 --- a/data/test/dict/fa/en/term_bank_1.json +++ b/data/test/dict/fa/en/term_bank_1.json @@ -18,9 +18,79 @@ "n", 0, [ - "Persian (the language of modern Iran, Afghanistan and Tajikistan, and widely spoken in Uzbekistan).", + { + "type": "structured-content", + "content": [ + "Persian (the language of modern Iran, Afghanistan and Tajikistan, and widely spoken in Uzbekistan).", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "بَرادَرِ شُوْهَرِش فارْسی بَلَدِه." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Her husband's brother knows Persian." + } + ] + } + } + ] + ] + }, "Persian (the language of Ancient Persia).", - "Persian, main ethnic group of Iran." + { + "type": "structured-content", + "content": [ + "Persian, main ethnic group of Iran.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "فارْسی هَسْتیم." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "We are Persian." + } + ] + } + } + ] + ] + } ], 0, "" diff --git a/data/test/dict/fr/en/term_bank_1.json b/data/test/dict/fr/en/term_bank_1.json index 9b77185..cb1374f 100644 --- a/data/test/dict/fr/en/term_bank_1.json +++ b/data/test/dict/fr/en/term_bank_1.json @@ -6,11 +6,214 @@ "v", 0, [ - "to take", - "to eat; to drink", - "to get; to buy", - "to rob; to deprive", - "to make", + { + "type": "structured-content", + "content": [ + "(transitive) to take", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prends ma main" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "take my hand" + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "(transitive) to eat; to drink", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "elle prend un café" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "she is drinking a coffee" + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "(transitive) to get; to buy", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Je vais prendre le plat du jour." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I'll get the dish of the day." + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "(transitive) to rob; to deprive", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prendre quelque chose à quelqu’un" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to take something from someone" + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "(transitive) to make", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prendre une décision" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to make a decision" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prendre des mesures draconiennes" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to take draconian measures" + } + ] + } + } + ] + ] + }, { "type": "structured-content", "content": [ @@ -61,7 +264,70 @@ "v", 0, [ - "to catch, to work, to start" + { + "type": "structured-content", + "content": [ + "(intransitive) to catch, to work, to start", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "le feu ne prend pas" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "the fire won't start" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "la sauce ne prend pas" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "the sauce isn't thickening" + } + ] + } + } + ] + ] + } ], 0, "" @@ -73,7 +339,70 @@ "v", 0, [ - "to get (something) caught (in), to jam" + { + "type": "structured-content", + "content": [ + "(reflexive) to get (something) caught (in), to jam", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "je me suis pris la main dans la porte" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I caught my hand in the door" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "je me suis pris la porte dans la figure" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "the door hit me in the face" + } + ] + } + } + ] + ] + } ], 0, "" @@ -85,7 +414,70 @@ "v", 0, [ - "(followed by a partitive, in various idiomatic expressions) to gain" + { + "type": "structured-content", + "content": [ + "(followed by a partitive, in various idiomatic expressions) to gain", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prendre de la vitesse" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to gain speed" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prendre du galon" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to gain a promotion" + } + ] + } + } + ] + ] + } ], 0, "" @@ -97,8 +489,78 @@ "v", 0, [ - "(colloquial; impersonal) to take (a certain amount of time)", - "(colloquial; impersonal; by extension) to take (a certain number or amount of)" + { + "type": "structured-content", + "content": [ + "(colloquial; impersonal) to take (a certain amount of time)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Ça va me prendre au moins deux heures pour le mettre à jour." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "It's going to take me at least two hours to update it." + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "(colloquial; impersonal; by extension) to take (a certain number or amount of)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Pour finir dans deux heures, ça prend trois personnes." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "To finish in two hours, it'll take three people." + } + ] + } + } + ] + ] + } ], 0, "" @@ -110,7 +572,70 @@ "v", 0, [ - "to come over (to arise in and gain some control over one's thoughts and/or actions)" + { + "type": "structured-content", + "content": [ + "(impersonal) to come over (to arise in and gain some control over one's thoughts and/or actions)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "il prend [quelque chose] à [quelqu’un]" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "[something] comes over [someone]" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Il lui prend une fantaisie de mettre le feu à la maison." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "A fancy comes over him to set fire to the house." + } + ] + } + } + ] + ] + } ], 0, "" diff --git a/data/test/dict/fr/fr/term_bank_1.json b/data/test/dict/fr/fr/term_bank_1.json index 004b4c6..32c6fd3 100644 --- a/data/test/dict/fr/fr/term_bank_1.json +++ b/data/test/dict/fr/fr/term_bank_1.json @@ -7,7 +7,68 @@ 0, [ "Dans la religion hindouiste, chacune des incarnations du dieu Vishnou.", - "Métamorphose, transformation d’un objet ou d’un individu qui en a déjà subi plusieurs." + { + "type": "structured-content", + "content": [ + "Métamorphose, transformation d’un objet ou d’un individu qui en a déjà subi plusieurs.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Que d’avatars dans la vie politique de cet homme d’État !" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Batman est l’avatar moderne de Zorro." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], 0, "" @@ -19,7 +80,41 @@ "noun", 0, [ - "Mésaventure, malheur." + { + "type": "structured-content", + "content": [ + "Mésaventure, malheur.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Le service social du travail – Avatars d’une fonction, vicissitudes d’un métier" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], 0, "" diff --git a/data/test/dict/ja/en/tag_bank_1.json b/data/test/dict/ja/en/tag_bank_1.json index 5f2c6d3..434986b 100644 --- a/data/test/dict/ja/en/tag_bank_1.json +++ b/data/test/dict/ja/en/tag_bank_1.json @@ -20,13 +20,6 @@ "figuratively", 0 ], - [ - "fig", - "", - 0, - "figurative", - 0 - ], [ "abbv", "", diff --git a/data/test/dict/ja/en/term_bank_1.json b/data/test/dict/ja/en/term_bank_1.json index bacb81e..40cbfcd 100644 --- a/data/test/dict/ja/en/term_bank_1.json +++ b/data/test/dict/ja/en/term_bank_1.json @@ -18,7 +18,70 @@ "adj", 0, [ - "liked, favorite" + { + "type": "structured-content", + "content": [ + "liked, favorite", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "好きな食べ物は? アイスクリームです。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "What's your favorite food? - It's ice cream." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "君が好きだからこそこれほど頑張っているんだよ。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "It's precisely because I like you [because of my fondness for you] that I'm working this hard." + } + ] + } + } + ] + ] + } ], 0, "" @@ -30,7 +93,42 @@ "n", 0, [ - "a raccoon dog, Nyctereutes procyonoides" + { + "type": "structured-content", + "content": [ + "a raccoon dog, Nyctereutes procyonoides", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "アライグマなら尻尾にシマがある。どう見でもタヌキだ。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "If you're a raccoon, you'd have stripes on your tail. No matter how you look at it, you're a raccoon dog." + } + ] + } + } + ] + ] + } ], 0, "" @@ -42,7 +140,42 @@ "n", 0, [ - "a person who pretends to be good but in fact is cunning (compare English sly fox)" + { + "type": "structured-content", + "content": [ + "(figurative) a person who pretends to be good but in fact is cunning (compare English sly fox)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "やいやい、其処な狸め" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Hey there, you sly dog!" + } + ] + } + } + ] + ] + } ], 0, "" @@ -66,7 +199,41 @@ "n", 0, [ - "Short for 狸寝入り (tanuki neiri): pretending to be asleep" + { + "type": "structured-content", + "content": [ + "(rare) Short for 狸寝入り (tanuki neiri): pretending to be asleep", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "狸を決め込む ― tanuki o kimekomu ― pretend to be a raccoon dog → feign sleep" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], 0, "" @@ -145,13 +312,208 @@ } ] }, - "to move smoothly; to slide", + { + "type": "structured-content", + "content": [ + "to move smoothly; to slide", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "刀が鞘から走る。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "The sword slides out of its sheath." + } + ] + } + } + ] + ] + }, "to run away, escape", "to rush, hurry around", - "to give over oneself to; to commit oneself to (usually something bad)", + { + "type": "structured-content", + "content": [ + "to give over oneself to; to commit oneself to (usually something bad)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "彼は敵に走った。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "He defected to the enemy." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "立場を忘れて感情に走ってはいけない。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Don't forget your stance and give in to emotions." + } + ] + } + } + ] + ] + }, "to spread out, scatter, splatter, spout", - "to lead or extend in a certain direction", - "to appear briefly; to flash", + { + "type": "structured-content", + "content": [ + "to lead or extend in a certain direction", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "山脈が南北に走る。\nSanmyaku ga nanboku ni hashiru.\nThe mountain range runs north–south." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "to appear briefly; to flash", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "稲妻が走る" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "lightning flashes by" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "背中に痛みが走った。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I felt a brief pain in my back." + } + ] + } + } + ] + ] + }, "(used with 胸(むね)が (mune ga)) to feel palpitations; to have a sense of unease" ], 0, @@ -164,7 +526,42 @@ "v", 0, [ - "to run through some kind of place" + { + "type": "structured-content", + "content": [ + "(transitive) to run through some kind of place", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "彼はこの道をよく走る。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "He often runs down this street." + } + ] + } + } + ] + ] + } ], 0, "" diff --git a/data/test/dict/la/en/term_bank_1.json b/data/test/dict/la/en/term_bank_1.json index 294da2f..20efd49 100644 --- a/data/test/dict/la/en/term_bank_1.json +++ b/data/test/dict/la/en/term_bank_1.json @@ -7,8 +7,134 @@ 0, [ "fame", - "rumour, talk, opinion, report", - "reputation", + { + "type": "structured-content", + "content": [ + "rumour, talk, opinion, report", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "hascine propter rēs maledicās fāmās ferunt." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Is it on account of these things that they spread slanderous reports?" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "“Oenōtrī coluēre virī; nunc fāma minōrēs" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "“Oenotrian men tilled [the land]; now rumor [has it that their] descendants call the nation ‘Italy’ after the name of its leader, [Italus].”" + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "reputation", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Dīmīcantī dē fāmā dēesse." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "To abandon one whose reputation is attacked." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Fāma tamen clāra est; et adhūc sine crīmine vīxī." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "My good name is nevertheless unstained; and so far I have lived without blame." + } + ] + } + } + ] + ] + }, "Fama, personified as a fast-moving, malicious goddess, the daughter of Terra. From the Greek φήμη, Pheme. Typically translated from the Latin as “Rumor.”" ], 0, @@ -26,7 +152,70 @@ "to collect, gather, bring together", "to take out, pick out, extract, remove", "to take to one's self unjustly, carry off, steal, purloin, plunder, abstract", - "to read" + { + "type": "structured-content", + "content": [ + "to read", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Librōs lege." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Read books." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Lēgistīne hunc librum?" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Have you read this book?" + } + ] + } + } + ] + ] + } ], 0, "" @@ -64,7 +253,42 @@ [ "all the way", "until, up to (sometimes with \"ad\")", - "constantly, continuously" + { + "type": "structured-content", + "content": [ + "constantly, continuously", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "ab ōvō ū̆sque ad māla" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "from the beginning to the end\n(literally, “from the egg to the apples”)" + } + ] + } + } + ] + ] + } ], 0, "" @@ -76,9 +300,79 @@ "v", 0, [ - "led straight along, drawn in a straight line, straight, upright.", + { + "type": "structured-content", + "content": [ + "led straight along, drawn in a straight line, straight, upright.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Quae rectis lineis suos ordines servant" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Which preserve their order in straight lines" + } + ] + } + } + ] + ] + }, "(in general) right, correct, proper, appropriate, befitting.", - "(in particular) morally right, correct, lawful, just, virtuous, noble, good, proper, honest." + { + "type": "structured-content", + "content": [ + "(in particular) morally right, correct, lawful, just, virtuous, noble, good, proper, honest.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Via stultī rēcta in oculīs eius; quī autem sapiēns est audit cōnsilia." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "The way of a fool is right in his own eyes: but he that is wise hearkeneth unto counsels. (Douay-Rheims trans., Challoner rev.: 1752 CE)" + } + ] + } + } + ] + ] + } ], 0, "" @@ -235,8 +529,106 @@ "n", 0, [ - "one's own possessions or resources", - "(in locative case in phrases) peace" + { + "type": "structured-content", + "content": [ + "(idiomatic) one's own possessions or resources", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "domum trahere" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to drag into one's pocket" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Domī versūra fit." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "One is one's own creditor. (proverb)" + } + ] + } + } + ] + ] + }, + { + "type": "structured-content", + "content": [ + "(in locative case in phrases, idiomatic) peace", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "ut non quietior populus domi esset quam militiae" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "so that the people should not become lazier in the time of peace than that of war" + } + ] + } + } + ] + ] + } ], 0, "" diff --git a/data/test/tidy/cs-en-lemmas.json b/data/test/tidy/cs-en-lemmas.json index b609234..cc12ce4 100644 --- a/data/test/tidy/cs-en-lemmas.json +++ b/data/test/tidy/cs-en-lemmas.json @@ -11,18 +11,164 @@ "senses": [ { "glosses": [ - "message" + { + "type": "structured-content", + "content": [ + "message", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "textová zpráva" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "text message" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Chcete nechat zprávu?" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Would you like to leave a message?" + } + ] + } + } + ] + ] + } ], "tags": [ "feminine" + ], + "examples": [ + { + "text": "textová zpráva", + "english": "text message" + }, + { + "text": "Chcete nechat zprávu?", + "english": "Would you like to leave a message?" + } ] }, { "glosses": [ - "report" + { + "type": "structured-content", + "content": [ + "report", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "lékařská zpráva" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "medical report" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "podat zprávu" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to file a report" + } + ] + } + } + ] + ] + } ], "tags": [ "feminine" + ], + "examples": [ + { + "text": "lékařská zpráva", + "english": "medical report" + }, + { + "text": "podat zprávu", + "english": "to file a report" + } ] } ] @@ -41,9 +187,50 @@ "senses": [ { "glosses": [ - "for" + { + "type": "structured-content", + "content": [ + "for", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Zabili ho pro peníze." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "They killed him for his money." + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "Zabili ho pro peníze.", + "english": "They killed him for his money." + } + ] } ] } @@ -67,7 +254,8 @@ "imperfective", "reflexive", "with se" - ] + ], + "examples": [] } ] } diff --git a/data/test/tidy/de-en-lemmas.json b/data/test/tidy/de-en-lemmas.json index 27e4383..f3cc615 100644 --- a/data/test/tidy/de-en-lemmas.json +++ b/data/test/tidy/de-en-lemmas.json @@ -112,6 +112,16 @@ "class-4", "strong", "transitive" + ], + "examples": [ + { + "text": "jemanden gesund pflegen", + "english": "to nurse someone back to health" + }, + { + "text": "Kranke pflegen", + "english": "to care for the sick" + } ] }, { @@ -188,7 +198,8 @@ "tags": [ "class-4", "strong" - ] + ], + "examples": [] }, { "glosses": [ @@ -251,6 +262,16 @@ "tags": [ "class-4", "strong" + ], + "examples": [ + { + "text": "Umgang pflegen", + "english": "to regularly be in contact" + }, + { + "text": "Geselligkeit pflegen", + "english": "to socialize regularly (literally, “to regularly engage in gregariousness”)" + } ] } ] @@ -269,31 +290,154 @@ "senses": [ { "glosses": [ - "fox (animal)" + { + "type": "structured-content", + "content": [ + "fox (animal)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Fuchs, du hast die Gans gestohlen. Gib sie wieder her!" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "(line from a popular children’s song)" + } + ] + } + } + ] + ] + } ], "tags": [ "masculine", "strong" + ], + "examples": [ + { + "text": "Fuchs, du hast die Gans gestohlen. Gib sie wieder her!", + "english": "(line from a popular children’s song)" + } ] }, { "glosses": [ - "(informal) a clever or cunning person" + { + "type": "structured-content", + "content": [ + "(informal) a clever or cunning person", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Er ist ein ganz schöner Fuchs." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "He is a really handsome fox." + } + ] + } + } + ] + ] + } ], "tags": [ "informal", "masculine", "strong" + ], + "examples": [ + { + "text": "Er ist ein ganz schöner Fuchs.", + "english": "He is a really handsome fox." + } ] }, { "glosses": [ - "(informal) a red-haired person or horse." + { + "type": "structured-content", + "content": [ + "(informal) a red-haired person or horse.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Unser Paul ist ja ein kleiner Fuchs." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Our Paul is a little redhead." + } + ] + } + } + ] + ] + } ], "tags": [ "informal", "masculine", "strong" + ], + "examples": [ + { + "text": "Unser Paul ist ja ein kleiner Fuchs.", + "english": "Our Paul is a little redhead." + } ] }, { @@ -303,7 +447,8 @@ "tags": [ "masculine", "strong" - ] + ], + "examples": [] }, { "glosses": [ @@ -313,15 +458,57 @@ "masculine", "slang", "strong" - ] + ], + "examples": [] }, { "glosses": [ - "(card games) In Doppelkopf, the ace of diamonds, which earns a side of players an extra point if they win it from the other side" + { + "type": "structured-content", + "content": [ + "(card games) In Doppelkopf, the ace of diamonds, which earns a side of players an extra point if they win it from the other side", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Ich hatte nur vier Trümpfe und darunter beide Füchse." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I had only four trumps and among them were both aces of diamonds." + } + ] + } + } + ] + ] + } ], "tags": [ "masculine", "strong" + ], + "examples": [ + { + "text": "Ich hatte nur vier Trümpfe und darunter beide Füchse.", + "english": "I had only four trumps and among them were both aces of diamonds." + } ] }, { @@ -331,7 +518,8 @@ "tags": [ "masculine", "strong" - ] + ], + "examples": [] }, { "glosses": [ @@ -341,7 +529,8 @@ "archaic", "masculine", "strong" - ] + ], + "examples": [] }, { "glosses": [ @@ -350,7 +539,8 @@ "tags": [ "masculine", "strong" - ] + ], + "examples": [] }, { "glosses": [ @@ -360,7 +550,8 @@ "masculine", "obsolete", "strong" - ] + ], + "examples": [] } ] } @@ -392,7 +583,8 @@ "also", "neuter", "rare" - ] + ], + "examples": [] }, { "glosses": [ @@ -402,7 +594,8 @@ "also", "neuter", "rare" - ] + ], + "examples": [] }, { "glosses": [ @@ -412,7 +605,8 @@ "also", "neuter", "rare" - ] + ], + "examples": [] } ] } @@ -437,7 +631,8 @@ "form-of", "masculine", "strong" - ] + ], + "examples": [] } ] } @@ -459,33 +654,334 @@ "senses": [ { "glosses": [ - "from" + { + "type": "structured-content", + "content": [ + "from", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Ich fahre von Köln nach Hamburg." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I'm travelling from Cologne to Hamburg." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Ich hab’s von meiner Schwester gehört." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I heard it from my sister." + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "Ich fahre von Köln nach Hamburg.", + "english": "I'm travelling from Cologne to Hamburg." + }, + { + "text": "Ich hab’s von meiner Schwester gehört.", + "english": "I heard it from my sister." + } + ] }, { "glosses": [ - "of, belonging to (often replacing genitive; see usage note below)" + { + "type": "structured-content", + "content": [ + "of, belonging to (often replacing genitive; see usage note below)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "das Auto meines Vaters = das Auto von meinem Vater" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "my father’s car / the car of my father" + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "das Auto meines Vaters = das Auto von meinem Vater", + "english": "my father’s car / the car of my father" + } + ] }, { "glosses": [ - "by (with passive voice)" + { + "type": "structured-content", + "content": [ + "by (with passive voice)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Das Hotel wird von der Firma bezahlt." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "The hotel is paid for by the company." + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "Das Hotel wird von der Firma bezahlt.", + "english": "The hotel is paid for by the company." + } + ] }, { "glosses": [ - "about, of (a topic)" + { + "type": "structured-content", + "content": [ + "about, of (a topic)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Er hat von seiner Jugend erzählt." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "He told about his youth." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Von dem Nomine Substantivo, oder dem Hauptworte." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "About the substantive noun, or the [alternative term]. (headline)" + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "Er hat von seiner Jugend erzählt.", + "english": "He told about his youth." + }, + { + "text": "Von dem Nomine Substantivo, oder dem Hauptworte.", + "english": "About the substantive noun, or the [alternative term]. (headline)" + } + ] }, { "glosses": [ - "on, with (a resource)" + { + "type": "structured-content", + "content": [ + "on, with (a resource)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Von welchem Geld soll ich als Arbeitsloser in Urlaub fahren?" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Being unemployed, on what money should I go on holidays?" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Man kann nicht nur von Luft und Liebe leben." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "You can’t live on air and love alone. (proverb)" + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "Von welchem Geld soll ich als Arbeitsloser in Urlaub fahren?", + "english": "Being unemployed, on what money should I go on holidays?" + }, + { + "text": "Man kann nicht nur von Luft und Liebe leben.", + "english": "You can’t live on air and love alone. (proverb)" + } + ] } ] } diff --git a/data/test/tidy/en-de-lemmas.json b/data/test/tidy/en-de-lemmas.json index 36a8d03..b2eb29b 100644 --- a/data/test/tidy/en-de-lemmas.json +++ b/data/test/tidy/en-de-lemmas.json @@ -13,7 +13,8 @@ "glosses": [ "[1] aussuchen, auswählen, vorziehen, wählen" ], - "tags": [] + "tags": [], + "examples": [] } ] } diff --git a/data/test/tidy/en-en-lemmas.json b/data/test/tidy/en-en-lemmas.json index dae6f58..60001da 100644 --- a/data/test/tidy/en-en-lemmas.json +++ b/data/test/tidy/en-en-lemmas.json @@ -11,28 +11,145 @@ "senses": [ { "glosses": [ - "(transitive, ditransitive) To transport toward somebody/somewhere." + { + "type": "structured-content", + "content": [ + "(transitive, ditransitive) To transport toward somebody/somewhere.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Waiter, please bring me a single malt whiskey." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], "tags": [ "ditransitive", "transitive" + ], + "examples": [ + { + "text": "Waiter, please bring me a single malt whiskey." + } ] }, { "glosses": [ - "(transitive, figuratively) To supply or contribute." + { + "type": "structured-content", + "content": [ + "(transitive, figuratively) To supply or contribute.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "The new company director brought a fresh perspective on sales and marketing." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], "tags": [ "figuratively", "transitive" + ], + "examples": [ + { + "text": "The new company director brought a fresh perspective on sales and marketing." + } ] }, { "glosses": [ - "(transitive) To occasion or bring about." + { + "type": "structured-content", + "content": [ + "(transitive) To occasion or bring about.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "The controversial TV broadcast brought a storm of complaints." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], "tags": [ "transitive" + ], + "examples": [ + { + "text": "The controversial TV broadcast brought a storm of complaints." + } ] }, { @@ -41,25 +158,105 @@ ], "tags": [ "transitive" - ] + ], + "examples": [] }, { "glosses": [ "To persuade; to induce; to draw; to lead; to guide." ], - "tags": [] + "tags": [], + "examples": [] }, { "glosses": [ - "To produce in exchange; to sell for; to fetch." + { + "type": "structured-content", + "content": [ + "To produce in exchange; to sell for; to fetch.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "What does coal bring per ton?" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "What does coal bring per ton?" + } + ] }, { "glosses": [ - "(baseball) To pitch, often referring to a particularly hard thrown fastball." + { + "type": "structured-content", + "content": [ + "(baseball) To pitch, often referring to a particularly hard thrown fastball.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "The closer Jones can really bring it." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "The closer Jones can really bring it." + } + ] } ] } @@ -77,11 +274,50 @@ "senses": [ { "glosses": [ - "(archaic or literary) A wagon; a four-wheeled cart for hauling loads, usually pulled by horses or oxen." + { + "type": "structured-content", + "content": [ + "(archaic or literary) A wagon; a four-wheeled cart for hauling loads, usually pulled by horses or oxen.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "\"The Hay Wain\" is a famous painting by John Constable." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], "tags": [ "archaic", "literary" + ], + "examples": [ + { + "text": "\"The Hay Wain\" is a famous painting by John Constable." + } ] } ] diff --git a/data/test/tidy/es-en-lemmas.json b/data/test/tidy/es-en-lemmas.json index 7b71054..9db675b 100644 --- a/data/test/tidy/es-en-lemmas.json +++ b/data/test/tidy/es-en-lemmas.json @@ -19,22 +19,137 @@ ], "tags": [ "intransitive" - ] + ], + "examples": [] }, { "glosses": [ - "(intransitive) to make a living, to live on" + { + "type": "structured-content", + "content": [ + "(intransitive) to make a living, to live on", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Vive de migas, nada más." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "He lives on crumbs, nothing more." + } + ] + } + } + ] + ] + } ], "tags": [ "intransitive" + ], + "examples": [ + { + "text": "Vive de migas, nada más.", + "english": "He lives on crumbs, nothing more." + } ] }, { "glosses": [ - "(intransitive) to live in, reside, inhabit" + { + "type": "structured-content", + "content": [ + "(intransitive) to live in, reside, inhabit", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Vive en la casa roja." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "She lives in the red house." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "La pobrecita vive con dos hermanas crueles." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "The poor girl lives with two cruel sisters." + } + ] + } + } + ] + ] + } ], "tags": [ "intransitive" + ], + "examples": [ + { + "text": "Vive en la casa roja.", + "english": "She lives in the red house." + }, + { + "text": "La pobrecita vive con dos hermanas crueles.", + "english": "The poor girl lives with two cruel sisters." + } ] }, { @@ -43,7 +158,8 @@ ], "tags": [ "transitive" - ] + ], + "examples": [] } ] } diff --git a/data/test/tidy/fa-en-lemmas.json b/data/test/tidy/fa-en-lemmas.json index 6452fd6..2fb8f34 100644 --- a/data/test/tidy/fa-en-lemmas.json +++ b/data/test/tidy/fa-en-lemmas.json @@ -31,7 +31,8 @@ ], "tags": [ "Khorasan" - ] + ], + "examples": [] } ] } @@ -78,21 +79,104 @@ "senses": [ { "glosses": [ - "Persian (the language of modern Iran, Afghanistan and Tajikistan, and widely spoken in Uzbekistan)." + { + "type": "structured-content", + "content": [ + "Persian (the language of modern Iran, Afghanistan and Tajikistan, and widely spoken in Uzbekistan).", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "بَرادَرِ شُوْهَرِش فارْسی بَلَدِه." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Her husband's brother knows Persian." + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "بَرادَرِ شُوْهَرِش فارْسی بَلَدِه.", + "english": "Her husband's brother knows Persian." + } + ] }, { "glosses": [ "Persian (the language of Ancient Persia)." ], - "tags": [] + "tags": [], + "examples": [] }, { "glosses": [ - "Persian, main ethnic group of Iran." + { + "type": "structured-content", + "content": [ + "Persian, main ethnic group of Iran.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "فارْسی هَسْتیم." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "We are Persian." + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "فارْسی هَسْتیم.", + "english": "We are Persian." + } + ] } ] } diff --git a/data/test/tidy/fr-en-lemmas.json b/data/test/tidy/fr-en-lemmas.json index 00d9aa8..fc91d37 100644 --- a/data/test/tidy/fr-en-lemmas.json +++ b/data/test/tidy/fr-en-lemmas.json @@ -11,58 +11,441 @@ "senses": [ { "glosses": [ - "(transitive) to take" + { + "type": "structured-content", + "content": [ + "(transitive) to take", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prends ma main" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "take my hand" + } + ] + } + } + ] + ] + } ], "tags": [ "transitive" + ], + "examples": [ + { + "text": "prends ma main", + "english": "take my hand" + } ] }, { "glosses": [ - "(transitive) to eat; to drink" + { + "type": "structured-content", + "content": [ + "(transitive) to eat; to drink", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "elle prend un café" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "she is drinking a coffee" + } + ] + } + } + ] + ] + } ], "tags": [ "transitive" + ], + "examples": [ + { + "text": "elle prend un café", + "english": "she is drinking a coffee" + } ] }, { "glosses": [ - "(transitive) to get; to buy" + { + "type": "structured-content", + "content": [ + "(transitive) to get; to buy", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Je vais prendre le plat du jour." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I'll get the dish of the day." + } + ] + } + } + ] + ] + } ], "tags": [ "transitive" + ], + "examples": [ + { + "text": "Je vais prendre le plat du jour.", + "english": "I'll get the dish of the day." + } ] }, { "glosses": [ - "(transitive) to rob; to deprive" + { + "type": "structured-content", + "content": [ + "(transitive) to rob; to deprive", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prendre quelque chose à quelqu’un" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to take something from someone" + } + ] + } + } + ] + ] + } ], "tags": [ "transitive" + ], + "examples": [ + { + "text": "prendre quelque chose à quelqu’un", + "english": "to take something from someone" + } ] }, { "glosses": [ - "(transitive) to make" + { + "type": "structured-content", + "content": [ + "(transitive) to make", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prendre une décision" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to make a decision" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prendre des mesures draconiennes" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to take draconian measures" + } + ] + } + } + ] + ] + } ], "tags": [ "transitive" + ], + "examples": [ + { + "text": "prendre une décision", + "english": "to make a decision" + }, + { + "text": "prendre des mesures draconiennes", + "english": "to take draconian measures" + } ] }, { "glosses": [ - "(intransitive) to catch, to work, to start" + { + "type": "structured-content", + "content": [ + "(intransitive) to catch, to work, to start", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "le feu ne prend pas" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "the fire won't start" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "la sauce ne prend pas" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "the sauce isn't thickening" + } + ] + } + } + ] + ] + } ], "tags": [ "intransitive" + ], + "examples": [ + { + "text": "le feu ne prend pas", + "english": "the fire won't start" + }, + { + "text": "la sauce ne prend pas", + "english": "the sauce isn't thickening" + } ] }, { "glosses": [ - "(reflexive) to get (something) caught (in), to jam" + { + "type": "structured-content", + "content": [ + "(reflexive) to get (something) caught (in), to jam", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "je me suis pris la main dans la porte" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I caught my hand in the door" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "je me suis pris la porte dans la figure" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "the door hit me in the face" + } + ] + } + } + ] + ] + } ], "tags": [ "reflexive" + ], + "examples": [ + { + "text": "je me suis pris la main dans la porte", + "english": "I caught my hand in the door" + }, + { + "text": "je me suis pris la porte dans la figure", + "english": "the door hit me in the face" + } ] }, { @@ -111,42 +494,280 @@ "in various idiomatic expressions", "transitive", "with à" + ], + "examples": [ + { + "text": "Qu’est-ce qui t’a pris ? Qu’est-ce qui t’est passé par la tête ?", + "english": "What were you thinking? What got into you? What came over you?" + }, + { + "text": "Qu’est-ce qui lui a pris ? Quelle mouche l’a piqué ?", + "english": "What was he thinking? What got into him?" + } ] }, { "glosses": [ - "(followed by a partitive, in various idiomatic expressions) to gain" + { + "type": "structured-content", + "content": [ + "(followed by a partitive, in various idiomatic expressions) to gain", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prendre de la vitesse" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to gain speed" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "prendre du galon" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to gain a promotion" + } + ] + } + } + ] + ] + } ], "tags": [ "followed by a partitive", "in various idiomatic expressions" + ], + "examples": [ + { + "text": "prendre de la vitesse", + "english": "to gain speed" + }, + { + "text": "prendre du galon", + "english": "to gain a promotion" + } ] }, { "glosses": [ - "(colloquial; impersonal) to take (a certain amount of time)" + { + "type": "structured-content", + "content": [ + "(colloquial; impersonal) to take (a certain amount of time)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Ça va me prendre au moins deux heures pour le mettre à jour." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "It's going to take me at least two hours to update it." + } + ] + } + } + ] + ] + } ], "tags": [ "colloquial", "impersonal" + ], + "examples": [ + { + "text": "Ça va me prendre au moins deux heures pour le mettre à jour.", + "english": "It's going to take me at least two hours to update it." + } ] }, { "glosses": [ - "(colloquial; impersonal; by extension) to take (a certain number or amount of)" + { + "type": "structured-content", + "content": [ + "(colloquial; impersonal; by extension) to take (a certain number or amount of)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Pour finir dans deux heures, ça prend trois personnes." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "To finish in two hours, it'll take three people." + } + ] + } + } + ] + ] + } ], "tags": [ "broadly", "colloquial", "impersonal" + ], + "examples": [ + { + "text": "Pour finir dans deux heures, ça prend trois personnes.", + "english": "To finish in two hours, it'll take three people." + } ] }, { "glosses": [ - "(impersonal) to come over (to arise in and gain some control over one's thoughts and/or actions)" + { + "type": "structured-content", + "content": [ + "(impersonal) to come over (to arise in and gain some control over one's thoughts and/or actions)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "il prend [quelque chose] à [quelqu’un]" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "[something] comes over [someone]" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Il lui prend une fantaisie de mettre le feu à la maison." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "A fancy comes over him to set fire to the house." + } + ] + } + } + ] + ] + } ], "tags": [ "impersonal" + ], + "examples": [ + { + "text": "il prend [quelque chose] à [quelqu’un]", + "english": "[something] comes over [someone]" + }, + { + "text": "Il lui prend une fantaisie de mettre le feu à la maison.", + "english": "A fancy comes over him to set fire to the house." + } ] } ] @@ -170,7 +791,8 @@ "tags": [ "impersonal", "intransitive" - ] + ], + "examples": [] }, { "glosses": [ @@ -178,7 +800,8 @@ ], "tags": [ "intransitive" - ] + ], + "examples": [] } ] } @@ -286,7 +909,8 @@ ], "tags": [ "feminine" - ] + ], + "examples": [] } ] } diff --git a/data/test/tidy/fr-fr-lemmas.json b/data/test/tidy/fr-fr-lemmas.json index dda9d75..e3b72fc 100644 --- a/data/test/tidy/fr-fr-lemmas.json +++ b/data/test/tidy/fr-fr-lemmas.json @@ -15,23 +15,132 @@ ], "tags": [ "Hindouisme" - ] + ], + "examples": [] }, { "glosses": [ - "Métamorphose, transformation d’un objet ou d’un individu qui en a déjà subi plusieurs." + { + "type": "structured-content", + "content": [ + "Métamorphose, transformation d’un objet ou d’un individu qui en a déjà subi plusieurs.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Que d’avatars dans la vie politique de cet homme d’État !" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Batman est l’avatar moderne de Zorro." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], "tags": [ "figuratively" + ], + "examples": [ + { + "text": "Que d’avatars dans la vie politique de cet homme d’État !" + }, + { + "text": "Batman est l’avatar moderne de Zorro." + } ] }, { "glosses": [ - "Mésaventure, malheur." + { + "type": "structured-content", + "content": [ + "Mésaventure, malheur.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Le service social du travail – Avatars d’une fonction, vicissitudes d’un métier" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], "tags": [ "broadly", "Utilisé à tort" + ], + "examples": [ + { + "text": "Le service social du travail – Avatars d’une fonction, vicissitudes d’un métier" + } ] } ] diff --git a/data/test/tidy/ja-en-lemmas.json b/data/test/tidy/ja-en-lemmas.json index b83aac5..88f5ba9 100644 --- a/data/test/tidy/ja-en-lemmas.json +++ b/data/test/tidy/ja-en-lemmas.json @@ -13,7 +13,8 @@ "glosses": [ "pleasant, delightful, fun, enjoyable" ], - "tags": [] + "tags": [], + "examples": [] } ] } @@ -39,9 +40,82 @@ "senses": [ { "glosses": [ - "liked, favorite" + { + "type": "structured-content", + "content": [ + "liked, favorite", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "好きな食べ物は? アイスクリームです。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "What's your favorite food? - It's ice cream." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "君が好きだからこそこれほど頑張っているんだよ。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "It's precisely because I like you [because of my fondness for you] that I'm working this hard." + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "好きな食べ物は? アイスクリームです。", + "english": "What's your favorite food? - It's ice cream." + }, + { + "text": "君が好きだからこそこれほど頑張っているんだよ。", + "english": "It's precisely because I like you [because of my fondness for you] that I'm working this hard." + } + ] } ] } @@ -59,16 +133,98 @@ "senses": [ { "glosses": [ - "a raccoon dog, Nyctereutes procyonoides" + { + "type": "structured-content", + "content": [ + "a raccoon dog, Nyctereutes procyonoides", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "アライグマなら尻尾にシマがある。どう見でもタヌキだ。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "If you're a raccoon, you'd have stripes on your tail. No matter how you look at it, you're a raccoon dog." + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "アライグマなら尻尾にシマがある。どう見でもタヌキだ。", + "english": "If you're a raccoon, you'd have stripes on your tail. No matter how you look at it, you're a raccoon dog." + } + ] }, { "glosses": [ - "(figurative) a person who pretends to be good but in fact is cunning (compare English sly fox)" + { + "type": "structured-content", + "content": [ + "(figurative) a person who pretends to be good but in fact is cunning (compare English sly fox)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "やいやい、其処な狸め" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Hey there, you sly dog!" + } + ] + } + } + ] + ] + } ], "tags": [ "figuratively" + ], + "examples": [ + { + "text": "やいやい、其処な狸め", + "english": "Hey there, you sly dog!" + } ] }, { @@ -78,16 +234,56 @@ "tags": [ "abbreviation", "alt-of" - ] + ], + "examples": [] }, { "glosses": [ - "(rare) Short for 狸寝入り (tanuki neiri): pretending to be asleep" + { + "type": "structured-content", + "content": [ + "(rare) Short for 狸寝入り (tanuki neiri): pretending to be asleep", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "狸を決め込む ― tanuki o kimekomu ― pretend to be a raccoon dog → feign sleep" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], "tags": [ "abbreviation", "alt-of", "rare" + ], + "examples": [ + { + "text": "狸を決め込む ― tanuki o kimekomu ― pretend to be a raccoon dog → feign sleep" + } ] }, { @@ -99,7 +295,8 @@ "alt-of", "obsolete", "rare" - ] + ], + "examples": [] } ] } @@ -173,57 +370,333 @@ ] } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "車が走っている。", + "english": "A car is running. / Cars are running." + } + ] }, { "glosses": [ - "(transitive) to run through some kind of place" + { + "type": "structured-content", + "content": [ + "(transitive) to run through some kind of place", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "彼はこの道をよく走る。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "He often runs down this street." + } + ] + } + } + ] + ] + } ], "tags": [ "transitive" + ], + "examples": [ + { + "text": "彼はこの道をよく走る。", + "english": "He often runs down this street." + } ] }, { "glosses": [ - "to move smoothly; to slide" + { + "type": "structured-content", + "content": [ + "to move smoothly; to slide", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "刀が鞘から走る。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "The sword slides out of its sheath." + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "刀が鞘から走る。", + "english": "The sword slides out of its sheath." + } + ] }, { "glosses": [ "to run away, escape" ], - "tags": [] + "tags": [], + "examples": [] }, { "glosses": [ "to rush, hurry around" ], - "tags": [] + "tags": [], + "examples": [] }, { "glosses": [ - "to give over oneself to; to commit oneself to (usually something bad)" + { + "type": "structured-content", + "content": [ + "to give over oneself to; to commit oneself to (usually something bad)", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "彼は敵に走った。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "He defected to the enemy." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "立場を忘れて感情に走ってはいけない。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Don't forget your stance and give in to emotions." + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "彼は敵に走った。", + "english": "He defected to the enemy." + }, + { + "text": "立場を忘れて感情に走ってはいけない。", + "english": "Don't forget your stance and give in to emotions." + } + ] }, { "glosses": [ "to spread out, scatter, splatter, spout" ], - "tags": [] + "tags": [], + "examples": [] }, { "glosses": [ - "to lead or extend in a certain direction" + { + "type": "structured-content", + "content": [ + "to lead or extend in a certain direction", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "山脈が南北に走る。\nSanmyaku ga nanboku ni hashiru.\nThe mountain range runs north–south." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + } + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "山脈が南北に走る。\nSanmyaku ga nanboku ni hashiru.\nThe mountain range runs north–south." + } + ] }, { "glosses": [ - "to appear briefly; to flash" + { + "type": "structured-content", + "content": [ + "to appear briefly; to flash", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "稲妻が走る" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "lightning flashes by" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "背中に痛みが走った。" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "I felt a brief pain in my back." + } + ] + } + } + ] + ] + } ], - "tags": [] + "tags": [], + "examples": [ + { + "text": "稲妻が走る", + "english": "lightning flashes by" + }, + { + "text": "背中に痛みが走った。", + "english": "I felt a brief pain in my back." + } + ] }, { "glosses": [ @@ -231,7 +704,8 @@ ], "tags": [ "used with 胸(むね)が (mune ga)" - ] + ], + "examples": [] }, { "glosses": [ @@ -239,7 +713,8 @@ ], "tags": [ "euphemistic" - ] + ], + "examples": [] }, { "glosses": [ @@ -248,7 +723,8 @@ "tags": [ "alt-of", "alternative" - ] + ], + "examples": [] } ] } @@ -272,13 +748,15 @@ "glosses": [ "five colors (usu. red (赤), blue (青), yellow (黄), white (白) and black (黒))" ], - "tags": [] + "tags": [], + "examples": [] }, { "glosses": [ "melon, gourd" ], - "tags": [] + "tags": [], + "examples": [] } ] } @@ -300,13 +778,15 @@ "glosses": [ "five colors (usu. red (赤), blue (青), yellow (黄), white (白) and black (黒))" ], - "tags": [] + "tags": [], + "examples": [] }, { "glosses": [ "melon, gourd" ], - "tags": [] + "tags": [], + "examples": [] } ] } @@ -326,7 +806,8 @@ "glosses": [ "[I am / someone is] hungry" ], - "tags": [] + "tags": [], + "examples": [] } ] } diff --git a/data/test/tidy/la-en-lemmas.json b/data/test/tidy/la-en-lemmas.json index d420da6..2566c0f 100644 --- a/data/test/tidy/la-en-lemmas.json +++ b/data/test/tidy/la-en-lemmas.json @@ -29,22 +29,169 @@ ], "tags": [ "declension-1" - ] + ], + "examples": [] }, { "glosses": [ - "rumour, talk, opinion, report" + { + "type": "structured-content", + "content": [ + "rumour, talk, opinion, report", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "hascine propter rēs maledicās fāmās ferunt." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Is it on account of these things that they spread slanderous reports?" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "“Oenōtrī coluēre virī; nunc fāma minōrēs" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "“Oenotrian men tilled [the land]; now rumor [has it that their] descendants call the nation ‘Italy’ after the name of its leader, [Italus].”" + } + ] + } + } + ] + ] + } ], "tags": [ "declension-1" + ], + "examples": [ + { + "text": "hascine propter rēs maledicās fāmās ferunt.", + "english": "Is it on account of these things that they spread slanderous reports?" + }, + { + "text": "“Oenōtrī coluēre virī; nunc fāma minōrēs", + "english": "“Oenotrian men tilled [the land]; now rumor [has it that their] descendants call the nation ‘Italy’ after the name of its leader, [Italus].”" + } ] }, { "glosses": [ - "reputation" + { + "type": "structured-content", + "content": [ + "reputation", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Dīmīcantī dē fāmā dēesse." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "To abandon one whose reputation is attacked." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Fāma tamen clāra est; et adhūc sine crīmine vīxī." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "My good name is nevertheless unstained; and so far I have lived without blame." + } + ] + } + } + ] + ] + } ], "tags": [ "declension-1" + ], + "examples": [ + { + "text": "Dīmīcantī dē fāmā dēesse.", + "english": "To abandon one whose reputation is attacked." + }, + { + "text": "Fāma tamen clāra est; et adhūc sine crīmine vīxī.", + "english": "My good name is nevertheless unstained; and so far I have lived without blame." + } ] }, { @@ -53,7 +200,8 @@ ], "tags": [ "declension-1" - ] + ], + "examples": [] } ] } @@ -95,7 +243,8 @@ ], "tags": [ "conjugation-3" - ] + ], + "examples": [] }, { "glosses": [ @@ -103,7 +252,8 @@ ], "tags": [ "conjugation-3" - ] + ], + "examples": [] }, { "glosses": [ @@ -111,7 +261,8 @@ ], "tags": [ "conjugation-3" - ] + ], + "examples": [] }, { "glosses": [ @@ -119,7 +270,8 @@ ], "tags": [ "conjugation-3" - ] + ], + "examples": [] }, { "glosses": [ @@ -127,14 +279,88 @@ ], "tags": [ "conjugation-3" - ] + ], + "examples": [] }, { "glosses": [ - "to read" + { + "type": "structured-content", + "content": [ + "to read", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Librōs lege." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Read books." + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Lēgistīne hunc librum?" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Have you read this book?" + } + ] + } + } + ] + ] + } ], "tags": [ "conjugation-3" + ], + "examples": [ + { + "text": "Librōs lege.", + "english": "Read books." + }, + { + "text": "Lēgistīne hunc librum?", + "english": "Have you read this book?" + } ] }, { @@ -144,7 +370,8 @@ "tags": [ "Medieval-Latin", "conjugation-3" - ] + ], + "examples": [] } ] } @@ -186,7 +413,8 @@ ], "tags": [ "declension-2" - ] + ], + "examples": [] } ] } @@ -240,7 +468,8 @@ ], "tags": [ "not-comparable" - ] + ], + "examples": [] }, { "glosses": [ @@ -248,14 +477,56 @@ ], "tags": [ "not-comparable" - ] + ], + "examples": [] }, { "glosses": [ - "constantly, continuously" + { + "type": "structured-content", + "content": [ + "constantly, continuously", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "ab ōvō ū̆sque ad māla" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "from the beginning to the end\n(literally, “from the egg to the apples”)" + } + ] + } + } + ] + ] + } ], "tags": [ "not-comparable" + ], + "examples": [ + { + "text": "ab ōvō ū̆sque ad māla", + "english": "from the beginning to the end\n(literally, “from the egg to the apples”)" + } ] } ] @@ -294,7 +565,42 @@ "senses": [ { "glosses": [ - "led straight along, drawn in a straight line, straight, upright." + { + "type": "structured-content", + "content": [ + "led straight along, drawn in a straight line, straight, upright.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Quae rectis lineis suos ordines servant" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "Which preserve their order in straight lines" + } + ] + } + } + ] + ] + } ], "tags": [ "declension-1", @@ -303,6 +609,12 @@ "participle", "passive", "perfect" + ], + "examples": [ + { + "text": "Quae rectis lineis suos ordines servant", + "english": "Which preserve their order in straight lines" + } ] }, { @@ -317,11 +629,47 @@ "passive", "perfect", "usually" - ] + ], + "examples": [] }, { "glosses": [ - "(in particular) morally right, correct, lawful, just, virtuous, noble, good, proper, honest." + { + "type": "structured-content", + "content": [ + "(in particular) morally right, correct, lawful, just, virtuous, noble, good, proper, honest.", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Via stultī rēcta in oculīs eius; quī autem sapiēns est audit cōnsilia." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "The way of a fool is right in his own eyes: but he that is wise hearkeneth unto counsels. (Douay-Rheims trans., Challoner rev.: 1752 CE)" + } + ] + } + } + ] + ] + } ], "tags": [ "declension-1", @@ -331,6 +679,12 @@ "participle", "passive", "perfect" + ], + "examples": [ + { + "text": "Via stultī rēcta in oculīs eius; quī autem sapiēns est audit cōnsilia.", + "english": "The way of a fool is right in his own eyes: but he that is wise hearkeneth unto counsels. (Douay-Rheims trans., Challoner rev.: 1752 CE)" + } ] } ] @@ -408,6 +762,16 @@ "declension-4", "feminine", "irregular" + ], + "examples": [ + { + "text": "Deō domuīque", + "english": "For God and for home (motto of Methodist Ladies' College, Melbourne)" + }, + { + "text": "Stet fortūna domūs", + "english": "Let the good fortune of the house stand (motto of Harrow School, England)" + } ] }, { @@ -419,7 +783,8 @@ "declension-4", "feminine", "irregular" - ] + ], + "examples": [] }, { "glosses": [ @@ -468,7 +833,8 @@ "declension-4", "feminine", "irregular" - ] + ], + "examples": [] }, { "glosses": [ @@ -533,11 +899,75 @@ "declension-4", "feminine", "irregular" - ] + ], + "examples": [] }, { "glosses": [ - "(idiomatic) one's own possessions or resources" + { + "type": "structured-content", + "content": [ + "(idiomatic) one's own possessions or resources", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "domum trahere" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "to drag into one's pocket" + } + ] + } + }, + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "Domī versūra fit." + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "One is one's own creditor. (proverb)" + } + ] + } + } + ] + ] + } ], "tags": [ "declension-2", @@ -545,11 +975,56 @@ "feminine", "idiomatic", "irregular" + ], + "examples": [ + { + "text": "domum trahere", + "english": "to drag into one's pocket" + }, + { + "text": "Domī versūra fit.", + "english": "One is one's own creditor. (proverb)" + } ] }, { "glosses": [ - "(in locative case in phrases, idiomatic) peace" + { + "type": "structured-content", + "content": [ + "(in locative case in phrases, idiomatic) peace", + [ + { + "tag": "div", + "data": { + "content": "extra-info" + }, + "content": { + "tag": "div", + "data": { + "content": "example-sentence" + }, + "content": [ + { + "tag": "div", + "data": { + "content": "example-sentence-a" + }, + "content": "ut non quietior populus domi esset quam militiae" + }, + { + "tag": "div", + "data": { + "content": "example-sentence-b" + }, + "content": "so that the people should not become lazier in the time of peace than that of war" + } + ] + } + } + ] + ] + } ], "tags": [ "declension-2", @@ -558,6 +1033,12 @@ "idiomatic", "irregular", "in locative case in phrases" + ], + "examples": [ + { + "text": "ut non quietior populus domi esset quam militiae", + "english": "so that the people should not become lazier in the time of peace than that of war" + } ] } ] diff --git a/data/test/tidy/sq-en-lemmas.json b/data/test/tidy/sq-en-lemmas.json index b8482da..a17281f 100644 --- a/data/test/tidy/sq-en-lemmas.json +++ b/data/test/tidy/sq-en-lemmas.json @@ -15,7 +15,8 @@ ], "tags": [ "masculine" - ] + ], + "examples": [] } ] } @@ -140,6 +141,16 @@ ], "tags": [ "feminine" + ], + "examples": [ + { + "text": "Mbaje gjuhën!", + "english": "Hold your tongue!" + }, + { + "text": "E ka gjuhën të gjatë.", + "english": "(literally, “She has a long tongue.”)" + } ] }, { @@ -234,6 +245,16 @@ ], "tags": [ "feminine" + ], + "examples": [ + { + "text": "gjuha e fëmijëve", + "english": "children speech" + }, + { + "text": "gjuhë e trashë", + "english": "foul language" + } ] } ] diff --git a/data/test/tidy/th-en-lemmas.json b/data/test/tidy/th-en-lemmas.json index 8d1eea4..51bab06 100644 --- a/data/test/tidy/th-en-lemmas.json +++ b/data/test/tidy/th-en-lemmas.json @@ -10,7 +10,8 @@ ], "tags": [ "letter" - ] + ], + "examples": [] } ] } diff --git a/jsconfig.json b/jsconfig.json index 609e7cc..06c0272 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -7,11 +7,7 @@ "strictNullChecks": true, "noImplicitAny": true, "strictPropertyInitialization": true, - "suppressImplicitAnyIndexErrors": false - }, - "paths": { - "*": ["./types/*"], - "ext/json-schema": ["./types/ext/json-schema"] + "suppressImplicitAnyIndexErrors": false, }, "exclude": [ "node_modules", diff --git a/package-lock.json b/package-lock.json index 97025fd..cbaa146 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,8 @@ "archiver": "^6.0.1", "date-and-time": "^2.4.2", "line-by-line": "^0.1.6", - "node-stream-zip": "^1.15.0" + "node-stream-zip": "^1.15.0", + "yomichan-dict-builder": "^2.9.2" }, "devDependencies": { "jest": "^29.7.0" @@ -2041,6 +2042,11 @@ "node": ">=10.17.0" } }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, "node_modules/import-local": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", @@ -2971,6 +2977,44 @@ "node": ">=6" } }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/jszip/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/jszip/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/jszip/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -3027,6 +3071,14 @@ "node": ">=6" } }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dependencies": { + "immediate": "~3.0.5" + } + }, "node_modules/line-by-line": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/line-by-line/-/line-by-line-0.1.6.tgz", @@ -3293,6 +3345,11 @@ "node": ">=6" } }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -3559,6 +3616,11 @@ "semver": "bin/semver.js" } }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -4030,6 +4092,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/yomichan-dict-builder": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/yomichan-dict-builder/-/yomichan-dict-builder-2.9.2.tgz", + "integrity": "sha512-bhRDXjVLc7K+mW/u+i+KY2PuO2fjeudZo8LJZDbgZCNTpQGAmM81ByvReBHByIMgeO8whCmXpOBG8FhSexMWpQ==", + "dependencies": { + "jszip": "^3.10.1" + } + }, "node_modules/zip-stream": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-5.0.1.tgz", @@ -5587,6 +5657,11 @@ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, "import-local": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", @@ -6300,6 +6375,46 @@ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, + "jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "requires": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -6349,6 +6464,14 @@ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true }, + "lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "requires": { + "immediate": "~3.0.5" + } + }, "line-by-line": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/line-by-line/-/line-by-line-0.1.6.tgz", @@ -6552,6 +6675,11 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -6733,6 +6861,11 @@ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -7081,6 +7214,14 @@ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true }, + "yomichan-dict-builder": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/yomichan-dict-builder/-/yomichan-dict-builder-2.9.2.tgz", + "integrity": "sha512-bhRDXjVLc7K+mW/u+i+KY2PuO2fjeudZo8LJZDbgZCNTpQGAmM81ByvReBHByIMgeO8whCmXpOBG8FhSexMWpQ==", + "requires": { + "jszip": "^3.10.1" + } + }, "zip-stream": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-5.0.1.tgz", diff --git a/package.json b/package.json index 5d0ca29..098b29c 100755 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "archiver": "^6.0.1", "date-and-time": "^2.4.2", "line-by-line": "^0.1.6", - "node-stream-zip": "^1.15.0" + "node-stream-zip": "^1.15.0", + "yomichan-dict-builder": "^2.9.2" }, "description": "Converts Kaikki JSON to Yomitan compatible dictionary.", "devDependencies": { diff --git a/types/types.ts b/types.ts similarity index 54% rename from types/types.ts rename to types.ts index ab1e7ab..9aa2bce 100644 --- a/types/types.ts +++ b/types.ts @@ -1,4 +1,10 @@ +import * as TermBank from './node_modules/yomichan-dict-builder/src/types/yomitan/termbank'; +import * as TagBank from './node_modules/yomichan-dict-builder/src/types/yomitan/tagbank'; +import * as TermBankMeta from './node_modules/yomichan-dict-builder/src/types/yomitan/termbankmeta'; + declare global { + // 3-tidy-up.js types: + type TidyEnv = { source_iso: string, target_iso: string, @@ -32,6 +38,7 @@ declare global { } type KaikkiSense = { + examples?: Example[]; glosses?: Glosses; raw_glosses?: Glosses; raw_gloss?: Glosses; @@ -40,16 +47,29 @@ declare global { form_of?: FormOf[]; } + type Example = { + text?: string; + type?: "example" | "quotation" | "quote"; + english?: string; + roman?: string; + } + type Glosses = string | string[]; type FormOf = { word?: string; } - type GlossTree = Map & { + type GlossTree = Map ; + + type GlossBranch = Map & { get(key: '_tags'): string[] | undefined; - set(key: '_tags', value: string[]): GlossTree; - }; + set(key: '_tags', value: string[]): GlossBranch; + get(key: '_examples'): Example[] | undefined; + set(key: '_examples', value: Example[]): GlossBranch; + } ; + + type GlossTwig = Map; type TidySense = Omit & { tags: string[]; @@ -75,23 +95,11 @@ declare global { } type SenseInfo = { - glosses: YomitanGloss[], + glosses: TermBank.DetailedDefinition[], tags: string[], + examples: Example[], } - - type YomitanGloss = string | StructuredGloss - type StructuredGloss = { - type: "structured-content", - content: string | StructuredContent[], - } - - type StructuredContent = { - tag: string, - data: string, - content: StructuredContent, - } - type Lemma = string; type Form = string; type PoS = string; @@ -101,6 +109,30 @@ declare global { type NestedObject = { [key: string]: NestedObject | any; } + + // 4-make-yomitan.js types: + type MakeYomitanEnv = { + source_iso: string, + target_iso: string, + DEBUG_WORD?: string, + DICT_NAME: string, + tidy_folder: string, + temp_folder: string, + } + + type CondensedFormEntries = [string, string, [string, string[]][]][]; + + type WhitelistedTag = [ + shortTag: string, + category: string, + sortOrder: number, + longTag: string | string[], // if array, first element will be used, others are aliases + popularityScore: number, + ] } -export {} // This is needed to make this file a module \ No newline at end of file +export { + TermBank, + TagBank, + TermBankMeta +} \ No newline at end of file diff --git a/util/util.js b/util/util.js index 09f3499..523d908 100644 --- a/util/util.js +++ b/util/util.js @@ -3,7 +3,7 @@ const path = require('path'); const { readFileSync, writeFileSync, existsSync } = require('fs'); const date = require('date-and-time'); -const tagOrder = JSON.parse(readFileSync(path.resolve(__dirname, '../data/language/tag_order.json'))); +const tagOrder = JSON.parse(readFileSync(path.resolve(__dirname, '../data/language/tag_order.json'), 'utf-8')); const tagOrderAll = []; @@ -111,7 +111,6 @@ function mergePersonTags(targetIso, tags) { } else return tags; } - function writeInBatches(tempPath, inputArray, filenamePrefix, batchSize = 100000, bankIndex = 0) { consoleOverwrite(`Writing ${inputArray.length.toLocaleString()} entries of ${filenamePrefix}...`);