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

a minor error in code #5

Open
eveliao opened this issue Aug 5, 2018 · 2 comments
Open

a minor error in code #5

eveliao opened this issue Aug 5, 2018 · 2 comments

Comments

@eveliao
Copy link

eveliao commented Aug 5, 2018

in chapterize.py line 173
endLocation = len(self.lines)-1 # The end

I think it's better set as len(self.lines)
because if we can't detect the end location, the last line could possibly be part of the book and shouldn't be removed.

@JonathanReeve
Copy link
Owner

To be honest, I don't really remember why I wrote it like that. It could very well be a mistake. If you'd like to submit a pull request, and test it against a few texts to make sure it works, I'd be happy to review it.

@Ingrid-0906
Copy link

Hey, Sailors! Just a tip.
I removed the -1 from line 173 -> [ endLocation = len(self.lines)-1 ] and i got an error of index out of range.
Then, i applied again the -1 and it flowed like a charm! In summary, guys don't remove the -1, or the index error will pop over line 16 -> [headingsPlain = [self.lines[loc] for loc in self.headingLocations] ]

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

No branches or pull requests

3 participants