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

Allow for extension of lexicon #701

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Conversation

passbyval
Copy link
Contributor

@passbyval passbyval commented Sep 26, 2023

Context

I was working with the tagger API, and I realized that many "tech" words aren't tagged properly. As a work-around, I'm currently doing this, but thought it would be useful to have a way to do so within the API:

import extendedLexicon from './lexicon.json'

const lexicon = new Lexicon(language, TAGS.DEFAULT)

lexicon.lexicon = {
  ...lexicon.lexicon,
  ...extendedLexicon,
}

Summary

Add 4th parameter to allow for the extension of lexicons to prevent breaking previous versions.

@coveralls
Copy link

coveralls commented Oct 15, 2023

Pull Request Test Coverage Report for Build 6318130822

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.008%) to 87.349%

Totals Coverage Status
Change from base Build 6148761892: 0.008%
Covered Lines: 9664
Relevant Lines: 10693

💛 - Coveralls

@Hugo-ter-Doest
Copy link
Collaborator

Thank you so much for your idea and contribution. Will merge this now.

@Hugo-ter-Doest Hugo-ter-Doest merged commit eb333e7 into NaturalNode:master Oct 15, 2023
6 checks passed
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

Successfully merging this pull request may close these issues.

3 participants