Use spellchecker Typo.js to determine if words are valid.
parent
a5350b79a6
commit
0855f7d0bc
@ -0,0 +1,3 @@
|
||||
[submodule "Typo.js"]
|
||||
path = Typo.js
|
||||
url = https://github.com/cfinke/Typo.js.git
|
@ -0,0 +1 @@
|
||||
Subproject commit 566f9888239c1e26c709da76a2c4ba0e8ba9d1e1
|
@ -1,4 +1,14 @@
|
||||
var dictionary;
|
||||
|
||||
fetch('typo/dictionaries/en_US/en_US.aff')
|
||||
.then(response => response.text())
|
||||
.then(aff => fetch('typo/dictionaries/en_US/en_US.dic')
|
||||
.then(response => response.text())
|
||||
.then(dic => {
|
||||
dictionary = new Typo('en_US', aff, dic);
|
||||
}));
|
||||
|
||||
function isValidWord(str) {
|
||||
return true;
|
||||
return dictionary.check(str);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue