bumblepie / haikubot

A discord bot that recognises haikus in user messages and saves them for later reference.
MIT License
1 stars 1 forks source link

Split messages by newlines, punctuation #13

Open bumblepie opened 6 years ago

bumblepie commented 6 years ago

Currently, a message such as "Blah blah. Blah blah? Blah." will be considered a single message with 5 syllables. I think it would be better to split up sentences and multi-line messages (ie newline characters acting as fullstops) for better recognition of haikus. Once complete, a single message consisting of three sentences with the right number of syllables would be considered a haiku, and messages consisting of multiple sentences per haiku-line would not be considered haikus.

bumblepie commented 6 years ago

Splitting into sentences based on punctuation is a non-trivial task given the complexity of possible sentences, especially given that discord users won't necessarily follow correct English punctuation. Eg: "Dr. X rated this book 7.5/10!", "3! = 3x2x1 = 6" Thus, for now, I'll just have it split by newlines but leave the issue open once that's complete. However, it's probably beyond the scope of this project, and I don't feel that it would add much value.