GithubHelp home page GithubHelp logo

ryouze / shogun Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 582 KB

[app] Learn Japanese kanji in the terminal.

Home Page: https://ryouze.net/

License: MIT License

CMake 17.15% C++ 82.85%
cpp japanese tui ftxui terminal ui cmake

shogun's Introduction

shogun

shogun is a TUI app for learning Japanese kanji. It is similar to Anki, but requires the user to type in the answer.

Screenshot of the app

Motivation

The only way for me to learn something is through brute force repetition. I've tried Anki, but I disliked the "Hard" and "Easy" buttons method, as I was never really sure if I remembered the answer.

Typing in the answers aligns more closely with my learning style. In fact, I've previously developed a similar app for learning German using JavaScript, and it proved to be highly effective.

Note: You need to already know both katakana and hiragana before using this app.

Features

  • Written in modern C++ (C++17).
  • Instant startups (<0.1s).
  • Comprehensive documentation with doxygen-style comments.
  • Automatic third-party dependency management using CMake's FetchContent.
  • No missing STL headers thanks to header-warden.

Project Structure

The src directory is organized as follows:

  • core: Contains the most basic, primitive, standalone functions that do not depend on any other part of the application.
  • utils: Contains utility functions that, while not as low-level as core, are used across different parts of the application.
  • io: Manages input/output operations.

The assets directory contains the required vocabulary.json file used by the application. On configuration, CMake will automatically copy this file to the build directory. Installing the application will also copy the file to the appropriate directory (e.g., /usr/local/bin).

Tested Systems

This project has been tested on the following systems:

  • MacOS 14.5 (Sonoma)
  • Manjaro 24.0 (Wynsdey)

Requirements

To build and run this project, you'll need:

  • C++17 or higher
  • CMake

Build

Follow these steps to build the project:

  1. Clone the repository:

    git clone https://github.com/ryouze/shogun.git
  2. Generate the build system:

    cd shogun
    mkdir build && cd build
    cmake ..
  3. Compile the project:

    To compile the project, use the following command:

    make

    To use all available cores with make, pass the -j flag with the number of cores available on your system:

    # MacOS
    make -j$(sysctl -n hw.ncpu)
    # GNU/Linux
    make -j$(nproc)
    # 8-core M1 Pro on MacOS
    make -j8

After successful compilation, you can run the program using ./shogun.

The mode is set to Release by default. To build in Debug mode, use cmake -DCMAKE_BUILD_TYPE=Debug ...

Install

If not already built, follow the steps in the Build section and ensure that you are in the build directory.

To install the program, use the following command:

sudo cmake --install .

Usage

To run the program, use the following command:

shogun

While running, the Tab key can be used to display a hint. The first time it is pressed, the program will display the kana transcription of the kanji. The second time, it will display the correct answer. If a flag (see below) is provided, the hint will respect the flag.

Flags

[~] $ shogun --help
Usage: shogun [--help] [--kana] [--answer]

Learn Japanese kanji in the terminal.

Optional arguments:
  -h, --help  shows help message and exits
  --kana      display the kana transcription of the kanji
  --answer    display the correct answer

If the kana (--kana) flag is provided, the program displays the kana transcription of the kanji. It is disabled by default, because the program is designed for kanji learning and the kana transcription is displayed in the example sentence anyway.

shogun --kana

If the answer (--answer) flag is provided, the program displays the correct answer. This is useful for exploring the vocabulary or debugging.

shogun --answer

Contributing

All contributions are welcome.

Credits

License

This project is licensed under the MIT License.

shogun's People

Contributors

ryouze avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.