An Anki add-on that fetches and displays random example sentences in different languages from various sources.
The add-on mainly works as a template filter to show random example sentences for vocabulary each time a card is viewed.
You just have to put a filter like this in your card template:
{{incontext:Front}}
Here, the add-on will show a random English example sentence containing the word in the Front
field.
You can specify the language using the lang
option:
{{incontext lang=en:Front}}
Currently supported values are:
en
Englishtr
Turkishja
Japaneseko
: Koreanzh
: Chinese
Sentences are fetched from multiple sources such as https://www.lexico.com/ (for English) and https://sozluk.gov.tr (for Turkish).
You can show sentences from only a certain source by using the provider
option, like this:
{{incontext lang=en provider=lexico:Front}}
For a list of supported sources, see the providers folder.
The identifier of each provider is defined by a name
variable inside each provider class.
A list of available providers is also shown in the interface.
If a provider is given but no language, the first supported language of the provider will be assumed. If both language and provider are not given, the default is English with all providers.
More sites and languages will be added in the future. Contributions are welcome!
You can also add sentences to a chosen field in multiple notes using the browser's Notes > InContext: Add sentences menu item. This is useful if you review on mobile.
To make Tatoeba databases available for use with the add-on, please see this doc.
The add-on has an experimental graphical interface to manage sentences that can be accessed from Tools > InContext.
Download this deck for a demo of the add-on: https://drive.google.com/file/d/1Era5ksSa59xjB3ZbVQsdoTbQEigzh6Bi/view?usp=sharing
You can download the add-on from its page on AnkiWeb: https://ankiweb.net/shared/info/385420176
In the first review of a card that has the InContext filter, sentences will be fetched from the language providers and saved in the user_files/sentences.db
file. Subsequent reviews will use those saved sentences (if any) and avoid making more requests to the providers. You can anyway update saved sentences manually from the GUI.
- IMPORTANT: In versions before 0.3.1, the add-on suffered from an issue preventing updates from being properly installed, which resulted in Anki prompting to update the add-on every time. To fix this, please follow the steps carefully:
- Download version 0.3.1 from this page. You should download the
incontext_ankiweb.ankiaddon
file or this won't work. - Close Anki then double click on the .ankiaddon file to install it and run Anki. Closing Anki is important for the update to work.
- Go to Tools > Add-ons and click Check for Updates. You should be prompted to update the add-on. The issue should be fixed after updating this time.
- Download version 0.3.1 from this page. You should download the
See CHANGELOG.md for a list of changes.
Some icons are adapted from Bootstrap Icons; licensed under the MIT.
Please post any questions, bug reports, or feature requests in the support page or the issue tracker.
If you want priority support for your feature/help request, I'm available for hire. You can get in touch from the aforementioned pages, via email or on Fiverr.
Consider supporting me if you like my work:
I'm also available for freelance add-on development on Fiverr: