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.