fix error when handling the extended ASCII codes in response output #15
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.
I find out that when supplying a short name text with extended ASCII code (e.g., "Arès Méroueh") will generate an error in the results's 'originalText' tag. The reason is that requests lib will guess the response's encoding. In the case of "Arès Méroueh", it will give result like ISO8859-1, which is not true. According to the standford coreNLP. The default response encoding is utf-8. Adding this line( r.encoding = 'utf-8') will eliminate error like this.
In order to make the code more robust, one may change the interface and allow user to specify response encoding.