- Rust 62%
- Swift 31%
- C 3.9%
- TypeScript 2.7%
- Makefile 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| apps | ||
| bind | ||
| crates/bfmt | ||
| lib/gogaku | ||
| sql | ||
| src | ||
| tests | ||
| .gitignore | ||
| .swift-format | ||
| bun.lock | ||
| Cargo.lock | ||
| Cargo.toml | ||
| cliff.toml | ||
| clippy.toml | ||
| committed.toml | ||
| Justfile | ||
| LICENSE-APACHE | ||
| LICENSE-MIT | ||
| package.json | ||
| README.md | ||
| rustfmt.toml | ||
Gogaku
Japanese study companion.
Important
Consider this to be pre-alpha software. I make no guarantee of the stability of any documented APIs until the first official release.
Goal
This project aims to provide a fast, offline-first iOS experience for studying Japanese. Vocabulary lookup is powered by the standard community dictionaries (JMdict, KANJIDIC2, and friends), scheduling runs through the FSRS-5 algorithm, and the interface gradually shifts from English to Japanese as the user's vocabulary matures. Anything the user produces stays portable: cards, their scheduling, the review log and the settings are one SQLite file every frontend reads, which copies out as a backup and back in on another device.
Note
At this time, Gogaku targets iOS only. There are no plans to support Android, web, or desktop.
Organization
The project is partitioned into the top-level gogaku Rust library,
the SwiftUI iOS app, and the Swift bindings that
bridge the two over the C ABI. A command-line
frontend lives alongside as a workspace peer.
Workspace
Cargo (Rust's package manager) manages a workspace of several crates, specified
within its manifest. The iOS app is consumed as an Xcode project
under apps/ios/ that depends on the Swift package in bind/swift/, which
links the C ABI in lib/gogaku/.
./
├── Cargo.lock # cargo lockfile
├── Cargo.toml # cargo manifest
├── Justfile # useful dev commands
├── LICENSE-APACHE # apache 2.0 license
├── LICENSE-MIT # mit license
├── README.md # this document
├── apps/ # frontend apps
│ ├── cli/ # command-line app
│ ├── ios/ # SwiftUI iOS app
│ └── web/ # browser app
├── bind/ # language bindings
│ ├── swift/ # Swift package
│ └── wasm/ # WebAssembly bindings
├── crates/ # supporting crates
├── lib/ # foreign function interfaces
│ └── gogaku/ # C ABI
├── sql/ # database schema
└── src/ # top-level gogaku library
Tip
Run
just(orjust help) at the repo root to list the available development recipes.
Modules
Main components of gogaku are outlined below.
gogaku: top-level library that manages dictionary data and review state.packis the memory-mapped container every lookup reads,dictholds one module per upstream source,findis the search engine over them,loaddownloads and builds packs, andcardis the study state behind the optionalcardfeature.
Frontends
gogaku-cli: a command-line interface for dictionary lookup, review, and store maintenance.gogaku-ios: a native iOS application built with SwiftUI.gogaku-web: a browser application, served as static files.
Bindings
libgogaku: the C ABI every foreign binding speaks.GogakuKit: Swift package wrapping that ABI.gogaku-wasm: WebAssembly bindings, dictionaries only.
Supporting
bfmt: human-readable byte size formatting and parsing.tests: scheduling parity, checked against Anki and against the FSRS crate the model was transcribed from.
Testing
Rust unit tests live alongside each crate's source and run via cargo test --workspace (or just test). The browser app's tests run with bun run test
from apps/web. The iOS app's UI tests run through xcodebuild test against the simulator.
Credits
Gogaku would not be possible without the community dictionaries it depends on. Source files are fetched on-device from upstream; nothing is redistributed by this project.
- JMdict and JMnedict by the Electronic Dictionary Research and Development Group.
- KANJIDIC2 by the EDRDG.
- RADKFILE and KRADFILE by Jim Breen and the EDRDG.
- Tatoeba sentence pairs.
License
This project is dual-licensed under both the MIT License and the Apache License 2.0. You have permission to use this code under the conditions of either license pursuant to the rights granted by the chosen license.