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

option to require only specific languages? #5

Open
maia opened this issue Jan 12, 2016 · 2 comments
Open

option to require only specific languages? #5

maia opened this issue Jan 12, 2016 · 2 comments

Comments

@maia
Copy link
Collaborator

maia commented Jan 12, 2016

Suggestion: as the language files will grow (abbreviations, contractions,…) and will use more memory, it would be nice to let users require only specific languages, so that when e.g. someone only parses french text, constants and language specific rules of 20+ other languages won't be kept in memory.

@diasks2
Copy link
Owner

diasks2 commented Jan 13, 2016

Yes, this is a great idea. Any suggestions on how to best accomplish this? Or would it make sense just to have a separate "lite" gem that doesn't include any languages and the user passes in constants?

@maia
Copy link
Collaborator Author

maia commented Jan 15, 2016

I've asked around, the suggested solution is neither to use Kernel#load (threading issues) nor to use YAML files, but to give the users an option to manually require languages they need.

So instead of using requireon all languages, one could default to english only and let people either use require 'pragmatic_tokenizer/languages/all' or require 'pragmatic_tokenizer/languages/french' plus whatever other languages one needs.

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