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
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:
- 2.1.0-2.1.53+ (updated 2022-06-16)
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

I love your add-on!

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/
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/

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
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

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?
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/
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/

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!!
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
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

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.
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.

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.
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.

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.
It happens when tsv file have error but some db created.
You may also rename the .tsv files.

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 !
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 !

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

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.
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.
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.

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.
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.

Thank you so much! <333

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
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.
Otherwise you can send me your tsv on my discord id - infinyte7#9295
I need to check errors in the file.

Great idea. Thanks

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
https://www.youtube.com/playlist?list=PLuy0icdF039z-kYxCLCmD3xdUynmFNbas

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
https://www.youtube.com/playlist?list=PLuy0icdF039z-kYxCLCmD3xdUynmFNbas