Decode error AND Add catalan language to LANGUAGE_MAPPING#5
Merged
Alir3z4 merged 3 commits intoAlir3z4:masterfrom Jan 30, 2015
Merged
Decode error AND Add catalan language to LANGUAGE_MAPPING#5Alir3z4 merged 3 commits intoAlir3z4:masterfrom
Alir3z4 merged 3 commits intoAlir3z4:masterfrom
Conversation
added 3 commits
January 27, 2015 15:15
stop_words = [line.strip().decode('utf-8')
for line in language_file.readlines()]
Strip() return a copy of the string with leading and trailing whitespace characters removed.
But if the string contains non-ascii characters, Strip() causes a UnicodeDecodeError error
(eg UnicodeDecodeError: 'utf8' codec can not decode byte 0xc3 in position 34: unexpected end of data).
The workaround is to reorder the call:
stop_words = [line.decode('utf-8').strip()
for line in language_file.readlines()]
Alir3z4
added a commit
that referenced
this pull request
Jan 30, 2015
Decode error AND Add catalan language to LANGUAGE_MAPPING Thanks @dmiro
Owner
|
@dmiro good job. I'll update the sub-module for this repo and release soon. Thanks ;) |
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
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.
1. Add catalan language to LANGUAGE_MAPPING.
I previously I added the file with stop words in project "stop-words"
2. Decode error
Strip() return a copy of the string with leading and trailing whitespace characters removed.
But if the string contains non-ascii characters, Strip() causes a UnicodeDecodeError error
(eg UnicodeDecodeError: 'utf8' codec can not decode byte 0xc3 in position 34: unexpected end of data).
The workaround is to reorder the call: