kovachev-bot/mapping_test.json
KovachevBot 73d0a5d391
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!
2021-06-20 16:18:33 +01:00

182 lines
4.2 KiB
JSON

{
"кукла": {
"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"
]
]
}
]
}
}