Coder Social home page Coder Social logo

edr1412 / gd-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ajatt-tools/gd-tools

0.0 0.0 0.0 36.23 MB

A set of tools to enhance GoldenDict.

Home Page: https://tatsumoto.neocities.org/blog/setting-up-goldendict#gd-tools

License: GNU General Public License v3.0

Shell 9.63% C++ 83.12% Lua 7.25%

gd-tools's Introduction

GoldenDict tools

A set of helpful programs to enhance goldendict for immersion learning.

Table of Contents

Installation

First, install goldendict-ng.

Pacman-based distros

Install gd-tools-git from the AUR.

Other distros

If you want to package gd-tools for your distro and know how to do it, please create a pull request.

Manual installation
  1. To build the gd-tools you need to install xmake and gcc (13.1 and newer).

  2. Run ./quickinstall.sh.

    Note: You can run ./quickinstall.sh --local to install the program locally (to ~/.local/ ).

Setup

Open GoldenDict, press "Edit" > "Dictionaries" > "Programs" and add the installed executables. Set type to html. Command Line: <name of script> --word %GDWORD% --sentence %GDSEARCH%. Optionally add arguments, such as: gd-mecab --word %GDWORD% --sentence %GDSEARCH% --user-dict <path> --font-size 20px. These programs are treated as dictionaries and you can add them under "Dictionaries" or "Groups".

gd-marisa

This script outputs the sentence with clickable characters and searches for the longest available dictionary entry (from a predefined list) beginning at that character. For deinflection it currently relies on the hunspell dictionary by epistularum, available here. It also provides links of available entries of smaller substrings.

demo

Usage

gd-marisa --word %GDWORD% --sentence %GDSEARCH% --path-to-dic [PATH_TO_DIC_FILE]

The path to the .dic is an optional argument and defaults to /usr/share/gd-tools/marisa_words.dic

Dependencies

marisa-trie. The official Arch Linux package is called marisa, but it's already a dependency of goldendict.

Building an own index from a set of words

If you would like to make changes to found words, you can also create an own index from a newline-separated list of words (here called keyset.txt):

marisa-build < keyset.txt > keyset.dic

More information at https://www.s-yata.jp/marisa-trie/docs/readme.en.html

gd-mecab

This script passes a sentence through mecab in order to make every part of the sentence clickable.

screencast-area-2023-.3.-18_20-56-12.mp4

Dependencies

This script requires MeCab and the IPA dictionary to be installed. If you are on an Arch Linux system you can simply install the AUR package mecab-ipa to obtain both.

Command format

Add this script to GoldenDict under "Dictionaries" > "Programs" (format HTML), like this:

gd-mecab --word %GDWORD% --sentence %GDSEARCH%

Optional arguments

  • --font-size SIZE the font size to be used, e.g. 30px.
  • --user-dict FILE full path to the user_dic.dic file. This is done automatically if you install via make.

gd-images

This script shows the top 5 pictures from Bing images for the given search string.

image

gd-strokeorder

This script shows the search string in the KanjiStrokeOrders font.

screenshot

Font source: https://www.nihilist.org.uk/

Arguments:

  • --max-len 5 maximum size of the input string.
  • --font-size 10rem font size. It has to be large in order to see the stroke numbers.

How to call:

gd-strokeorder --word %GDWORD%

gd-handwritten

This script displays the handwritten form of each character

screenshot

Font source: ArmedLemon.

How to call:

gd-handwritten --word %GDWORD%

gd-massif

This script shows example sentences from https://massif.la/

image

gd-ankisearch

This script searches Anki cards in your collection that contain %GDWORD%.

screenshot

Arguments:

  • --field-name NAME optional field to limit search to.
  • --deck-name NAME optional deck to limit search to.
  • --show-fields VocabKanji,SentKanji optional comma-separated list of fields to show.

Example invocation:

gd-ankisearch --field-name VocabKanji --show-fields VocabKanji,SentKanji,Image,SentAudio --word %GDWORD%

gd-tools's People

Contributors

tatsumoto-ren avatar btrkeks avatar konstantindjairo 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.