feat(spellcheck): add Ukrainian language for spellcheck (#1382)

This commit is contained in:
Dmitriy Danilov
2020-10-14 18:08:02 +03:00
committed by GitHub
parent 2198244a65
commit 67179c0b31
4 changed files with 27 additions and 1 deletions

View File

@@ -36,6 +36,9 @@ describe('main/Spellchecker.js', function() {
SpellChecker.getSpellCheckerLocale('ru').should.equal('ru-RU');
SpellChecker.getSpellCheckerLocale('ru-RU').should.equal('ru-RU');
SpellChecker.getSpellCheckerLocale('uk').should.equal('uk-UA');
SpellChecker.getSpellCheckerLocale('uk-UA').should.equal('uk-UA');
});
});
@@ -134,6 +137,25 @@ describe('main/Spellchecker.js', function() {
});
});
describe('uk-UA', function() {
let spellchecker = null;
before(function(done) {
spellchecker = new SpellChecker(
'uk-UA',
path.resolve(__dirname, '../../src/node_modules/simple-spellchecker/dict'),
done
);
});
it('should spellcheck', function() {
spellchecker.spellCheck('українська').should.equal(true);
});
it('should give suggestions', function() {
spellchecker.getSuggestions('украінська', 1).length.should.be.equal(1);
});
});
describe('de-DE', function() {
let spellchecker = null;