-
Notifications
You must be signed in to change notification settings - Fork 637
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
What pitfalls are there to watch for when parsing pokemon_species_flavor_text.csv? #218
Comments
It's not very well documented. Here's what's going on. Here's what stantler's flavor text looked like in Gold:
The early games stored flavor text with explicit line breaks, hyphenation, and page breaks. We represent this is the database as special characters in the text.
You can and should feel free to replace these characters with normal spaces or whatever. Here's what veekun does: # Page breaks are treated just like newlines.
# Soft hyphens followed by newlines vanish.
# Letter-hyphen-newline becomes letter-hyphen, to preserve real
# hyphenation.
# Any other newline becomes a space.
html = flavor_text.replace(u'\f', u'\n') \
.replace(u'\u00ad\n', u'') \
.replace(u'\u00ad', u'') \
.replace(u' -\n', u' - ') \
.replace(u'-\n', u'-') \
.replace(u'\n', u' ') |
Closing. Feel free to comment if you still have questions, or join us on IRC: https://veekun.com/chat. |
So far I've found form feeds in Bulbasaur's English Pokemon Red dex entry and Stantler's English Pokemon Gold entry has an interesting control sequence I hadn't seen of 0xC2AD right where it splits the word "reality." I don't know any of the other language that exist in the data so I don't know if I should be blindly replacing these characters with spaces or just removing them. Is there a rule of thumb for how to parse these characters? Are there other character sequences I should be parsing out that I just haven't found because there's 802 pokemon in 2 dozen games, in a dozen languages?
The text was updated successfully, but these errors were encountered: