16 1
Contact Author Sign in to rate

Sentence adder for any language with batch add option

0.01MB. Updated 2022-06-16. Only supports Anki 2.1.x.
The author has shared 9 other item(s).

Description

Add sentences to Anki editor window in one click Select a word in edit field and click add button to add sentences to that fields matching the words. Also create/add sentences for any languages. The sentences database created using tatoeba language tsv files. Download language tsv file from tatoeba. Note: If already created the sentences database then save a copy of lang_db and config.json folder from Anki2/addons21/1682655437/ into Anki2/addons21/1682655437/user_files/ Note: You have to download sentences tsv from tatoeba View tutorials below to download and add language to database. Update 16-06-2022 - Option to limit character length in sentences - Option to auto add multiple sentences - Option to remove language database - Option to add different color for words and sentences - Auto upgrade old config.json to new config - Preserved generated database in user_files - Bug fixes (Before updating, save a copy of lang_db and config.json folder from Anki2/addons21/1682655437/ into Anki2/addons21/1682655437/user_files/) Update 24-03-2021 Change options for sentences containing spaces. For example in English language there are spaces between words unlike Chinese language. So, update the addons with options Sentences contain space and change it to use. But before update, it is recommended to save a copy of lang_db and config.json folder from Anki2/1682655437/ and paste it to Anki2/1682655437/ after update. View demo Update 22-03-2021 - Batch sentences adder Tutorials Download Sentences data tsv files Create/Add Language database Add random sentence to edit field View list of all sentences Batch sentences adder View more tutorials at Simple 中文 Features - Create new language database - Add random sentence in one click - View list of all sentences matching the selected word - Change language (Require restart of Anki to apply changes) - Change color of sentences Install 1. Download Addon Anki -> Tools -> Add-ons -> Get Add-ons... Paste the code 1682655437 and install. 2. Restart Anki and open the Addon to add new languages. 3. Download language of choice from tatoeba. 4. Open the installed Addon in Anki Anki -> Tools -> Sentence Adder... 5. Click Add new language 6. Enter language name 7. Select downloaded language tsv file 8. Click create to create/add new language to the Addon 9. Restart Anki to apply changes Adding sentences to field in Anki 1. First change preferences for the Anddon There are two preferences a. Auto add sentences: Automatically add random sentences matching the words b. Open all sentences window: View list of all sentences and select as per choice from the list 2. Select any text in editor window 3. Click add button to add sentences Demo Add Random Sentences Add random sentence to edit field View all sentences View list of all sentences Sentences Database tatoeba View Source Code Sentence Adder Anki Addon

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

Supported Anki versions:

To download this add-on, please copy and paste the following code into Anki 2.1:

1682655437

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons Contact Author

Reviews

on 1655526312
I love your add-on!
on 1655306750
Works quickly and well. Is there a way to limit the size of sentences when using the batch adder? Sometimes, it randomly selects a humongous sentence.
Comment from author
Hi, I have updated the addons, the feature is added. Also please provide feedback for improvements.

Note: If already created the sentences database then save a copy of lang_db and config.json folder from Anki2/addons21/1682655437/ into Anki2/addons21/1682655437/user_files/
on 1651742007
Thank you so much for developing this addon!

What can I say, this is simply amazing. The potential of this addon is incredible. As long as you adhere to the tatoeba tsv format, you can convert any sentences database to this format and merge all the tsv files to obtain the ultimate database.

In case this helps someone, here is some code I wrote to convert a json array with the sentences stored in the key "jpn" to tsv: https://github.com/natha7/Convert-JSON-to-TSV-tatoeba-format
on 1649646143
Very useful add-on, I'm using the batch option all the time.

Is there some way to make it add more than one example sentence when using the automatic option?
Comment from author
Hi, I have updated the addons, the feature is added. Also please provide feedback for improvements.

Note: If already created the sentences database then save a copy of lang_db and config.json folder from Anki2/addons21/1682655437/ into Anki2/addons21/1682655437/user_files/
on 1647282863
is ok but sentence window is TOO SMALL hard to navigate once I want to choose a sentence. and too bad cant choose few per time.

P.s.Would you please share a structure of tsv requerments/limits so we could create our own DB with out tatoeba? Tatoeba is not enough source for advance learners, I would like to create my own DB from other sources (books,magazines etc)
THANKS A LOT!!
Comment from author
This is fairly easy to create own database.
1. Create a TSV file with fields similar tatoeba
there are three fields in tatoeba.
2. Then select the file in addon popup
3. The database will be added.

Also log the issues here
https://github.com/krmanik/Sentence-Adder-Anki-Addon/issues
on 1637405443
Thanks for the addon, great job! Very good enhancement to Anki

Can this be made so that the found sentences will have the target keyword (flashcard's main entry) marked in some way, e.g. by a css class?
So that a user could further customize it by color, or bold font etc.
on 1632611128
Incredible add-on. Thank you very much.

For anyone (like me) who had a problem with adding the language file to Anki, you may need to download/use a file extractor.

1. After I received an error with the first install, I deleted this add-on (and the language file), closed Anki, and started all over again, (You probably don't need to do all this)
2. Re-installed this add-on.
3. Closed Anki. Re-launched it.
4. Re-downloaded my language file.
5. After downloading my preferred file extractor, right clicked the language file, Open with (extractor name) > Extract Here. There will be two language files: 1) the original downloaded zip file and 2) the extracted file. The names look very similar, so make sure you select the extracted file in the next step.
6. In Anki, go to Tools > Sentence Adder...>Add New Language. Select the extracted language file and fill in the Enter Language Name field. Click Create.
7. Restart Anki.
on 1625963584
It doesn't let me add in the file for my language. It comes up with a message saying the "file already exists. I don't know if this is just an issue with he file for Korean
Comment from author
Remove files from Anki2/addons folder. Also you may have to edit config.json to remove the language and corresponding file path.
It happens when tsv file have error but some db created.

You may also rename the .tsv files.
on 1625154076
Finally!
Great add-on. Works perfectly.
Note: I see that a lot of people are complaining about the tsv file not working but I think it is just that It is in zip.file when you download it...
Extract it first and then it will work !
on 1624428443
Thank you! Incredibly useful. However, I'd appreciate if you could add an option to ignore text within brackets/parentheses for the batch sentence add
on 1620961386
Hey, thanks for your contribution! I just have a question. I'm trying to get this to work on the latest version of Anki, but I'm getting the following code:

Debug info:
Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-05-13 21:06:01

Caught exception:
Traceback (most recent call last):
File "C:\Users\mhaid\AppData\Roaming\Anki2\addons21\1682655437\__init__.py", line 95, in createDB
for row in reader:
File "C:\python\lib\codecs.py", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 13: invalid start byte

Any way to solve this? This is when I try to add the TSV file. I've tried all of the advice I've seen such as renaming the TSV file and deleting the DB file to no avail.
Comment from author
Hi,
Can you share the tsv file here?
https://github.com/infinyte7/Sentence-Adder-Anki-Addon/issues

First extract compressed file then select the tsv file.
This 0xbb tell that you are trying to create DB from zip file. But it required .tsv files.
on 1619600263
Love it, very useful.
For those who wonder, it works for every language, not only chinese. I'm using it with german.

1. I would add an option that allowed us to put the example sentence in another field, not only in the "front" field.

2. Would be nice if we could also automatically add the sentence in a second language (mother tongue), but adding it to a different field.

i.e:
Front field-> add nothing.
Back field -> add nothing.
Example in foreigner language field -> add the tatoeba database sentence.
Example sentence translated to the desired language (mother tongue) -> Translated example sentence.



3. I was having (and already solved) the same error when adding the .tsv file. The problem was that i was trying to insert the .rar file without extracting it first. So, after you download the file from tatoeba.org, you have to extract it.
on 1619350621
Thank you so much! <333
on 1617181122
UPDATE: It works pretty well, it's easy and efficient to use, I truly recommend it.
Thank you for this add-on. I really appreciate it

--------------------------------------------------------------------------------------------------------------------------
Hi, I've tried many times to launch the addon but it keeps sending me an error when I try to load the language data with the tsv document. Could you please assist me with this one? I´m a little bit stuck right now. I will update de rating when everything runs ok! ok?

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.42 (8eebfe18) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-03-30 00:34:31

Caught exception:
Traceback (most recent call last):
File "C:\Users\Valde\AppData\Roaming\Anki2\addons21\1682655437\__init__.py", line 112, in selectFileFolderDlg
if self.filepath.split("/")[-1].split(".")[1] == "tsv":
IndexError: list index out of range
Comment from author before post was edited
HI, Can you post the tsv file if not important here https://github.com/infinyte7/Sentence-Adder-Anki-Addon/issues
Otherwise you can send me your tsv on my discord id - infinyte7#9295
I need to check errors in the file.
on 1616483716
Great idea. Thanks
on 1615054504
Super cool, would also love a bulk add option, and maybe an audio field option? My understanding is that you can filter by sentences with audio on tatoeba, so it might be possible to use those sentence ids from the downloaded tsv to populate audio of the sentence automatically.
Comment from author
It is updated with batch add option view tutorial here

https://www.youtube.com/playlist?list=PLuy0icdF039z-kYxCLCmD3xdUynmFNbas
on 1614339789
Excellent! Been waiting for something like this for a looong time. Any chance of having the sentence put into a new field and maybe a bulk add option? Just two suggestions that came to my mind. Keep on going the great work!
Comment from author
It is updated with batch add option view tutorial here

https://www.youtube.com/playlist?list=PLuy0icdF039z-kYxCLCmD3xdUynmFNbas