Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use it on the client-side ? #16

Closed
vasco3 opened this issue Feb 3, 2019 · 4 comments
Closed

Is it possible to use it on the client-side ? #16

vasco3 opened this issue Feb 3, 2019 · 4 comments
Labels
🙋 no/question This does not need any changes

Comments

@vasco3
Copy link

vasco3 commented Feb 3, 2019

I would like to check spelling on an online editor in a web app.
I see that the dictionaries use file-system. Is there a way to bypass that?

@wooorm
Copy link
Member

wooorm commented Feb 3, 2019

Yep, it’s possible, but then you need to find some way to load the dictionaries indeed. You could, instead of something like require('dictionary-nl'), use fs.readFile in combination with something like brfs with browserify instead. Other bundlers probably have similar features.

@vasco3
Copy link
Author

vasco3 commented Feb 3, 2019

Awesome, that helps! Dank u zeer

@wooorm
Copy link
Member

wooorm commented Feb 3, 2019

Asjeblieft!

@wooorm wooorm closed this as completed Feb 3, 2019
@vasco3
Copy link
Author

vasco3 commented Feb 17, 2019

I ended up loading the dictionary as js files stored in a string template.
And in the utility function I had to mimick the load function from the woorm dictionaries

 const spell = retext()
    .use(retextSpell, callback => {
      callback(null, {
        aff: en_us_aff,
        dic: en_us_dic,
      });
    })
    .use(retextSyntaxUrls);

works perfectly 🎉

@wooorm wooorm added the 🙋 no/question This does not need any changes label Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes
Development

No branches or pull requests

2 participants