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

Add argument to preserve unicode characters in json output. #307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wayneworkman
Copy link

@wayneworkman wayneworkman commented Mar 31, 2023

Here's a snippit from the Anthropology article before this code change using the --json argument.

Their New Latin ' derived from the combining forms of the Greek words \"\u00e1nthr\u014dpos\" (, \"human\") and \"l\u00f3gos\" (, \"study\").

Here it is after these code changes, using --json and --preserve-unicode

Their New Latin ' derived from the combining forms of the Greek words \"ánthrōpos\" (, \"human\") and \"lógos\" (, \"study\").

For text computing activities, it's nice to have the option to preserve these unicode characters in their true form, rather than ASCII representations.

@wayneworkman wayneworkman changed the title Add argument to preserve unicode in json output. Add argument to preserve unicode characters in json output. Mar 31, 2023
@wayneworkman
Copy link
Author

wayneworkman commented Apr 2, 2023

Thinking more on this pull request, when you load the JSON output text using json.loads() in python, the unicode is represented correctly in the loaded JSON. Given that, I think this pull request is only valid for a few scenarios:

  • When you're not loading the JSON output with a JSON tool; i.e. parsing it manually (not a great idea).
  • When you want to view the output manually as a sanity check to see what the source text looks like.
  • When you're using the JSON output for personal reading purposes.

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.

None yet

1 participant