NdYAG / mw-dict

Node.js wrapper of Merriam Webster Dictionary & Thesaurus Developer API
MIT License
10 stars 1 forks source link

Issue with yacht definition #1

Closed BobbyWibowo closed 6 years ago

BobbyWibowo commented 7 years ago

Here's the Definition returned by the library:

{ word: 'yacht',
functional_label: 'noun',
pronunciation: [ 'http://media.merriam-webster.com/soundc11/y/yacht001.wav' ],
definition: 
[ Sense {
    meanings: [ ': any of various recreational watercraft: as' ] } ] }

but the definition in the website is:

Definition of yacht
:any of various recreational watercraft: such as
a :a sailboat used for racing
b :a large usually motor-driven craft used for pleasure cruising

Not sure if it's the API's or the library's fault. I haven't tested many words. On a side note, many thanks for the good work.

NdYAG commented 7 years ago

Hi @BobbyWibowo, Sorry for responding late. Here is the response from API:

<entry id="yacht[1]">
<ew>yacht</ew>
<subj>NA#SP-a</subj>
<hw hindex="1">yacht</hw>
<sound>
<wav>yacht001.wav</wav>
<wpr>!y@t</wpr>
</sound>
<pr>ˈyät</pr>
<fl>noun</fl>
<et>
obsolete Dutch
<it>jaght,</it>
from Middle Low German
<it>jacht,</it>
short for
<it>jachtschip,</it>
literally, hunting ship
</et>
<def>
<date>1557</date>
<dt>:any of various recreational watercraft: as</dt>
<sn>a</sn>
<dt>:a sailboat used for racing</dt>
<sn>b</sn>
<dt>
:a large usually motor-driven craft used for pleasure cruising
</dt>
</def>
</entry>

I'll work on it soon. Thank you for reporting the bug.

NdYAG commented 6 years ago

Hi @BobbyWibowo, Please check the latest commit. https://github.com/NdYAG/mw-dict/commit/2e742bfa92153869a183b69f927d2a6893f66a9a

It works for yacht and other words that do not have sense number <sn> right now. Please update to version 1.0.5 for it. Thank you for responding it.

image

BobbyWibowo commented 6 years ago

Thank you very much. Working properly from here with version 1.0.5.

On a side note, I have a question about the word charge. For its 7-th definition, the library is returning:

Sense {
  number: 'a',
  meanings: [ ': a violent rush forward (as to attack) ' ],
  illustrations: [ 'the charge of the brigade' ] }

Sense {
  number: 'a',
  senses: 
   [ Sense {
       number: 'a',
       meanings: [ ': a violent rush forward (as to attack) ' ],
       illustrations: [ 'the charge of the brigade' ] },
     Sense {
       number: '(2)',
       meanings: [ ': the signal for attack ' ],
       illustrations: [ 'sound the charge' ] },
     Sense {
       number: 'b',
       meanings: [ ': a usually illegal rush into an opponent in various sports (as basketball)' ] } ] }

Basically the 7-th definition have 2 Senses with the number a. The first Sense has no additional Senses, the second Sense has additional Senses in which it also has the first Sense.

This is how it looks in the website: https://www.merriam-webster.com/dictionary/charge screenshot_20171116_195124

I don't particularly care about the "in charge" thing at the bottom by the way, but I included it in the screen shot anyways since the library seemed to be not returning it as well (or I might have missed it).

NdYAG commented 6 years ago

@BobbyWibowo I see. It's caused by a tag <snp> in the response from the API. It will be fixed soon.

NdYAG commented 6 years ago

Hi @BobbyWibowo , a new version 1.0.6 is available. Please check it out. image

NdYAG commented 6 years ago

Hi @BobbyWibowo, Since the latest version works now, I'll close the issue now. Feel free to re-open it anytime when you find anything wrong about it!