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

Updating lexicon at build rather than runtime #1161

Open
donkindred opened this issue Dec 10, 2024 · 1 comment
Open

Updating lexicon at build rather than runtime #1161

donkindred opened this issue Dec 10, 2024 · 1 comment

Comments

@donkindred
Copy link

My use case requires results returned in ideally less than 50ms. Is it possible to save a lexicon after adding words & tags instead of at runtime? I would ideally run it as part of the deployment pipeline.

In addition to the speed concerns, I'm computing the same thing every session, and it's a (minor, yet annoying) waste.

@spencermountain
Copy link
Owner

spencermountain commented Dec 10, 2024

my curiosity is piqued - would love to know more about the project.

Many ways to do this, but it is a very minor computation, compared to the 10s-of-thousands of conjugations compromise does at runtime. It's just a javascript object (found here) that you can do whatever you'd like to, including storing it in localstorage or whatever. compromise/one comes with a (nearly) zero lexicon, so you could ship it once, or something.
You could also fork and add your terms to ./data/lexicon and run npm run pack && npm run build to have it included on init.
cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants