Language Tools is a set of tools to automate language acquisition through immersion. Includes sentence analysis (from books, subtitles) and Anki cards creation. The most interesting feature is looking up Japanese words of the current subtitle line, and exporting the current subtitle line to Anki. A screenshot is worth a lot more than words, so here's two screenshots:
- Install the required dependencies
- mpv master (the current stable release doesn't have the new scripting interface used here)
- myougiden (I'm working on internal dictionaries, but it will take a while)
- mecab
- ffmpeg
- ruby
- Install Bundler
$ gem install bundler
- Clone repository and install dependencies
$ git clone https://github.com/pigoz/lat.git
$ cd lat
$ bundle install
- Create a symbolic link in your mpv scripts folder
$ ln -nfs bin/lat-mpv ~/.mpv/scripts/lat.run
NOTE Sometimes the mpv scripts folder might be following the XDG spec and be located in ~/.config/mpv/scripts
You have to create a config file at ~/lat.yaml
or $XDG_CONFIG_HOME/lat/config.yaml
.
anki:
collection: ~/Library/Application Support/Anki2/User 1
anki:
collection: ~/Library/Application Support/Anki2/User 1
export:
deck_name: sub2srs
tag_name: sub2srs
note_type: Japanese sub2srs
fields:
source: Source
line: Line
reading: Reading
words: Words
time: Time
sound: Sound
image: Image
blacklist:
morphemes:
active: false
fields:
- note_type: Japanese sub2srs
field_name: Line
files:
- share/blacklist.txt
NOTE Click here for more details on Anki media collection folder
NOTE To use subdecks in anki.export.deck_name
, simply add ::
after parent deck (eg: Japanese::sub2srs
)
NOTE To not export a field to Anki set it's value to null
. (eg: time: null
will skip the time field)
l
andGAMEPAD_ACTION_UP
are bound to the dictionary lookupb
triggers card creation mode starting from the current subtitleg
triggers card creation mode and automatically selects 1 adjacent subtitles lines
Install myougiden if haven't already and you need compile the dictionary database at least once
$ sudo updatedb-myougiden -f
Improvement from mpv-nihongo
- Code is much better, and every part is test driven which makes adding new features easier
- Dictionary access is multithreaded
- Generated furigana matches the sigle Kanji, which results in a much nicer alignment. i.e.: 先[せん] 生[せい] instead of 先生[せんせい]. I have a very visual memory so this helped me immensely, and was the feature I could not add to mpv-nihongo since the code was so bad.
- You can also add stuff to Anki that comes from books (and the code uses TTS to create audio)
- Blacklist based on your subs2srs deck (BETA)