Project

emoninja

0.0
No commit activity in last 3 years
No release in over 3 years
We parse up-to-date OMG standard for unicode emojis and replace words in texts with respective emojis when applicable.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
>= 0
~> 10.0
>= 0

Runtime

 Project Readme

Emoninja

Gem that allows emoji substitutions (amongst other handy operations) in texts.

Installation

gem 'emoninja'     # in Gemfile
############################
require 'emoninja' # wherever applicable

Usage

Emoninja.emojify text

Examples:

Original Translated
A thing of beauty is a joy for ever: A thing of beauty is a ๐Ÿ˜น for ever:
Its lovliness increases; it will never Its lovliness increases; it will never
Pass into nothingness; but still will keep Pass into nothingness; but still will keep
A bower quiet for us, and a sleep A bower ๐Ÿ”• for us, and a ๐Ÿ›
Full of sweet dreams, and health, and quiet breathing. ๐Ÿ’ฏ of ๐Ÿฎ dreams, and health, and ๐Ÿ”• breathing.
Therefore, on every morrow, are we wreathing Therefore, on every morrow, are we wreathing
A flowery band to bind us to the earth, A flowery band to bind us to the ๐ŸŒ,
Spite of despondence, of the inhuman dearth Spite of despondence, of the inhuman dearth
Of noble natures, of the gloomy days, Of noble natures, of the gloomy days,
Of all the unhealthy and o'er-darkn'd ways Of all the unhealthy and ๐Ÿ…พ'er-darkn'd ways
Made for our searching: yes, in spite of all, Made for ๐Ÿ” searching: yes, in spite of all,
Some shape of beauty moves away the pall Some shape of beauty moves away the pall
From our dark spirits. Such the sun, the moon, From our ๐ŸŒ‘ spirits. Such the ๐ŸŒค, the ๐ŸŒš,
Trees old and young, sprouting a shady boon ๐ŸŽ„ ๐Ÿ— and young, sprouting a shady boon
For simple sheep; and such are daffodils For simple ๐Ÿ‘; and such are daffodils
With the green world they live in; and clear rills With the ๐Ÿ“— ๐ŸŒŽ they live in; and clear rills
That for themselves a cooling covert make That for themselves a ๐Ÿ˜Ž covert make
'Gainst the hot season; the mid-forest brake, 'Gainst the โ˜• season; the mid-forest brake,
Rich with a sprinkling of fair musk-rose blooms: Rich with a sprinkling of fair musk-๐ŸŒน blooms:
And such too is the grandeur of the dooms And such too is the grandeur of the dooms
We have imagined for the mighty dead; We have imagined for the mighty dead;
An endless fountain of immortal drink, An endless โ›ฒ of immortal ๐Ÿพ,
Pouring unto us from the heaven's brink. Pouring unto us from the heaven's brink.
โ€” A Thing Of Beauty (Endymion) - Poem by John Keats

Original Translated
I've just seen a face I've just seen a ๐Ÿ˜ต
I can't forget the time or place I can't forget the time or place
Where we just met Where we just met
She's just the girl for me She's just the ๐Ÿ‘ง for me
And I want all the world to see And I want all the ๐ŸŒ to ๐Ÿ™ˆ
We've met, mmm-mmm-mmm-m'mmm-mmm We've met, mmm-mmm-mmm-m'mmm-mmm
Had it been another day Had it been another day
I might have looked the other way I might have looked the other way
And I'd have never been aware And I'd have never been aware
But as it is I'll dream of her But as it is I'll dream of her
Tonight, di-di-di-di'n'di Tonight, di-di-di-di'n'di
Falling, yes I am falling ๐ŸŒ , yes I am ๐ŸŒ 
And she keeps calling And she keeps ๐Ÿค™
Me back again Me ๐Ÿ”™ again
I have never known I have never known
The like of this, I've been alone The like of this, I've been alone
And I have missed things And I have missed things
And kept out of sight And kept out of sight
But other girls were never quite But other ๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ were never quite
Like this, da-da-n'da-da'n'da Like this, da-da-n'da-da'n'da
Falling, yes I am falling ๐ŸŒ , yes I am ๐ŸŒ 
And she keeps calling And she keeps ๐Ÿ“ฒ
Me back again Me ๐Ÿ”™ again
Falling, yes I am falling ๐ŸŒ , yes I am ๐ŸŒ 
And she keeps calling And she keeps ๐Ÿค™
Me back again Me ๐Ÿ”™ again
I've just seen a face I've just seen a ๐Ÿ˜ต
I can't forget the time or place I can't forget the time or place
Where we just met Where we just met
She's just the girl for me She's just the ๐Ÿ‘ง for me
And I want all the world to see And I want all the ๐ŸŒ to ๐Ÿ™ˆ
We've met, mmm-mmm-mmm-da-da-da We've met, mmm-mmm-mmm-da-da-da
Falling, yes I am falling ๐ŸŒ , yes I am ๐ŸŒ 
And she keeps calling And she keeps ๐Ÿค™
Me back again Me ๐Ÿ”™ again
Falling, yes I am falling ๐ŸŒ , yes I am ๐ŸŒ 
And she keeps calling And she keeps ๐Ÿค™
Me back again Me ๐Ÿ”™ again
Falling, yes I am falling ๐ŸŒ , yes I am ๐ŸŒ 
And she keeps calling And she keeps ๐Ÿค™
Me back again Me ๐Ÿ”™ again
โ€”ย The Beatles, Iโ€™ve just seen a face

Bonus track. The Beatles, Drive My Car

Asked a ๐Ÿ‘ง what she wanted to be
She said ๐Ÿ‘ถ, "Can't you ๐Ÿ™ˆ
I wanna be famous, a โœก on the screen
But you can do something in between"

๐Ÿ‘ถ you can drive my ๐Ÿš“
Yes I'm gonna be a โœก
๐Ÿ‘ถ you can drive my ๐Ÿš“
And maybe I ๐Ÿ˜ป you

I told a ๐Ÿ‘ง that my prospects were good
And she said ๐Ÿ‘ถ, "It's understood
Working for ๐Ÿฅœ is all very fine
But I can show you a better time"

๐Ÿ‘ถ you can drive my ๐Ÿš“
Yes I'm gonna be a โœก
๐Ÿ‘ถ you can drive my ๐Ÿš“
And maybe I ๐Ÿ˜ป you
Beep beep'm beep beep yeah

๐Ÿ‘ถ you can drive my ๐Ÿš“
Yes I'm gonna be a โœก
๐Ÿ‘ถ you can drive my ๐Ÿš“
And maybe I ๐Ÿ˜ป you

I told that ๐Ÿ‘ง I can start โฏ away
And she said, "Listen ๐Ÿ‘ถ I got something to say
I got ๐Ÿ™… ๐Ÿš“ and it's ๐Ÿ’” my ๐Ÿ’˜
But I've found a driver and that's a start"

๐Ÿ‘ถ you can drive my ๐Ÿš“
Yes I'm gonna be a โœก
๐Ÿ‘ถ you can drive my ๐Ÿš“
And maybe I ๐Ÿ˜ป you
Beep beep'm beep beep yeah
Beep beep'm beep beep yeah
Beep beep'm beep beep yeah
Beep beep'm beep beep yeah (fade out)

ToDo

โ€” flags and other combineds are not treated properly;
โ€” stopwords (like โ€œusโ€ above);
โ€” NLP + stemming.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/emoninja. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.