Oh, and handle the plurals…

This commit is contained in:
Steve McCoy 2017-11-27 22:09:55 -05:00
parent 83289d65f0
commit 85b649bc98
1 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ func (p *EmojifyMePlugin) Message(message msg.Message) bool {
//Check to see if we can strip the trailing "es" off and get an emoji //Check to see if we can strip the trailing "es" off and get an emoji
temp := strings.TrimSuffix(token, "s") temp := strings.TrimSuffix(token, "s")
if _, ok := p.Emoji[temp]; ok { if _, ok := p.Emoji[temp]; ok {
if token != "a" && token != "it" { if temp != "a" && temp != "it" {
emojied++ emojied++
} }
tokens[i] = ":" + temp + ":s" tokens[i] = ":" + temp + ":s"
@ -87,7 +87,7 @@ func (p *EmojifyMePlugin) Message(message msg.Message) bool {
//Check to see if we can strip the trailing "es" off and get an emoji //Check to see if we can strip the trailing "es" off and get an emoji
temp := strings.TrimSuffix(token, "es") temp := strings.TrimSuffix(token, "es")
if _, ok := p.Emoji[temp]; ok { if _, ok := p.Emoji[temp]; ok {
if token != "a" && token != "it" { if temp != "a" && temp != "it" {
emojied++ emojied++
} }
tokens[i] = ":" + temp + ":es" tokens[i] = ":" + temp + ":es"