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

Re-use loaded rules #14

Closed
slotties opened this issue Oct 2, 2013 · 1 comment
Closed

Re-use loaded rules #14

slotties opened this issue Oct 2, 2013 · 1 comment

Comments

@slotties
Copy link
Contributor

slotties commented Oct 2, 2013

Rules loaded by JLanguageTool.activateDefaultPatternRules() and JLanguageTool.activateDefaultFalseFriendRules() should be cached outside the JLanguageTool and be provided to it on creation.

The goal of this issue is to increase the speed and reduce the memory consumption of creating new JLanguageTools.

One choice is to move both methods to Language. The caller is able to cache the different variants of a Language then, e.g. "english with enabled pattern rules" and "english without pattern rules".

Various things must be taken care of:

  • where are user rules (JLanguageTool.addRule, JLanguageTool.disableRule, etc.) stored?
  • where are ignored words stored (JLanguageTool.addIgnoreWords adds them on the rule)?
  • any other things?

Constraints:

  • no changes on the XML structure
  • all the rule-loading and rule-management methods from JLanguageTool must still work. The new mechanism just enables more possibilities to cache for an API-user.
  • no changes on existing testing code (backward-compatibility)
danielnaber added a commit that referenced this issue Sep 15, 2014
…es for a language - creating the JLanguageTool object is now much faster after the first time (also see #14)
@danielnaber
Copy link
Member

Closing, this is basically implemented with the new Language.getPatternRules() now.

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

No branches or pull requests

2 participants