javascript list of english words for a game

2020-04-02 08:31发布

I'm making a simple JS game that needs a list of English dictionary words. Will I need to build the list myself, or is it possible to access the system's or browser's spell-check dictionary - or maybe there's another solution?

8条回答
老娘就宠你
2楼-- · 2020-04-02 08:57

you can get a worlist here http://marcoagpinto.cidadevirtual.pt/proofingtoolgui.html .. look for the WORDLIST link on the right

查看更多
够拽才男人
3楼-- · 2020-04-02 09:03

The wordlist for Firefox spellchecking seems to come from this repository: https://github.com/marcoagpinto/aoo-mozilla-en-dict. So you could download it there to get a word list.

You can also install the dictionary as addon (https://addons.mozilla.org/en-GB/firefox/language-tools/) but I don't know if or how the dictionary-addons can be accessed with JavaScript directly from inside the browser.

查看更多
小情绪 Triste *
4楼-- · 2020-04-02 09:09

you can to use this:

https://www.javascriptspellcheck.com/JavaScript_SpellChecking_Dictionaries

there are many languages:

 Afrikaans (South Africa)
 American English (USA)
 Australian English
 Brazil (Modern Brazilian Portuguese)
 British English (UK)
 Catalan (Catalonia)
 Canadian English
 Danish Dictionary (Dansk)
 Dutch & Flemish (Nederlands)
 Gaelic
 German Dictionary (Deutsch)
 French (Francais)
 Frisian (Frysk, Seeltersk & Mooring)
 International English
 Italian (Italiano)
 Malaysian (Bahasa Malaysia)
 Portuguese (Portugues - Brazil and Portugal)
 Spanish (Espanol - Americas & Spain)
 Swedish (Svenska)
 Welsh (Cymric)
查看更多
我欲成王,谁敢阻挡
5楼-- · 2020-04-02 09:10

Easiest solution that I found is getting a text or JSON file from anywhere(on web) which contains all the English words(not meanings like in dictionary). I got it from this repository, this contains a text file and a JSON file.

You can easily read data from JSON file using javascript or other programming languages.

查看更多
小情绪 Triste *
6楼-- · 2020-04-02 09:12

with node you can install random-words

npm install random-words

import it and you're done:

var randomWords = require('random-words');
console.log(randomWords());

requirebin

查看更多
我命由我不由天
7楼-- · 2020-04-02 09:12

Was looking for a simple JSON endpoint I could use for a workbook - wound up uploading one to github:

https://gist.githubusercontent.com/jesseditson/1e6b2b524814320515ccfe7e2f856eda/raw/17d61fa1e80e14b13c4525b09f84148772586b59/words.json

查看更多
登录 后发表回答