Giter Site home page Giter Site logo

wkt's Introduction

Usage

Installation

First, to get the binary, you can either download it from the latest release (if you use Linux), or compile it yourself. To do so, clone this repository, and run nimble build. If you don't have nimble installed, you can install Nim from the official website or using choosenim, and then run the above command.

CLI

(beware; these steps assume you're using supported data (ie, German nouns, verbs, or adjectives), as anything else is untested)

Extraction

  • Firstly, download the raw JSON data files from Kaikki (select a language and a part of speech, scroll down, and you should see text saying "Download JSON data for these senses").
  • Secondly, for each JSON file, preprocess it using wkt pps <input> <output> <pos>, where input is the path of the JSON file, output is the write path for the intermediary JSON data, and pos is a part of speech (currently, only "verb", "noun", or "adj").
  • Thirdly, create an index of every file you preprocessed using wkt idx <output> <input> <pos> <input> <pos> ..., where output is the write path for the index JSON, and each pair after that is a space-separated combination of an intermediary JSON file and its part of speech (once again, currently only "verb", "noun", or "adj").
  • Next, create a newline-separated list of words you want to extract (their written form must exactly match their form in Wiktionary).
  • After that, filter the intermediary data for those words using wkt fil <index> <list> <output>, where index is the index file created earlier, list is the wordlist file you just created, and output is the desired write path for the intermediary data for those words.
  • Finally, to actually create the deck, run python create_basic_deck.py [--email <email>] <input> <output> (create_basic_deck.py is from the repository), where input is the path to the intermediary data created in the previous step, and output is the write path to the Anki deck (as an apkg file). The email parameter is optional, but it enables adding sound to decks (the email is required for downloading the sound, as per Wiktionary's bot guidelines).

wkt's People

Contributors

nichrosia avatar

Watchers

 avatar

wkt's Issues

Duplicates are overridden in indices

Explanation of the problem

If two intermediaries have two items with the same keys, one of them gets overridden.

How to reproduce

If you create two intermediary files for German verbs and adjectives, index them, and search for gefallen, you'll only get the adjective definition - the verb definition is entirely erased.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.