contrib/fugounashi
scripts to support RTK and Japanese sentences in anki
contents
#readme read me first
#franki field replacement for anki
#swanki suspend words in anki
#kore core2k+core6k complete, enhanced and sorted by kanji
#xxfurigana plugin to control furigana display
#scanki smart.fm converter for anki
#cranki convert readings for anki
#kanji-graph graph kanji occurrences in sorted sentences
#kanji-count report cumulative new kanji use in a collection of sentences
#kanji-occurrences find occurrences in a collection of sentences
#kanji-sort sort lines by kanji
#kanji-freq report kanji frequency distribution
#kanji-info RTK name and number and vocab indexed by kanji
#kanji-vocab JLPT, core2k and ko2001 vocab arranged by kanji
#lookup-sentences looks up a gloss for each word in a sentence
#ankitty a curses-based review-only anki client for embedded unix devices
#grid add a drawing grid to kanji as a writing aid
#heisighelper plugin and script to lookup rtk kanji
#revtkrip make an offline mirror of stories from RevTK
#heisig-page mapping of heisig number to RTK 4ed page number
#errata combines RTK 4ed pdf with errata pdf
#overwrite-fields plugin to overwrite existing fields with data from an external file
readme
the following file types are used:
- .py
- python script
- stand-alone application not ankiqt plugin
you will need to find out how to install python, libanki libanki dependencies and run a python script on your system
- for linux the required software will be automatically installed when installing the anki package
if libanki is not installed below /usr/share/anki (the debian package location) you will need to edit the path in the script or set PYTHONPATH appropriately
- for osx the required software is contained in the anki package and can be used as follows:
$ PYTHONHOME=/Applications/Anki.app/Contents/Resources/ /Applications/Anki.app/Contents/MacOS/python franki.py -h
- for windows most of the required software is available in the anki package, however python will need to be installed separately:
if you installed anki to somewhere other than the default location, edit the path in the script or set PYTHONPATH:
C:\>set PYTHONPATH=c:\somewhere\Anki\lib;c:\somewhere\Anki\lib\shared.zip
install the same version of python used by anki, python 2.5
- run the script with python:
C:\>c:\Python25\python franki.py -h
- for linux the required software will be automatically installed when installing the anki package
- .sh
- .pl
- perl script
you will need to find out how to install perl and run a perl script on your system
- .txt
- text file
- tab-separated
- utf-8
- all files
- unix newlines
- windows users won't be able to use notepad but can use wordpad or other suitable editors
- unix newlines
franki
field replacement for anki
- populate extra fields in a deck from an external source (e.g. adding stories from revtk or ja keywords to a heisig deck)
- bulk editing of fields (e.g. find-replace, merging/splitting)
- update field data to a later version (e.g. collaborative sentence mining from textbooks)
Usage: franki options
-h for help
see http://ichi2.net/anki/ContribFugounashi#franki for more info
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-q, --quiet don't print status messges
-v, --verbose print modified records
Required Options:
Each of the following options must be specified.
-d DECK, --deck=DECK
anki deck file
-f FILE, --file=FILE
replacement data file, utf-8, tab separated fields
numbered from 1
-m MODEL, --model=MODEL
model name in DECK
-k NAME NUMBER, --key=NAME NUMBER
field name NAME in DECK to be matched with field
number NUMBER in FILE
-r NAME NUMBER, --replace=NAME NUMBER
field name NAME in DECK to be replaced with field
number NUMBER from FILE, can be specified multiple
timesif you'd like a gui alternative see this ticket
swanki
suspend words in anki
- uses:
- study vocab and sentences containing only known kanji
- review kanji using japanese prompts created from known vocab
- functions:
- suspends and unsuspends new cards in vocab and sentence decks based on seen kanji in kanji decks
- adds prompts to kanji decks based on seen and new words in vocab decks
- automatically uses keyword as a fallback if no seen words
- lists kanji used in vocab and sentence decks missing from kanji decks
- lists kanji in kanji decks missing from vocab and sentence decks
- set up:
- edit the configuration section to describe your decks
- the main config variable is a python list of dictionaries so be careful with the commas, quotes, colons and braces
- the dictionary keys (left of the colon) are as follows, so you'll need to change the terms (right of the colon) to match your deck
- deck: deck file name
- fact: model name
- card: card template name
- type: card type: "kanji", "word" or "sentence".
- field: field name (for "type":"word" it should be a reading field for the prompts to work properly)
- fallback: field name for kanji fallback prompt (only for "type":"kanji")
- add fields to kanji deck models and templates for new and seen prompts and vocab
- edit the configuration section to describe your decks
- usage:
- close decks in anki
- run after learning new cards from kanji decks to suspend and unsuspend cards in vocab and sentence decks
- run after adding or learning new vocab to update prompts in kanji decks
sample additional question card template:
<!--fon--><span style='font-size: larger'>%(swanki-seen-prompt)s</span> %(swanki-new-prompt)s<!--foff-->
kore
core2k+core6k complete, enhanced and sorted by kanji
- smart.fm Japanese core 2000 and core 6000 vocab linked with corresponding sentences
- 6000 vocab items (5988 unique expression/reading/meaning tuples, some vocab items appear with different example sentences to illustrate different meanings)
- 6000 sentences (5929 unique expression/reading/meaning tuples, some sentences are re-used as example sentences for multiple vocab items)
- 6000 records (5998 unique vocab-sentence pairs, records with index 3260 (duplicate of 3093) and 4676 (duplicate of 1400) can be removed)
- can be made into connected spaced vocab and sentence cards, used to customise formatting, or used to migrate between vocab and sentence cards
- kana-only and furigana readings
enabled furigana display by installing #xxfurigana
- sentence dictionary lookup
- includes WWWJDIC entry for each word in the sentence
see #lookup-sentences for reference
- local and remote sound
- 5999 vocab sound tags (1 missing, 5990 unique)
- 6000 sentence sound tags (5928 unique)
for local sound download the vocab and sentences, unzip and move files into the media directory
import file has sound-local fields replaced with anki's munged filenames for compatibility with existing media packages and plugin downloads
- use the remote sound field to stream from smart.fm
- vocab, sentence and list ids and per list and overall indices
- for cross-referencing with smart.fm
- sort indices for sorting on sentence-expression by kanji in rtkliteko2001+rtk+frequency, rtk+frequency, ko2001+frequency, and frequency orders
- by default sorted in rtkliteko2001+rtk+frequency order
anki doesn't support re-sorting so you need to sort on an index column before importing to change sort order (unix users can use sort -n, windows users can use a spreadsheet)
- highest kanji number and new required kanji progression for each sort order
- highest kanji number needed for that sentence corresponds to rtk frame number when sorted by rtk and ko2001 kanji number when sorted by ko2001
- new kanji required lists new kanji compared with previous sentences
- vocab contains 1510 rtk1 kanji, 96 rtk3 kanji, 2 other
- sentences contain 1545 rtk1 kanji, 103 rtk3 kanji, 2 other
- highlighting of vocab item within sentence and vocab parts-of-speech
- vocab JLPT level
- 555/683 JLPT4, 510/624 JLPT3, 2665/3899 JLPT2, 895/2955 JLPT1, 1375 other
import into anki with File, Import...
anki has difficulty with large decks of many fields, so you may wish to extract only those fields you require before importing (unix users can use cut, windows users can use a spreadsheet)
if you include many fields you may need to use this workaround
- set the "Sort as numbers" option on the index fields when creating your model
anki has a bug when generating multiple cards from imported facts, but a fix is now available
download import file: kore-1.7.txt
Fields |
||
number |
name |
example |
1 |
vocab-expression |
嗅ぐ |
2 |
vocab-kana |
かぐ |
3 |
vocab-meaning |
smell, sniff |
4 |
vocab-sound-remote |
[sound:http://assets3.smart.fm/assets/legacy/JLL/audio/Int/JW03341A.mp3] |
5 |
vocab-sound-local |
[sound:JLL-audio-Int-JW03341A.mp3] |
6 |
vocab-pos |
Verb |
7 |
vocab-id |
439323 |
8 |
sentence-expression |
犬がお皿の匂いをクンクン<b>嗅いでいる</b>ね。 |
9 |
sentence-kana |
いぬ が おさら の におい を くんくん <b>かいで いる</b> ね |
10 |
sentence-meaning |
The dog sniffed at the smell on the plate. |
11 |
sentence-sound-remote |
[sound:http://assets3.smart.fm/assets/legacy/JLL/audio/Int/JS03341A.mp3] |
12 |
sentence-sound-local |
[sound:JLL-audio-Int-JS03341A.mp3] |
13 |
sentence-id |
277649 |
14 |
list |
24631 |
15 |
list-index |
246 |
16 |
index |
3746 |
17 |
sentence-lookup |
犬 【いぬ】 (n) (1) dog (Canis (lupus) familiaris); (2) snoop (i.e. a detective, a spy, etc.); (n-pref) (3) counterfeit; inferior; useless; wasteful; (P); EP <br>お皿 【おさら】 (n) (See 皿) plate; dish; ED <br>匂い 【におい】 (n) (1) odour; odor; scent; smell; stench; (2) aura; whiff; smacks of ...; sense; flavour; flavor; (P); EP <br>クンクン (n,adv,vs) (on-mim) sniff; ED <br>Possible inflected verb or adjective: (te-form)<br>嗅ぐ 【かぐ】 (v5g,vt) to sniff; to smell; (P); EP <br> |
18 |
vocab-furigana |
嗅[か]ぐ |
19 |
sentence-furigana |
犬[いぬ]がお 皿[さら]の 匂[にお]いをクンクン<b> 嗅[か]いでいる</b>ね。 |
20 |
rtk-index |
6000 |
21 |
rtk-kanji |
4541 嗅 |
22 |
ko2001-index |
5974 |
23 |
ko2001-kanji |
3534 嗅 |
24 |
freq-index |
5887 |
25 |
freq-kanji |
1534 嗅 |
26 |
rtkliteko2001-index |
6000 |
27 |
rtkliteko2001-kanji |
5753 嗅 |
28 |
jlpt |
JLPT2 |
sample template:
1 <span style="font-size: larger;"><span style="font-size: larger;">%(vocab-expression)s: %(sentence-expression)s</span></span>
1 <span style="font-size: larger;"><span style="font-size: larger;"><!--fon-->%(vocab-furigana)s: %(sentence-furigana)s</span></span>
2 %(vocab-meaning)s: %(sentence-meaning)s<!--foff-->
3
4 <span style="font-size: smaller;">%(sentence-lookup)s<span>
5
6 %(rtkliteko2001-index)s %(rtkliteko2001-kanji)s %(vocab-sound-local)s %(sentence-sound-local)s
original import file, graphs and sound files generated with the following:
kore-1.7.sh kore-dic.txt kore-fix.txt
requires #scanki #cranki #lookup-sentences #kanji-sort #kanji-freq #kanji-count #kanji-info
xxfurigana
plugin to control furigana display
extends JapaneseSupport (required) as follows:
- furigana can be displayed for any field
- per-field or per-model control over kanji/reading display
- html formatting can be used in readings
- Japanese model tag not required
use the following HTML comments in the card template (effective from that point on until the next comment or the end of the template):
<!--fon-->
- show kanji with furigana reading
<!--ftip-->
- show readings in a tooltip
<!--fbigtip-->
- show readings in a big tooltip
<!--fnokanji-->
- show the reading only
<!--fnofuri-->
- show the kanji only
<!--foff-->
- do nothing
xfurigna plugin by Victor Suba, modified as follows:
- removed loss of space characters
- removed constant highlighting
- added tooltip display
download from within anki
scanki
smart.fm converter for anki
downloads lists from smart.fm and converts to text
sample lists files:
core2k-lists.txt core6k-lists.txt ko2001-lists.txt
Usage: scanki [OPTION] < LISTSFILE -s download sound -v include vocab only (no sentences) LISTSFILE: smart.fm list ids, 1 per line Examples: $ ./scanki [-v] < ./core2k-lists.txt > ./core2k.txt $ mkdir core2k.media; cd core2k.media; ../scanki -s [-v] < ../core2k-lists.txt
Fields |
|||
number |
number (-v) |
name |
example |
1 |
1 |
vocab-expression |
嗅ぐ |
2 |
2 |
vocab-kana |
かぐ |
3 |
3 |
vocab-meaning |
smell, sniff |
4 |
4 |
vocab-sound-remote |
[sound:http://assets3.smart.fm/assets/legacy/JLL/audio/Int/JW03341A.mp3] |
5 |
5 |
vocab-sound-local |
[sound:JLL-audio-Int-JW03341A.mp3] |
6 |
6 |
vocab-pos |
Verb |
7 |
7 |
vocab-id |
439323 |
8 |
|
sentence-expression |
犬がお皿の匂いをクンクン<b>嗅いでいる</b>ね。 |
9 |
|
sentence-kana |
いぬ が おさら の におい を くんくん <b>かいで いる</b> ね |
10 |
|
sentence-meaning |
The dog sniffed at the smell on the plate. |
11 |
|
sentence-sound-remote |
[sound:http://assets3.smart.fm/assets/legacy/JLL/audio/Int/JS03341A.mp3] |
12 |
|
sentence-sound-local |
[sound:JLL-audio-Int-JS03341A.mp3] |
13 |
|
sentence-id |
277649 |
14 |
8 |
list |
24631 |
15 |
9 |
list-index |
246 |
16 |
10 |
index |
3746 |
compared with the smart.fm import plugin:
- multiple lists can be downloaded in a single operation
- vocab items and sentences are together in the same fact, so can be made into spaced cards or used to customise formatting, or used to change between vocab and sentence cards
kana reading is preserved (use #cranki to add furigana readings with much less manual editing)
includes sentence <b> tags, vocab parts-of-speech, remote sound links, list id and per-list and overall indices
- doesn't exclude entries with non-unique kanji fields but with unique combinations of other fields
see #kore for more example usage
requires xmlstarlet
cranki
convert readings for anki
combines kana-only reading and mixed kanji/kana expression into new furigana reading field
usage: cranki --kanji KANJIFIELD --kana KANAFIELD [ --dic DICFILE ] < INFILE > OUTFILE KANJIFIELD: field number (starting from 0) of field in INFILE containing kanji expression KANAFIELD: field number (starting from 0) of field in INFILE containing corresponding kana expression DICFILE: optional reading examples used to disambiguate multiple matches INFILE: tab separated OUTFILE: has new furigana reading field appended example: cranki --kanji 0 --kana 1 --dic dic.txt < in.txt > out.txt missing fields and unmatchable lines are reported to stderr and marked in the output multiple matches are reported to stderr and multiple options are marked and included in output
contains extra logic for smart.fm: handles missing punctuation in kana field, skips unmatchable <b> tags, and uses spaces in kana field to disambiguate multiple matches
import into existing deck with #franki
see #kore for more example usage
kanji-graph
graph kanji occurrences in sorted sentences
requires #kanji-count #kanji-occurrences #kanji-sort #kanji-freq
kanji-count
report cumulative new kanji use in a collection of sentences
kanji-occurrences
find first and remaining kanji occurrences in a collection of sentences
kanji-sort
given a kanji list sort the input according to the furthest position in the list of all the kanji in a designated field of the input
sample kanji orders:
kanji-rtk.txt kanji-rtk3.txt kanji-ko2001-1.2.txt kanji-rtkliteko2001.txt
kanji-freq
report kanji frequency distribution in the specified field of the input
kanji-info
RTK name and number and vocab from #kanji-vocab indexed by kanji for use with ankitty
you can also include your stories and other info from your RTK deck by rebuilding with the following script
requires #cranki and #kanji-freq
kanji-vocab
JLPT, core2k and ko2001 vocab arranged by kanji. Can be used to provide Japanese prompts for (most of) RTK. Covers 1998 kanji (1760/2042 RTK1, 201/964 RTK3, 37 extra).
Contains three tab-separated fields: kanji, vocab, and prompt. Vocab contains words from JLPT, core2k and ko2001 preceded by combinations of '4', '3', '2', '1', 'c' or 'k', in anki furigana reading format. Prompt is the same as vocab but with the target kanji obscured.
import into your deck with #franki if deck is in use, otherwise into a new deck
enable furigana in question or other fields using the #xxfurigana plugin
lookup-sentences
looks up a gloss for each word in a sentence using the WWWJDIC Text Word Translation service (docs)
export deck, run through the script, import back into your deck with #franki if deck is in use, otherwise into a new deck
the only argument is the expression field number, output has definition field appended
ankitty
ankitty is a curses-based review-only anki client for embedded unix devices
grid
add a drawing grid to kanji as a writing aid
download the revtk kanji-drawing-grid.gif into the media directory and add the following to the card template
heisighelper
plugin and script to lookup rtk kanji in dictionary, offline copy of revtk, or page in a rtk pdf
plugin broken by current anki release
heisighelper-1.3.sh heisighelper-1.3.py
revtkrip
make an offline mirror of stories from RevTK
includes table of contents
Usage: revtkrip -u USERNAME -p PASSWORD
heisig-page
mapping of heisig number to RTK 4ed page number
import into your deck with #franki if deck is in use, otherwise into a new deck
errata
combines RTK 4ed pdf with the errata pdf and adds destinations for the book page numbers
errata-install-1.3.sh errata-map-1.3.txt
overwrite fields
this plugin is no longer supported (not maintained and no help will be provided), please use #franki instead
plugin to overwrite existing fields with data from an external file
- download from within anki
see the useage example but note the following:
- when anki starts it loads the current deck, then enables plugins, so you need to close the current deck and then open it again for the plugin to activate
- syncing must be disabled
windows users should use wordpad rather than notepad as the file has unix newlines which notepad doesn't handle and anki doesn't convert them automatically
- last tested with anki 0.9.9.8.6





