Code Monkey home page Code Monkey logo

lidi's Introduction

lidi

lidi - a little English-Polish dictionary, MySQL database + Redis + REST API server (Go) + command-line client in Golang (with text to speech thanks to Google API) + desktop client (Go, fyne).

MySQL database definition + English-Polish dictionary, 10000 words: ./database/database.sql

Docker:

  1. docker-compose up
  2. go build -o lidi-client ./cmd/client
  3. ./lidi-client en house 
  4. ./lidi-desktop

Or:

Server:

Setup MySQL manually, database.sql file contains the table definition and data. install Redis.

go build -o lidi-server ./cmd/web

Usage of ./lidi-server:
  -addr string
    	HTTP network address (default ":8080")
  -dsn string
    	MySQL data source name (default "web:pass@/dictionary")

Client: go build -o lidi-client ./cmd/client

Usage:
    lidi-client [en|pl|speak|add|update|delete]

  Subcommands: 
    en       Translate from English to Polish
    pl       Translate from Polish to English
    speak    Say in English (Google API is used)
    add      Add new item to dictionary (English=Polish) returns ID
    update   Update item in dictionary (ID English=Polish)
    delete   Delete item in dictionary (English=Polish)

  Flags: 
       --version   Displays the program version string.
    -h --help      Displays help with available flag, subcommand, and positional value parameters.
    -s --server    Dictionary server address (default: http://localhost:8080)
    -p --speak     Speak English after translate (en|pl commands)
    -i --id        show record id


  Example:
    1. Server start: ./lidi-server
    2. Client query: ./lidi-client en house -p
                     ./lidi-client add tree=drzefo
                     ./lidi-client update 16354 tree=drzewo  
                     ./lidi-client delete 16354

Note: speak command (and -p flag) use htgo-tts lib, htgo-tts needs mplayer.

Screen

Desktop: go build -o lidi-desktop ./cmd/desktop

Screen

Note: server, client and desktop tested on Linux only.

English word list: The BNC/COCA headword lists. Translation: Google Translate, printed dictionaries, memory.

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.