JPDict is a Japanese dictionary application built using Rust and eframe.
TLDR: Download and run /target/release/JPDict.exe
-
NEW FEATURE: Read the clipboard / Search the selected area
-
Installation
-
Usage
-
Project Structure
-
Database
-
Dictionary Entries
-
User Interface
-
Search Functionality
-
License
To install JPDict, clone the repository and build it using Cargo:
https://github.com/Luna5akura/JPdict-App.git
cd jpdict
cargo build --releaseTo run JPDict, use the following command:
cargo run --releaseThe project is organized into the following modules:
src/main.rs: The main entry point of the application.src/db/: Functions for initializing and populating the database.src/dictionary.rs: Defines the structure of dictionary entries.src/ui/: Manages the user interface using the eframe crate.
The database is initialized and populated with Japanese dictionary entries from JSON files. It uses SQLite for storage.
The database is initialized with the following schema:
CREATE TABLE IF NOT EXISTS dictionary (
id INTEGER PRIMARY KEY,
word TEXT NOT NULL,
reading TEXT NOT NULL,
pos TEXT NOT NULL,
inflection TEXT NOT NULL,
freq INTEGER NOT NULL,
translations TEXT NOT NULL,
sequence INTEGER NOT NULL,
tags TEXT NOT NULL,
pronunciation TEXT NOT NULL
);The database is populated from JSON files located in the assets directory. Each file contains an array of dictionary entries.
Dictionary entries are structured as follows:
#[derive(Clone)]
#[derive(Debug, Serialize, Deserialize)]
pub struct DictionaryEntry {
pub word: String,
pub reading: String,
pub pos: String,
pub inflection: Option<String>,
pub freq: i32,
pub translations: Vec<String>,
pub sequence: i32,
pub tags: Option<String>,
pub pronunciation: String,
}The user interface is built using eframe and egui, providing a simple and intuitive way to search for and view dictionary entries.
The search bar allows users to enter a query to search the dictionary.
Search results are displayed in a scrollable list, with each result showing the word, reading, part of speech, inflection, frequency, tags, and translations.
The search functionality is implemented with the following features:
- NEW FEATURE: Read the clipboard / Search the selected area
- Search by word, reading, translations, or pronunciation.
- Results are scored based on relevance and frequency.
- Pagination is supported to handle large result sets.
This project is licensed under the MIT License.
