This repository was archived by the owner on Aug 18, 2021. It is now read-only.
added support for arbitrary encoding/unicode#44
Open
cgadgil wants to merge 3 commits intospro:masterfrom
cgadgil:master
Open
added support for arbitrary encoding/unicode#44cgadgil wants to merge 3 commits intospro:masterfrom cgadgil:master
cgadgil wants to merge 3 commits intospro:masterfrom
cgadgil:master
Conversation
Owner
|
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 |
Author
|
Sure. I have cleaned up a bit more and added some params. Will submit new
request after testing a bit more.
…On Sat, Jul 22, 2017 at 11:50 AM, Sean Robertson ***@***.***> wrote:
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
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#44 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOXzo297N4oAFZjqGWZRNeFwJ3o6G1Qks5sQkSCgaJpZM4OZMCm>
.
|
hershaw
reviewed
Nov 5, 2017
| return file, len(file) | ||
| #global all_characters | ||
| #global n_characters | ||
| s = open(filename).read() |
There was a problem hiding this comment.
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!
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Added support to process "arbitrary" encoding in text. Parametrized the char set rather than depend on hard coded ascii.