-
-
Notifications
You must be signed in to change notification settings - Fork 541
Add Polish language support #226
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
Open
miso-belica
wants to merge
9
commits into
main
Choose a base branch
from
claude/complete-polish-language-eXKDA
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nguage support to the sumy library.\n\n- Adds 'polish.py' as a custom stemmer using 'pystempel'.\n- Includes 'polish.txt' for Polish stopwords.\n- Modifies '__init__.py' to register the new Polish stemmer and stopwords.
Added a section about recent changes to the README.
Add missing pieces to PR #224: - Add test for Polish stemmer in test_stemmers.py - Add Polish to setup.py extras_require with pystempel dependency - Add Polish to setup.py classifiers - Remove improper README change - Clean up merge artifact files (.orig and .rej) The Polish language support now includes: - Polish stemmer using pystempel library - Polish stopwords file - Proper metadata and dependency configuration - Test coverage
CRITICAL FIX: The Polish stemmer was importing pystempel at module level, which caused the entire sumy library to fail if pystempel was not installed, even for users who only needed English or other languages. Changes: - Refactor polish.py to use lazy import pattern (like greek.py) - Move pystempel import inside stem_word() function - Add helpful error message if pystempel is not installed - Cache stemmer instance on function to avoid recreation overhead Now pystempel is only required when actually using Polish language, making it a true optional dependency like other special languages. Tested: - English works without pystempel installed ✓ - Polish gives clear error without pystempel ✓ - Polish works correctly with pystempel installed ✓
- Move try-except block inside hasattr check so import only happens once - Update CHANGELOG.md with Polish language feature and fix Performance improvement: pystempel import and initialization now only happens on first use of Polish stemmer, not on every function call.
94e4f15 to
f169d02
Compare
The pystempel library has a bug with Python 3.13+ where it tries to import Resource from importlib.resources, which was removed in Python 3.13. - Add pytest.skipif to skip Polish test on Python 3.13+ - Add comment in pyproject.toml noting the compatibility issue - Polish language support works fine on Python 3.8-3.12 Reference: https://github.com/dzieciou/pystempel/issues/44
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.