{"id":18785625,"url":"https://github.com/pigoz/lat","last_synced_at":"2025-04-13T12:34:05.603Z","repository":{"id":40016214,"uuid":"234719829","full_name":"pigoz/lat","owner":"pigoz","description":"A set of tools to automate language acquisition through immersion. Includes sentence analysis (from books, subtitles) and Anki cards creation.","archived":false,"fork":false,"pushed_at":"2023-04-11T22:10:18.000Z","size":1206,"stargazers_count":23,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-17T00:55:54.260Z","etag":null,"topics":["anki","japanese","kindle-highlights","language-learning","language-processing","mpv","sub2srs"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pigoz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-18T10:46:39.000Z","updated_at":"2024-03-15T16:45:47.000Z","dependencies_parsed_at":"2023-02-16T13:45:51.452Z","dependency_job_id":null,"html_url":"https://github.com/pigoz/lat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pigoz%2Flat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pigoz%2Flat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pigoz%2Flat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pigoz%2Flat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pigoz","download_url":"https://codeload.github.com/pigoz/lat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223589087,"owners_count":17169890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anki","japanese","kindle-highlights","language-learning","language-processing","mpv","sub2srs"],"created_at":"2024-11-07T20:49:08.983Z","updated_at":"2024-11-07T20:49:09.739Z","avatar_url":"https://github.com/pigoz.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LaT\n## Overview\n**La**nguage **T**ools 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:\n\n### Automatic anki card creation\n\u003cimg src=\"https://user-images.githubusercontent.com/24681/91639632-42db3b80-ea18-11ea-8350-6d226ebc78e9.png\" width=\"400\" title=\"subs2srs\"\u003e\n\n### Words lookup inside mpv\n\u003cimg src=\"https://user-images.githubusercontent.com/24681/91639666-7d44d880-ea18-11ea-9db9-49310b6432f2.png\" width=\"500\" title=\"jplookup\"\u003e\n\n## Installation\n1. Install the required dependencies\n- [mpv master](https://aur.archlinux.org/packages/mpv-git/) (the current stable release doesn't have the new scripting interface used here)\n- [myougiden](https://aur.archlinux.org/packages/python-myougiden/) (I'm working on internal dictionaries, but it will take a while)\n- [mecab](https://aur.archlinux.org/packages/python-mecab/)\n- [ffmpeg](https://www.archlinux.org/packages/extra/x86_64/ffmpeg/)\n- [ruby](https://www.archlinux.org/packages/extra/x86_64/ruby/)\n\n2. Install [Bundler](https://bundler.io/)\n```bash\n$ gem install bundler\n```\n\n3. Clone repository and install dependencies\n```bash\n$ git clone https://github.com/pigoz/lat.git\n$ cd lat\n$ bundle install\n```\n\n4. Create a symbolic link in your mpv scripts folder\n```bash\n$ ln -nfs bin/lat-mpv ~/.mpv/scripts/lat.run\n```\n\n**NOTE** Sometimes the mpv scripts folder might be following the XDG spec and be located in `~/.config/mpv/scripts`\n\n## Configuration\nYou have to create a config file at `~/lat.yaml` or `$XDG_CONFIG_HOME/lat/config.yaml`.\n\n### Minimal required config file\n```yaml\nanki:\n  collection: ~/Library/Application Support/Anki2/User 1\n```\n\n### Full config file\n```yaml\nanki:\n  collection: ~/Library/Application Support/Anki2/User 1\n  export:\n    deck_name: sub2srs\n    tag_name: sub2srs\n    note_type: Japanese sub2srs\n  fields:\n    source: Source\n    line: Line\n    reading: Reading\n    words: Words\n    time: Time\n    sound: Sound\n    image: Image\n\nblacklist:\n  morphemes:\n    active: false\n    fields:\n      - note_type: Japanese sub2srs\n        field_name: Line\n  files:\n    - share/blacklist.txt\n```\n**NOTE** Click [here](https://docs.ankiweb.net/#/files?id=file-locations) for more details on Anki media collection folder\n\n**NOTE** To use subdecks in `anki.export.deck_name`, simply add `::` after parent deck (eg: `Japanese::sub2srs`)\n\n**NOTE** To not export a field to Anki set it's value to `null`. (eg: `time: null` will skip the time field)\n\n### mpv default bindings\n\n- `l` and `GAMEPAD_ACTION_UP` are bound to the dictionary lookup\n- `b` triggers card creation mode starting from the current subtitle\n- `g` triggers card creation mode and automatically selects 1 adjacent subtitles lines\n\n### Myougiden\n[Install myougiden](https://github.com/melissaboiko/myougiden) if haven't already and you need compile the dictionary database at least once\n```bash\n$ sudo updatedb-myougiden -f\n```\n\n## Improvement from [mpv-nihongo](https://github.com/pigoz/mpv-nihongo)\n\n- Code is much better, and every part is test driven which makes adding new features easier\n- Dictionary access is multithreaded\n- 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.\n- You can also add stuff to Anki that comes from books (and the code uses TTS to create audio)\n- Blacklist based on your subs2srs deck (BETA)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpigoz%2Flat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpigoz%2Flat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpigoz%2Flat/lists"}