Skip to content

Expand emoji detection to detect Slack emojis#6

Open
mbernson wants to merge 2 commits intojaapmengers:masterfrom
mbernson:feature/emoji-filtering
Open

Expand emoji detection to detect Slack emojis#6
mbernson wants to merge 2 commits intojaapmengers:masterfrom
mbernson:feature/emoji-filtering

Conversation

@mbernson
Copy link
Contributor

Hey Jaap, here's my quadrennial pull request to this project :)

I noticed that when Haikubot gets a haiku wrong, it's often related to the emoji in the message.
Haikubot sees them like Slack emoji codes (:joy: for example). This PR updates the internal emoji detection logic to treat those as if they were regular emoji.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, emojis are considered to be a single-syllable word. Should we filter out the emoji entirely instead?

function expandMessage(msg) {
  return msg
    .split(/\s+/)
    .filter((x) => x.length > 0 && x != "\u200B")
    .filter((x) => !isEmoji(x));
}

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

Successfully merging this pull request may close these issues.

1 participant