GithubHelp home page GithubHelp logo

dictionary-lookup-rb's People

Watchers

 avatar  avatar  avatar

dictionary-lookup-rb's Issues

Headword == Term, eliminating relevant entries of people and places

Hi @nitishparkar , got another issue to pick your brain :)

In pearson.rb, the line 36 results = data["results"].select{ |d| d["headword"].downcase == term.downcase } is useful in eliminating a lot of the less relevant entries.

However, it is eliminating some very relevant entries, especially of people and places. e.g Barack Obama, Michael Jackson, or The Philippines.

This is because the Pearson API headwordformat for

  1. people is Surname, Firstname. Therefore, obama, barack will not equal lookup term obama
  2. some places is Place, prefix. Therefore, philippines, the will not equal lookup term philippines

As a ruby newbie I don't know the best way to resolve this. My initial thoughts are to alter line 36 as follows; results = data["results"].select{ |d| dhead = d["headword"].downcase d["headword"].downcase == term.downcase or d["headword"].downcase[0,term.length+1] == term.downcase + "," }. This caters for above mentioned headword format as I noticed that Pearson place a , after such entries.

DictionaryLookup::Base.define("hash") returning error for undefined method

I was using your gem and ran across three words that trigger the error

pearson.rb:43:in block in define': undefined method first' for nil:NilClass

using the code DictionaryLookup::Base.define(word)

The words I have run across have been "hash", "single", and "even"

I would be happy to look into the issue if you were open to me doing a pull request?

How to get second or third definitions

@nitishparkar I am interested in using dictionary_lookup. For example the word green. There are 3 definitions. Using results.first.part_of_speech and results.first.denotation give us the first definition. Could you please tell me how we would obtain the second or third definitions.

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.