From 73d0a5d391bf630bed0c92ae3c270b4235f4bd23 Mon Sep 17 00:00:00 2001 From: KovachevBot <86124720+KovachevBot@users.noreply.github.com> Date: Sun, 20 Jun 2021 16:18:33 +0100 Subject: [PATCH] Added 'mapping_test.json' for readers' reference This file should serve as an example for what the generated dictionary 'pages_to_create' will look like. This example is naturally in JSON, but should convey the same information as what occurs in the Python script: a dictionary with the structure seen herein is generated and subsequently used to iterate over a series of pages, providing exactly the data required to generate the contents of each page. (The example seen here is the result of harvesting the declined-form data from https://en.wiktionary.org/wiki/%D0%BA%D1%83%D0%BA%D0%BB%D0%B0.) Each page title within the dictionary contains an array under the key "associations", which itself contains a number of objects with the following contents: one array "mapping", which contains tuples of (lemma, derived form) pairs. In other words, this identifies, for each title, one derived form, with reference to the original lemma. (As there can be multiple etymologies for a derived term, by the way, this is why there are multiple lemma and derived-form fields: the stress, for example, could differ between different etymologies. In this example, they incidentally do not.); the other content being an array "forms", which contains tuples of (form, number) pairs - in other words, specifying the data of what specific type of derived form this is. The exception is when the form is the 'count form', which doesn't exist in the singular and is hence given a special designation when used in the derived form template: whereas e.g. definite singular maps simply to {{...def|s}}, the count form doesn't require a plural/singular distinction, since it's always plural; its designation is {{...count|form}}. The dictionary generated in the article creation process is used as described above to add content to pages. Please do inspect the function of the script yourself if you are interested or would like to expound any errors. Thanks for reading! --- mapping_test.json | 182 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 mapping_test.json diff --git a/mapping_test.json b/mapping_test.json new file mode 100644 index 0000000..c4c7a21 --- /dev/null +++ b/mapping_test.json @@ -0,0 +1,182 @@ +{ + "кукла": { + "associations": [ + { + "mapping": [ + "ку́кла", + "ку́кла" + ], + "forms": [ + [ + "indef", + "s" + ] + ] + }, + { + "mapping": [ + "ку́кла", + "ку́кла" + ], + "forms": [ + [ + "indef", + "s" + ] + ] + }, + { + "mapping": [ + "ку́кла", + "ку́кла" + ], + "forms": [ + [ + "indef", + "s" + ] + ] + } + ] + }, + "куклата": { + "associations": [ + { + "mapping": [ + "ку́кла", + "ку́клата" + ], + "forms": [ + [ + "def", + "s" + ] + ] + }, + { + "mapping": [ + "ку́кла", + "ку́клата" + ], + "forms": [ + [ + "def", + "s" + ] + ] + }, + { + "mapping": [ + "ку́кла", + "ку́клата" + ], + "forms": [ + [ + "def", + "s" + ] + ] + } + ] + }, + "кукло": { + "associations": [ + { + "mapping": [ + "ку́кла", + "ку́кло" + ], + "forms": [ + [ + "voc", + "s" + ] + ] + } + ] + }, + "кукли": { + "associations": [ + { + "mapping": [ + "ку́кла", + "ку́кли" + ], + "forms": [ + [ + "indef", + "p" + ], + [ + "voc", + "p" + ] + ] + }, + { + "mapping": [ + "ку́кла", + "ку́кли" + ], + "forms": [ + [ + "indef", + "p" + ] + ] + }, + { + "mapping": [ + "ку́кла", + "ку́кли" + ], + "forms": [ + [ + "indef", + "p" + ] + ] + } + ] + }, + "куклите": { + "associations": [ + { + "mapping": [ + "ку́кла", + "ку́клите" + ], + "forms": [ + [ + "def", + "p" + ] + ] + }, + { + "mapping": [ + "ку́кла", + "ку́клите" + ], + "forms": [ + [ + "def", + "p" + ] + ] + }, + { + "mapping": [ + "ку́кла", + "ку́клите" + ], + "forms": [ + [ + "def", + "p" + ] + ] + } + ] + } +} \ No newline at end of file