Recently Written · git

subread-dictionary

Pop-up dictionary for Android that reads Yomitan dictionaries, with local audio

git clone https://github.com/equwal/subread-dictionary

Log | Files | Refs


README.md (5714 bytes)

1 # SubRead Dictionary
2 
3 A pop-up dictionary for Android that reads Yomitan dictionaries. Select a text
4 in any app and choose "SubRead Dictionary" in the text selection menu, share a
5 text to it, or send a word from
6 [SubRead Overlay](https://github.com/equwal/subread-overlay). The pop-up
7 opens over the app and shows each term at the start of the text, the longest
8 first, with the reading, the pitch accent, the frequency, and a button for
9 the audio. A tap on a character of the text looks up from there.
10 
11 Nothing leaves the device, except when a remote audio source is on.
12 
13 ## Screenshots
14 
15 <p>
16   <img src="fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width="260" alt="The pop-up over a text: the longest term first, with the reading, the pitch accent, the frequency and a Play button">
17   <img src="fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width="260" alt="Settings: the list of the imported dictionaries">
18 </p>
19 
20 The pictures are from a Viwoods AiPaper Reader.
21 
22 ## How to use it
23 
24 1. Import a dictionary: a Yomitan `.zip` (JMdict, Jitendex, a pitch accent
25    dictionary, a frequency list). The app reads format 3. The order of the
26    dictionaries in the settings is the order in the pop-up.
27 2. Local audio, optional: choose the `android.db` of the
28    [Local Audio Server for Yomitan](https://github.com/yomidevs/local-audio-yomichan),
29    the same file that AnkiConnect Android and Hoshi Reader use. The app copies
30    it into its folder. Or push it there with `adb`; the settings show the
31    folder. The order of the sources is a setting: `jpod, jpod_alternate,
32    nhk16, shinmeikai8, forvo`.
33 3. Remote audio, optional and off by default: one URL per line, with `{term}`
34    and `{reading}`. A URL can answer with an audio file (JapanesePod101 is
35    the default line), or with the JSON list of a Local Audio Server on the
36    network: `http://192.168.1.2:5050/?term={term}&reading={reading}`. The
37    remote sources come after the local ones.
38 
39 In the pop-up, "Play" plays the first source that has the word. A long press
40 on "Play" lists every source.
41 
42 ## How it works
43 
44 `:core` is plain Kotlin, with no Android in it:
45 
46 - `YomitanZip` reads the zip as a stream, one term at a time.
47 - `Deinflector` has the Japanese rules of Yomitan: 食べさせられた → 食べる,
48   with the word class of each step checked against the rules of the term.
49 - `Lookup` tries each prefix of the text, the longest first, and each
50   dictionary form of it, in one query.
51 - `Glossary` turns the structured content of a term into the simple HTML
52   that a `TextView` shows.
53 
54 `:app` has the SQLite store of the terms, the settings screen, the pop-up and
55 the audio.
56 
57 ## For other apps
58 
59 Send a text with any of these; the pop-up opens over your app:
60 
61 - `Intent.ACTION_PROCESS_TEXT` with `EXTRA_PROCESS_TEXT` (the text selection menu).
62 - `Intent.ACTION_SEND`, `text/plain`, with `EXTRA_TEXT` (the share sheet).
63 - The action `space.subread.dictionary.LOOKUP` with `EXTRA_TEXT`.
64 
65 Ask for the terms of a text, or the audio of a term, without the pop-up: the
66 content provider `space.subread.dictionary.lookup`, see
67 [docs/provider-api.md](docs/provider-api.md). SubRead Anki uses it.
68 
69 ## Anki cards
70 
71 With [SubRead Anki](https://github.com/equwal/subread-anki) installed, each
72 term in the pop-up has an "Anki" button. One tap makes a card in AnkiDroid:
73 the word, the reading, the definitions of each dictionary, the text as the
74 sentence, the first audio, and, from SubRead Anki, a screenshot and the
75 sentence read by the voice of the device.
76 
77 ## Build
78 
79 ```
80 ./gradlew :core:test :app:assembleDebug
81 ./gradlew :app:connectedDebugAndroidTest   # the SQLite store, on a device
82 ```
83 
84 The device test installs the debug app again and removes its data: the
85 imported dictionaries of the debug build are gone after it.
86 
87 `-PplayStore=true` leaves the Ko-fi link out of the build for Google Play.
88 
89 ## More projects
90 
91 - [SubRead](https://subread.space/): read along with an audiobook, in the browser.
92   Also [for Android](https://github.com/equwal/subread-android/releases/latest),
93   [for YouTube](https://github.com/equwal/subread-extension/releases/latest)
94   and [for KOReader](https://github.com/equwal/subread.koplugin).
95 - [SubRead Overlay](https://github.com/equwal/subread-overlay/releases/latest): subtitle lines over any Android media player.
96 - [SubRead Anki](https://github.com/equwal/subread-anki): one tap makes an Anki card from any Android app.
97 - [Subrep](https://github.com/equwal/subrep-android/releases/latest): live captions of the sound of your phone.
98 - [Book Simulator](https://booksimulator.com/): a reading room for Aozora Bunko and Project Gutenberg books.
99 - [honjimaku.com](https://honjimaku.com/): subtitles for Japanese audiobooks.
100 - [sbm Sync](https://sbmsync.com/): your bookmarks, the same on every device,
101   with [sbm](https://github.com/equwal/sbm) for dmenu,
102   [sbm for Android](https://github.com/equwal/sbm-android/releases/latest)
103   and the [sbm add-on](https://github.com/equwal/sbm-extension/releases/latest) for Firefox and Chrome.
104 - [Rebind](https://github.com/equwal/rebind/releases): remap the hardware buttons of e-ink readers and Android,
105   with [Ink Recents](https://github.com/equwal/ink-recents/releases/latest),
106   [Ink Dim](https://github.com/equwal/ink-dim/releases/latest)
107   and [Ink Update](https://github.com/equwal/ink-update/releases/latest).
108 - [dickt.store](https://dickt.store/): language-learning tools, flashcards and web toys.
109 - [hentaibun.online](https://hentaibun.online/): learn kanbun and kobun.
110 - [Recently Written](https://recentlywritten.com/): the blog, and a list of [all projects](https://recentlywritten.com/projects.html).
111 
112 ## Licence
113 
114 AGPL-3.0. See `LICENSE`.