A Wiktionary bot.
73d0a5d391
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 | ||
README.md | ||
test.py |
kovachev-bot
The source code for my Wiktionary bot, https://en.wiktionary.org/wiki/User:KovachevBot. The purpose of the bot is to automatically generate Bulgarian derived form entries from nouns' declension tables. You can peer into my abominable coding practices if you wish, and can verify that I won't try to obliterate the entire platform without compunction... I'd also like to apologise for naming the bot after myself, but the Wiktionary policy made me do it :x
Please see the bot's user page if you need more specifics as to the purpose and function of the bot.