-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Emoji detection #27
Comments
I suppose You can take a look at
This procedure considers ♫ not an emoji. If you want to eliminate these, too, then it's a bit different (and simpler, because you wouldn't need the |
thanks, i'll give it a try. |
Hey @rivo, I've stumbled upon this, and I'm trying to detect emojis without copying any code from // see https://github.com/rivo/uniseg/issues/27
func isEmojiCluster(w int, runes []rune) bool {
if w != 2 {
return false
}
if len(runes) > 0 && runes[0] >= regionalIndicatorA && runes[0] <= regionalIndicatorZ {
return true
}
for r := range runes {
if r == variationSelector16 {
return true
}
}
// TODO: detect extended pictographic property
return false
} Would you be ok with adding |
This adds the necessary logic to detect if a grapheme cluster is an emoji based on @rivo's [comment](rivo#27 (comment)) Fixes: rivo#27
This adds the necessary logic to detect if a grapheme cluster is an emoji based on @rivo's [comment](rivo#27 (comment)) Fixes: rivo#27
This adds the necessary logic to detect if a grapheme cluster is an emoji based on @rivo's [comment](rivo#27 (comment)) Fixes: rivo#27
This adds the necessary logic to detect if a grapheme cluster is an emoji based on @rivo's [comment](rivo#27 (comment)) Fixes: rivo#27
This adds the necessary logic to detect if a grapheme cluster is an emoji based on @rivo's [comment](rivo#27 (comment)) Fixes: rivo#27
This adds the necessary logic to detect if a grapheme cluster is an emoji based on @rivo's [comment](rivo#27 (comment)) Fixes: rivo#27
This would be a great addition and hope this might be considered for merge. |
Since there is the
emojiPresentation
map, could this library be extended to detect emojis? I have a use case where I want to remove emojis from text but due to lack of options it seems I have to use the github.com/forPelevin/gomoji, which uses this library, but it has the entire emoji db that is 1.25MB map that needs to be loaded in memory, which I am not liking. Hence my question.The text was updated successfully, but these errors were encountered: