WordsAPI

FREEMIUM
Verified
✓
By dpventures | Updated 5 days ago | Data
Popularity

9.9 / 10

Latency

206ms

Service Level

100%

Health Check

N/A

Back to All Discussions

Wrong number of syllables.

Rapid account: Finest Otter
FinestOtter
7 years ago

I was using this API to get test data for a syllable-counting neural network. However, a significant portion of the random words came with the wrong number of syllables, which is an issue for having a neural network learn based on that data.

Rapid account: Finest Otter
FinestOtter Commented 7 years ago

Thanks a lot for the help and the quick responses, I will try that. : )

Rapid account: Wordsapi
wordsapi Commented 7 years ago

You need to encode that letterPattern - in a url, the + symbol can do weird things (usually gets interpreted as a space). If you’re using javascript, you can do

var pattern = encodeURIComponent("[1]+$");

The result, when put into the url you gave, in place of the raw regex, works ok.


  1. A-z ↩

Rapid account: Finest Otter
FinestOtter Commented 7 years ago

I tried this call but I get a response status of 500 every time I use this, is there something wrong with the regular expression :
[1]+$
When I tested it with a regular expression tool online it seemed to work.

https://wordsapiv1.p.mashape.com/words/?random=true&letterPattern=[2]+$&syllablesMin=1&lettersMax=20&syllablesMax=10
(The full API call)


  1. A-z ↩

  2. A-z ↩

Rapid account: Wordsapi
wordsapi Commented 7 years ago

Does look like a bug with those words. You could use the letterPattern param to avoid them by adding a regex that filters out spaces or dashes.

https://www.wordsapi.com/docs#search

Rapid account: Finest Otter
FinestOtter Commented 7 years ago

Looking at it again it seems to only by compound/ multiword words. Do you have a suggestion on how to avoid getting these?

<table>
<tr>
<td>word: </td> <td>number of syllables (from api) </td> <td>number of syllables </td> </tr>
<tr> <td>vagus nerve </td> <td> 2 </td> <td>3 </td></tr>
<tr><td>double-park </td> <td>2 </td> <td>3 </td></tr>
<tr><td>hundred-percenter </td><td>4 </td> <td> 4</td> </tr>
<tr><td>ground beetle</td> <td>2 </td> <td> 3</td> </tr>
<tr><td>percussion instrument </td> <td> 5 </td> <td> 6</td> </tr>
</table>

Rapid account: Wordsapi
wordsapi Commented 7 years ago

Can you provide some examples so I can investigate?

Join in the discussion - add comment below:

Login / Signup to post new comments