hadley / emo

Easily insert emoji into R and RMarkdown
416 stars 53 forks source link

๐Ÿ™ƒ Add a function that will replace each letter with an emoji #22

Closed LucyMcGowan closed 7 years ago

LucyMcGowan commented 7 years ago

An ode to my favorite princess. Carrie Fisher often wrote in emojis by replacing each letter with an emoji that resembled it. For example,

emo::ji_fisher("without you I would just be a weird chick in a hat")
#> ใ€ฐโ„นโœ๏ธโ™“๏ธ๐Ÿ…พ๏ธโ›Žโœ๏ธ โœŒ๐Ÿป๏ธ๐Ÿ…พ๏ธโ›Ž โ„น ใ€ฐ๐Ÿ…พ๏ธโ›Ž๐Ÿ•’d ๐ŸŒถโ›Ž๐Ÿ’ฒโœ๏ธ ๐Ÿ…ฑ๏ธ๐Ÿ“ง๐Ÿ…ฐ๏ธ ใ€ฐโ„น๐Ÿ“งยฎd ยฉโ™“๏ธโ„นยฉ๐ŸŽ‹ โ„น๏ธโ™‘๏ธ ๐Ÿ…ฐ๏ธ โ™“๏ธ๐Ÿ…ฐ๏ธโœ๏ธ

ref: tweet

emo::ji_fisher("Im supposed to tell you to buy my book, but Im not really like that!")
#> โ„นโ™๏ธ ๐Ÿ’ฒโ›Ž๐Ÿ…ฟ๏ธ๐Ÿ…ฟ๏ธ๐Ÿ…พ๏ธ๐Ÿ’ฒ๐Ÿ“งd โœ๏ธ๐Ÿ…พ๏ธ โœ๏ธ๐Ÿ“ง๐Ÿ•’๐Ÿ•’ โœŒ๐Ÿป๏ธ๐Ÿ…พ๏ธโ›Ž โœ๏ธ๐Ÿ…พ๏ธ ๐Ÿ…ฑ๏ธโ›ŽโœŒ๐Ÿป๏ธ โ™๏ธโœŒ๐Ÿป๏ธ ๐Ÿ…ฑ๏ธ๐Ÿ…พ๏ธ๐Ÿ…พ๏ธ๐ŸŽ‹, ๐Ÿ…ฑ๏ธโ›Žโœ๏ธ โ„นโ™๏ธ โ™‘๏ธ๐Ÿ…พ๏ธโœ๏ธ ยฎ๐Ÿ“ง๐Ÿ…ฐ๏ธ๐Ÿ•’๐Ÿ•’โœŒ๐Ÿป๏ธ ๐Ÿ•’โ„น๐ŸŽ‹๐Ÿ“ง โœ๏ธโ™“๏ธ๐Ÿ…ฐ๏ธโœ๏ธโ•

ref: tweet

emo::ji_fisher("I love the new rstudio")
#> โ„น๏ธ   ๐Ÿ‘โค๏ธโœŒ๏ธ๐Ÿ“ง  ๐ŸŒดโ™“๏ธ๐Ÿ“ง  ๐Ÿ†•   ยฎ๏ธโšก๏ธ๐ŸŒดโ›Žโ†ฉ๏ธโ„น๏ธโญ•๏ธ

A bit similar to #5, but different in that rather than replace full words, it would just replace letters.

romainfrancois commented 7 years ago

That'd be cool. This would allow me to participate to slack://ropensci#allemoji

Are all those emojis ? or do we need to also poke into other unicode planes, e.g.

> filter( uni::code, str_detect(description, "registered") )
# A tibble: 1 x 7
     id   rune                                   description              block countries languages  type
  <int>  <chr>                                         <chr>              <chr>     <chr>     <chr> <chr>
1   174 U+00AE  Registered Sign : registered trade mark sign latin-1-supplement      <NA>      <NA>  <NA>
LucyMcGowan commented 7 years ago

Some of Carrie's weren't emojis, but I think as a first pass we can just use emojis? I have at least a 1:1 alphabet to emoji mapping I generally use I can write up.

romainfrancois commented 7 years ago

cool. It does not necessarily need to be 1:1 some letters (o) might have many proxy emojis .. ji_fisher could randomly select one

LucyMcGowan commented 7 years ago

Here is a start of the mapping ๐Ÿ‘ธ (I ended up sticking it in a ๐Ÿ“ฆ so it's easier to play with, but it is only a small dataset + function)

romainfrancois commented 7 years ago

Would you prepare a PR for emo ?

Cple of things though:

LucyMcGowan commented 7 years ago

Yep! How would you like the data saved? Right now I create a tibble, turn it into a list, and then export that.

romainfrancois commented 7 years ago

That sounds fine