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

Update corpus.py #102

Merged
merged 2 commits into from
Jan 15, 2025
Merged

Update corpus.py #102

merged 2 commits into from
Jan 15, 2025

Conversation

Restodecoca
Copy link
Contributor

The issue with non-ASCII and UTF-8 characters was partially resolved by updating a single open() call within the find_newline_positions function to include encoding='utf-8'. This update ensures proper handling of multilingual text for the specific operation. However, it is recommended to review and update all instances of open() across the codebase to include encoding='utf-8' for consistency and to prevent similar issues in other functions.

The issue with non-ASCII and UTF-8 characters was partially resolved by updating a single open() call within the find_newline_positions function to include encoding='utf-8'. This update ensures proper handling of multilingual text for the specific operation. However, it is recommended to review and update all instances of open() across the codebase to include encoding='utf-8' for consistency and to prevent similar issues in other functions.
@xhluca
Copy link
Owner

xhluca commented Jan 14, 2025

can we make encoding a parameter of the function and set it to utf by default?

@Restodecoca
Copy link
Contributor Author

sure, I've already made the changes. please check again

@xhluca
Copy link
Owner

xhluca commented Jan 15, 2025

Thank you! Will merge once tests pass

@xhluca xhluca linked an issue Jan 15, 2025 that may be closed by this pull request
@xhluca xhluca merged commit 813fcdf into xhluca:main Jan 15, 2025
2 checks passed
@xhluca
Copy link
Owner

xhluca commented Jan 15, 2025

@Restodecoca i made a pre-release, can you confirm it works well for you? https://github.com/xhluca/bm25s/releases/tag/0.2.7pre3

@Restodecoca
Copy link
Contributor Author

sure, as soon as I can, I will return to you with feedback.

@Restodecoca
Copy link
Contributor Author

bm25s==0.2.7pre3
image
bm25s==0.2.6 (Unicode Error)
image
Works like a charm, thank you!

@xhluca
Copy link
Owner

xhluca commented Jan 16, 2025

Awesome! Will do an official release

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.

BM25s UTF-8 problem while reading from already built .json
2 participants