WordsAPI

FREEMIUM
Verified
By dpventures | Updated 15 days ago | Data
Popularity

9.9 / 10

Latency

190ms

Service Level

100%

Health Check

N/A

Back to All Discussions

How to filter word types when validating (game dev)

Rapid account: Dnapoleoni
dnapoleoni
5 years ago

Hi team/all, ____________________________________________________________________________________________________________________________ Trying to build a word-game prototype using the WordsAPI and it’s working well, however I’m struggling to come up with a consistent method to determine whether or not a word is valid. ____________________________________________________________________________________________________________________________ Originally I was testing whether a definition existed, but then some words that should be valid (e.g. “pops” and “ere”) don’t contain any definitions. ____________________________________________________________________________________________________________________________ Then I tried using various “frequency” values, however I found them to be fairly inconsistent - uncommon yet valid words are getting no response from /frequency/ calls (e.g. “dap” and “jape”) and frequency values within the /words/ endpoint are wildly uneven (e.g. dap: 2.02, awl: 2.08, jape: 2.31, gop: 2.36, jus: 2.94, aaa: 3.13, rin: 3.48). ______________________________________________________________________________________________________________________________ Is there any way to test what type a word is, so as to filter out ones that will technically contain a high frequency, but I might not want to allow in my word game? I’m thinking of things like abbreviations, foreign words, proper nouns, plurals, swear words, etc… ____________________________________________________________________________________________________________________________ Any help would be appreciated.

Rapid account: Garabedium
garabedium Commented 5 years ago

You should be able to check if a 404 response is returned. The bigger issue that I see is that the API does some kind of partial matching. For example, if I search the word: xls. It will return “xl” as a valid result. That’s problematic if you’re trying to validate a word…You’d always have to check if the returned API word matches the user’s original input. There should be a strict boolean flag or something to avoid partial or fuzzy matching.

Rapid account: Wordsapi
wordsapi Commented 5 years ago

Hi Dnapoleoni,
Defining which words are “valid” words is a hard problem, as of course new words pop up all the time. We don’t have categories like abbreviations or foreign words in our database, sorry. You could try limiting it to words that have definitions and have a frequency greater than some amount, but you’re still likely to miss words.

You may want to consider using your existing code, and then keeping a “white list” of words don’t meet your criteria but you know are valid. That would be a manual process unfortunately.

Join in the discussion - add comment below:

Login / Signup to post new comments