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.
Join in the discussion - add comment below:
Thanks a lot for the help and the quick responses, I will try that. : )
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.
A-z ↩
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)
A-z ↩
A-z ↩
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
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>
Can you provide some examples so I can investigate?