Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

added support for arbitrary encoding/unicode #44

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

added support for arbitrary encoding/unicode #44

wants to merge 3 commits into from

Conversation

cgadgil
Copy link

@cgadgil cgadgil commented Jul 16, 2017

Added support to process "arbitrary" encoding in text. Parametrized the char set rather than depend on hard coded ascii.

@spro
Copy link
Owner

spro commented Jul 22, 2017

Looks good, thank you. If you could clean up some of the commented out lines I'll merge it in.

By the way this would be great to have in https://github.com/spro/char-rnn.pytorch

@cgadgil
Copy link
Author

cgadgil commented Jul 22, 2017 via email

return file, len(file)
#global all_characters
#global n_characters
s = open(filename).read()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're working on this, mind fixing up the read to do the following:

with open(filename) as fh:
    ...

So that the file handle gets closed after the function returns. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants