Giter Club home page Giter Club logo

guile-words's Introduction

guile-words

guile-words is a Guile port of the Vocabulary Python library that displays meanings, synonyms, antonyms and more for a given word.

guile-words is primarily provided as a library but it includes example programs that function as command-line applications to make use of it. An interesting bonus that comes from using the Guile programming language is that the library becomes immediately available in C (and C++) programs and libraries as well.

The program makes use of several online dictionaries:

  • Wordnik
  • Glosbe (not yet implemented)
  • BighugeLabs
  • Urbandict

Requirements

Aside from a correct Guile installation, the library also requires guile-json

Installation

Download the tar file or clone a git reository

git clone https://github.com/pasoevi/guile-words.git

put the words.scm (or the compiled .go) file in the Guile site package, typically

/usr/share/guile/site/

Usage examples

The Scheme library

(use-modules (words))

(antonym "good")
 => (ant bad evil bad badness evil evilness ill)

(synonym "poor")
 => (syn hapless miserable misfortunate pathetic
 ... piteous pitiable pitiful wretched inadequate short poor people people)

(hyphenation "momentary")
 => [{"seq":0,"text":"mo","type":"stress"},
 ... {"seq":1,"text":"men"},{"seq":2,"text":"ta"},{"seq":3,"text":"ry"}]

Reference

Available functions

  • meaning
  • synonym
  • antonym
  • similar
  • related
  • hyphenation
  • pronunciation

Adding new actions

Every high-level look up command added as a function to the Scheme library immediately becomes available to the C application.

Adding actions to already supported backends

  • Add a new action to the action list
  (define actions
   '((#:meaning . "define")
     (#:synonym . "syn")
     (#:antonym . "ant")
     (#:related . "rel")
     (#:similar . "sim")
     (#:usage-examples . "usage-examples")
     (#:hyphenation . "hyphenation")
     (#:pronunciation . "pronunciations")
     (#:define . "definitions"))
     (#:newaction . "newaction" )) ; <== Your new action here
  • Define a high level function that calls the existing backend service and pass the newly defined action to it:
  (define (similar word)
    (parse-bighuge word #:newaction))

The C client program

app synonym good
=> full estimable honorable respectable beneficial just upright
... expert practiced proficient skillful skilful dear near
depend quality vantage well thoroughly soundly

Contributing

The git repository contains the TODO.md file. Look at issues page on github as well.

Copying

Please, see the LICENSE file.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

guile-words's People

Contributors

pasoevi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jgarte

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.