(WIP) Create Sentence Cards from Books
3.04MB. Updated 2020-10-13. Only supports Anki 2.1.x.
The author has shared 36 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.20-2.1.49 (updated 2020-10-13)
To download this add-on, please copy and paste the following code into Anki 2.1:
1200382751
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

It works after updating nltk! Make sure to save your text files in UTF-8 Format!

Hi! I tried the "Contact the Author button, but it leads to nowhere. I can't make the add-on work. Would you help me to fix the problema. Here's the error:
Informações de Depuração:
Anki 2.1.41 (312fa278) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-03-16 16:10:41
[nltk_data] Downloading package punkt to
[nltk_data] /Users/gabrieldias/nltk_data...
[nltk_data] Package punkt is already up-to-date!
Informações de Depuração:
Anki 2.1.41 (312fa278) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-03-16 16:10:41
[nltk_data] Downloading package punkt to
[nltk_data] /Users/gabrieldias/nltk_data...
[nltk_data] Package punkt is already up-to-date!

This would be crazy useful if I could get it working. Downloaded NLTK and NLTK data and tried the punkt quick fix but it didn't work because punkt is fully updated. Any ideas on a fix, author?
Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-08-10 16:46:39
Caught exception:
Traceback (most recent call last):
File "C:\Users\drewo\AppData\Roaming\Anki2\addons21\1200382751\__init__.py", line 36, in main
deck['mid'] = m['id']
TypeError: 'NoneType' object is not subscriptable
Debug info:
Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-08-10 16:46:39
Caught exception:
Traceback (most recent call last):
File "C:\Users\drewo\AppData\Roaming\Anki2\addons21\1200382751\__init__.py", line 36, in main
deck['mid'] = m['id']
TypeError: 'NoneType' object is not subscriptable

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.35 (84dcaa86) Python 3.8.1 Qt 5.12.6 PyQt 5.12.3
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-07-06 19:33:52
Caught exception:
Traceback (most recent call last):
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1200382751\__init__.py", line 28, in main
sents = nltk.sent_tokenize(p)
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1200382751\vendor\nltk\tokenize\__init__.py", line 106, in sent_tokenize
tokenizer = load("tokenizers/punkt/{0}.pickle".format(language))
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1200382751\vendor\nltk\data.py", line 752, in load
opened_resource = _open(resource_url)
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1200382751\vendor\nltk\data.py", line 877, in _open
return find(path_, path + [""]).open()
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1200382751\vendor\nltk\data.py", line 585, in find
raise LookupError(resource_not_found)
LookupError:
**********************************************************************
Resource [93mpunkt[0m not found.
Please use the NLTK Downloader to obtain the resource:
[31m>>> import nltk
>>> nltk.download('punkt')
[0m
For more information see: https://www.nltk.org/data.html
Attempted to load [93mtokenizers/punkt/english.pickle[0m
Searched in:
- 'C:\\Users\\Mohammad/nltk_data'
- 'C:\\Program Files\\Anki\\nltk_data'
- 'C:\\Program Files\\Anki\\share\\nltk_data'
- 'C:\\Program Files\\Anki\\lib\\nltk_data'
- 'C:\\Users\\Mohammad\\AppData\\Roaming\\nltk_data'
- 'C:\\nltk_data'
- 'D:\\nltk_data'
- 'E:\\nltk_data'
- ''
**********************************************************************
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.35 (84dcaa86) Python 3.8.1 Qt 5.12.6 PyQt 5.12.3
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2021-07-06 19:33:52
Caught exception:
Traceback (most recent call last):
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1200382751\__init__.py", line 28, in main
sents = nltk.sent_tokenize(p)
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1200382751\vendor\nltk\tokenize\__init__.py", line 106, in sent_tokenize
tokenizer = load("tokenizers/punkt/{0}.pickle".format(language))
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1200382751\vendor\nltk\data.py", line 752, in load
opened_resource = _open(resource_url)
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1200382751\vendor\nltk\data.py", line 877, in _open
return find(path_, path + [""]).open()
File "C:\Users\Mohammad\AppData\Roaming\Anki2\addons21\1200382751\vendor\nltk\data.py", line 585, in find
raise LookupError(resource_not_found)
LookupError:
**********************************************************************
Resource [93mpunkt[0m not found.
Please use the NLTK Downloader to obtain the resource:
[31m>>> import nltk
>>> nltk.download('punkt')
[0m
For more information see: https://www.nltk.org/data.html
Attempted to load [93mtokenizers/punkt/english.pickle[0m
Searched in:
- 'C:\\Users\\Mohammad/nltk_data'
- 'C:\\Program Files\\Anki\\nltk_data'
- 'C:\\Program Files\\Anki\\share\\nltk_data'
- 'C:\\Program Files\\Anki\\lib\\nltk_data'
- 'C:\\Users\\Mohammad\\AppData\\Roaming\\nltk_data'
- 'C:\\nltk_data'
- 'D:\\nltk_data'
- 'E:\\nltk_data'
- ''
**********************************************************************
Comment from author
Try a quick fix. Maybe it'll work.
1. Open the Debug Console in Anki - https://docs.ankiweb.net/misc.html#debug-console
2. Follow the instructions in the manual to execute the following code.
import nltk
nltk.download('punkt')
3. The add-on should work now.
1. Open the Debug Console in Anki - https://docs.ankiweb.net/misc.html#debug-console
2. Follow the instructions in the manual to execute the following code.
import nltk
nltk.download('punkt')
3. The add-on should work now.

Amazing addon

In linux this error ocurs:
Informação de Debug:
Anki 2.1.26 (70784154) Python 3.8.1 Qt 5.14.1 PyQt 5.14.1
Platform: Linux
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-11-16 06:31:23
Extensões possivelmente envolvidas: Create Sentence Cards from Books WIP
Caught exception:
Traceback (most recent call last):
File "/home/maquiavelho/.local/share/Anki2/addons21/1200382751/__init__.py", line 28, in main
sents = nltk.sent_tokenize(p)
File "/home/maquiavelho/.local/share/Anki2/addons21/1200382751/vendor/nltk/tokenize/__init__.py", line 106, in sent_tokenize
tokenizer = load("tokenizers/punkt/{0}.pickle".format(language))
File "/home/maquiavelho/.local/share/Anki2/addons21/1200382751/vendor/nltk/data.py", line 752, in load
opened_resource = _open(resource_url)
File "/home/maquiavelho/.local/share/Anki2/addons21/1200382751/vendor/nltk/data.py", line 877, in _open
return find(path_, path + [""]).open()
File "/home/maquiavelho/.local/share/Anki2/addons21/1200382751/vendor/nltk/data.py", line 585, in find
raise LookupError(resource_not_found)
LookupError:
**********************************************************************
Resource [93mpunkt[0m not found.
Please use the NLTK Downloader to obtain the resource:
[31m>>> import nltk
>>> nltk.download('punkt')
[0m
For more information see: https://www.nltk.org/data.html
Attempted to load [93mtokenizers/punkt/PY3/english.pickle[0m
Searched in:
- '/home/maquiavelho/nltk_data'
- '/home/maquiavelho/Documents/Vinicius/Programas/anki-2.1.26-linux-amd64/bin/nltk_data'
- '/home/maquiavelho/Documents/Vinicius/Programas/anki-2.1.26-linux-amd64/bin/share/nltk_data'
- '/home/maquiavelho/Documents/Vinicius/Programas/anki-2.1.26-linux-amd64/bin/lib/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'
obs- I solved this way:
python3 -m nltk.downloader all
Informação de Debug:
Anki 2.1.26 (70784154) Python 3.8.1 Qt 5.14.1 PyQt 5.14.1
Platform: Linux
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-11-16 06:31:23
Extensões possivelmente envolvidas: Create Sentence Cards from Books WIP
Caught exception:
Traceback (most recent call last):
File "/home/maquiavelho/.local/share/Anki2/addons21/1200382751/__init__.py", line 28, in main
sents = nltk.sent_tokenize(p)
File "/home/maquiavelho/.local/share/Anki2/addons21/1200382751/vendor/nltk/tokenize/__init__.py", line 106, in sent_tokenize
tokenizer = load("tokenizers/punkt/{0}.pickle".format(language))
File "/home/maquiavelho/.local/share/Anki2/addons21/1200382751/vendor/nltk/data.py", line 752, in load
opened_resource = _open(resource_url)
File "/home/maquiavelho/.local/share/Anki2/addons21/1200382751/vendor/nltk/data.py", line 877, in _open
return find(path_, path + [""]).open()
File "/home/maquiavelho/.local/share/Anki2/addons21/1200382751/vendor/nltk/data.py", line 585, in find
raise LookupError(resource_not_found)
LookupError:
**********************************************************************
Resource [93mpunkt[0m not found.
Please use the NLTK Downloader to obtain the resource:
[31m>>> import nltk
>>> nltk.download('punkt')
[0m
For more information see: https://www.nltk.org/data.html
Attempted to load [93mtokenizers/punkt/PY3/english.pickle[0m
Searched in:
- '/home/maquiavelho/nltk_data'
- '/home/maquiavelho/Documents/Vinicius/Programas/anki-2.1.26-linux-amd64/bin/nltk_data'
- '/home/maquiavelho/Documents/Vinicius/Programas/anki-2.1.26-linux-amd64/bin/share/nltk_data'
- '/home/maquiavelho/Documents/Vinicius/Programas/anki-2.1.26-linux-amd64/bin/lib/nltk_data'
- '/usr/share/nltk_data'
- '/usr/local/share/nltk_data'
- '/usr/lib/nltk_data'
- '/usr/local/lib/nltk_data'
obs- I solved this way:
python3 -m nltk.downloader all
Comment from author before post was edited
Thank you. I thought it'll be already installed. And it appears that you might be the first person who downloaded the add-on in about a month, since it was uploaded on AnkiWeb.
I have no time and no much interest to update the add-on at the moment, but try a quick fix. I think it'll work.
1. Open the Debug Console in Anki - https://docs.ankiweb.net/#/misc?id=debug-console
2. Follow the instructions and execute the following code.
import nltk
nltk.download('punkt')
3. The add-on should work now.
I have no time and no much interest to update the add-on at the moment, but try a quick fix. I think it'll work.
1. Open the Debug Console in Anki - https://docs.ankiweb.net/#/misc?id=debug-console
2. Follow the instructions and execute the following code.
import nltk
nltk.download('punkt')
3. The add-on should work now.

seems to be very useful for my purpose

great idea

It is a good idea, thanks!