WordsAPI

부분 유료
Verified
분류별 dpventures | 업데이트됨 vor 25 Tagen | Data
인기

9.9 / 10

지연 시간

178ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

How to filter word types when validating (game dev)

Rapid account: Dnapoleoni
dnapoleoni
vor 5 Jahren

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 vor 5 Jahren

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 vor 5 Jahren

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.

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입