214 lines
36 KiB
Plaintext
214 lines
36 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import pandas as pd\n",
|
||
|
"from IPython.display import clear_output, Markdown, Math\n",
|
||
|
"import ipywidgets as widgets\n",
|
||
|
"import os\n",
|
||
|
"import unicodedata as uni"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# emoji-table"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"* importing unicode standard:"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 18,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"unicode_table = pd.read_csv('UnicodeData.txt', delimiter=';', comment='#', names=['id','description','2','3','4','5','6','7','8','9','10','11','12','13','14',])"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 19,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div>\n",
|
||
|
"<style scoped>\n",
|
||
|
" .dataframe tbody tr th:only-of-type {\n",
|
||
|
" vertical-align: middle;\n",
|
||
|
" }\n",
|
||
|
"\n",
|
||
|
" .dataframe tbody tr th {\n",
|
||
|
" vertical-align: top;\n",
|
||
|
" }\n",
|
||
|
"\n",
|
||
|
" .dataframe thead th {\n",
|
||
|
" text-align: right;\n",
|
||
|
" }\n",
|
||
|
"</style>\n",
|
||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
||
|
" <thead>\n",
|
||
|
" <tr style=\"text-align: right;\">\n",
|
||
|
" <th></th>\n",
|
||
|
" <th>id</th>\n",
|
||
|
" <th>description</th>\n",
|
||
|
" </tr>\n",
|
||
|
" </thead>\n",
|
||
|
" <tbody>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>0</th>\n",
|
||
|
" <td>0000</td>\n",
|
||
|
" <td><control></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>1</th>\n",
|
||
|
" <td>0001</td>\n",
|
||
|
" <td><control></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>2</th>\n",
|
||
|
" <td>0002</td>\n",
|
||
|
" <td><control></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>3</th>\n",
|
||
|
" <td>0003</td>\n",
|
||
|
" <td><control></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>4</th>\n",
|
||
|
" <td>0004</td>\n",
|
||
|
" <td><control></td>\n",
|
||
|
" </tr>\n",
|
||
|
" </tbody>\n",
|
||
|
"</table>\n",
|
||
|
"</div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
" id description\n",
|
||
|
"0 0000 <control>\n",
|
||
|
"1 0001 <control>\n",
|
||
|
"2 0002 <control>\n",
|
||
|
"3 0003 <control>\n",
|
||
|
"4 0004 <control>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 19,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"unicode_table = unicode_table[['id','description']]\n",
|
||
|
"unicode_table.head()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"* getting set of used emojis"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 23,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/markdown": [
|
||
|
"**imported Emojis**\n",
|
||
|
">🀄🧵🧶🃏🤐🤑🤒🤓🤔🤕🤖🤗🤘🤙🤚🤛🤜🤝🤞🤟🤠🤡🤢🤣🤤🤥🤦🤧🤨🤩🤪🤫🤬🤭🤮🤯🤰🤱🤲🤳🤴🤵🤶🤷🤸🤹🤺🇮🤼🤽🤾🥀🥁🥂🥃🥄🥅🇰🥇🥈🥉🥊🥋🥌🥍🥎🥏🥐🥑🥒🥓🥔🥕🥖🥗🥘🥙🥚🥛🥜🥝🥞🥟🥠🥡🥢🥣🥤🥥🥦🥧🥨🥩🥪🥫🥬🥭🥮🥯🥰🥳🥴🥵🥶🥺🥼🥽🥾🥿🦀🦁🦂🦃🦄🦅🦆🦇🦈🦉🦊🦋🦌🦍🆎🦎🦏🆑🆒🆓🆔🆕🆖🆗🆘🆙🆚🦒🦓🦔🦕🦖🦗🦘🦙🦚🦛🦜🦝🦞🦟🦠🦡🦢🧸🦰🦱🦲🦳🦴🦵🦶🦷🦸🦹🧀🧁🧂🧐🧑🧒🧓🧔🧕🧖🧗🧘🧙🧚🧛🧜🧝🧞🧟🧠🧡🧢🧣🧤🧥🇦🇧🇨🇩🇪🇫🧬🇭🧭🇯🧮🧯🇬🧱🧲🧳🧴🇷🇸🇹🇺🇻🇼🇽🇾🇿🧷🈁🧹🧺🧻🧼🧽🧾🧿🈚🈯🈲🈳🈴🈵🈶🈸🈹🈺🉐🉑🌀🌁🌂🌃🌄🌅🌆🌇🌈🌉🌊🌋🌌🌍🌎🌏🌐🌑🌒🌓🌔🌕🌖🌗🌘🌙🌚🌛🌜🌝🌞🌟⌚⌛⬛⬜🌠🌭🌮🌯🌰🌱🌲🌳🌴🌵🌷🌸🌹🌺🌻🌼🌽🌾🌿🍀🍁🍂🍃🍄🍅🍆🍇🍈🍉🍊🍋🍌🍍🍎🍏⭐🍐🍑🍒🍓⭕🍔🍕🍖🍗🍘🍙🍚🍛🍜🍝🍞🍟🍠🍡🍢🍣🍤🍥🍦🍧🍨🍩🍪🍫🍮🍬🍭🍯🍰🍳🍱🍲🍴🍵🍸🍶🍷🍹🍺🍻🍼🍾🍿🎀🎁🎂🎃🎅🎄🎆🎈🎉🎊🎋🎌🎍🎇🎏🎐🎎🎑🎒🎓🎠🎡🎢🎣🎤🎥🎦🎧🎨🎩🎪🎫🎬🎭🎮🎯🎰🎱🎲🎳🎴🎵🎶🎷🎸🎹🎺🎻🎼🎽🎾🎿🏀🏁🏂🏃🏄🏅🏆🏇🏈🏉🏊🏏🏐🏑🏒🏓🏠🏡🏢🏣🏤🏥🏦🏧🏨🏩🏪🏫🏬🏭🏮🏯🏰⏩⏪⏫🏴⏬⏰⏳🏸🏹🏺🐀🐁🐂🐃🐄🐅🐆🐇🐈🐉🐊🐋🐌🐍🐎🐏🐐🐑🐒🐓🐔🐕🐖🐗🐘🐙🐚🐛🐜🐝🐞🐟🐠🐡🐢🐣🐤🐥🐦🐧🐨🐩🐪🐫🐬🐭🐮🐯🐰🐱🐲🐳🐴🐵🐶🐷🐸🐹🐺🐻🐼🐽🐾👀👂👃👄👅👆👇👈👉👊👋👌👍👎👏👐👑👒👓👔👕👖👗👘👙👚👛👜👝👞👟👠👡👢👣👤👥👦👧👨👩👪👫👬👭👮👯👰👱👲👳👴👵👶👷👸👹👺👻👼👽👾👿💀💁💂💃💄💅💆💇💈💉💊💋💌💍💎💏💐💑💒💓💔💕💖💗💘💙💚💛💜💝💞💟💠💡💢💣💤💥💦💧💨💩💪💫💬💭💮💯💰💱💲💳💴💵💶💷💸💹💺💻💼💽💾💿📀📁📂📃📄📅📆📇📈📉📊📋📌📍📎📏📐📑📒📓📔📕📖📗📘📙📚📛📜📝📞📟📠📡📢📣📤📥📦📧📨📩📪📫📬📭📮📯📰📱📲📳📴📵📶📷📸📹📺📻📼📿🔀🔁🔂🔃🔄🔅🔆🔇🔈🔉🔊🔋🔌🔍🔎🔏🔐🔑🔒🔓🔔🔕🔖🔗🔘🔙🔚🔛🔜🔝🔞🔟🔠🔡🔢🔣🔤🔥🔦🔧🔨🔩🔪🔫🔬🔭🔮🔯🔰🔱🔲🔳🔴🔵🔶🔷🔸🔹🔺🔻🔼🔽🕋🕌🕍🕎🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚🕛🕜🕝🕞🕟🕠🕡🕢🕣🕤🕥🕦🕧🕺🖕🖖🖤🗻🗼◽◾🗽🗾🗿😀😁😂😃😄😅😆😇😈😉😊😋😌😍😎😏😐😑☔☕😒😓😔😕😖😗😘😙😚😛😜😝😞😟😠😡😢😣😤😥😦😧😨😩😪😫😬😭😮😯😰😱😲😳😴😵😶😷😸😹😺😻😼😽😾😿🙀🙁🙂🙃♈♉♊♋♌♍♎♏♐♑♒♓🙋🙌🙍🙎🙏♿🚀🚁🚂🚃🚄🚅🚆🚇🚈🚉🚊🚋🚌🚍🚎🚏🚐🚑🚒⚓🚓🚔🚕🚖🚗🚘🚙🚚🚛🚜🚝🚞🚟⚡🚠🚡🚢🚣🚤🚥🚦🚧⚪⚫🚨🚩🚪🚫🚬🚭🚮🚯🚰🚱🚲🚳🚴🚵🚶🚷🚸⚽⚾🚹🚺🚻🚼🚽⛄⛅🚾🚿🛀🛁🛂🛃🛄🛅⛎🛌🛐🛑🛒⛔🇱⛪🛫🛬🇲⛲⛳🛴⛵🛵🛶🛷🛸⛺🛹⛽✅🧦🙄🇳✊✋🙅🙆🙇🙈🧧🙉🇴🙊✨🧨🇵❌❎🧩🇶❓❔❕❗🧪🧫➕➖➗🦐🦑➰➿🧰"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Markdown object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"f = open('emoji-list.txt','r')\n",
|
||
|
"\n",
|
||
|
"emoji_set = [] # empty list\n",
|
||
|
"\n",
|
||
|
"for line in f:\n",
|
||
|
" emoji_set.append(ord(line[0]))\n",
|
||
|
"\n",
|
||
|
"# converting to set:\n",
|
||
|
"emoji_set = set(emoji_set)\n",
|
||
|
"display(Markdown(\"**imported Emojis**\\n>\" + \"\".join([chr(x) for x in emoji_set])))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"* getting description to emojis"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 42,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"{126980: 'MAHJONG TILE RED DRAGON', 129525: 'SPOOL OF THREAD', 129526: 'BALL OF YARN', 127183: 'PLAYING CARD BLACK JOKER', 129296: 'ZIPPER-MOUTH FACE', 129297: 'MONEY-MOUTH FACE', 129298: 'FACE WITH THERMOMETER', 129299: 'NERD FACE', 129300: 'THINKING FACE', 129301: 'FACE WITH HEAD-BANDAGE', 129302: 'ROBOT FACE', 129303: 'HUGGING FACE', 129304: 'SIGN OF THE HORNS', 129305: 'CALL ME HAND', 129306: 'RAISED BACK OF HAND', 129307: 'LEFT-FACING FIST', 129308: 'RIGHT-FACING FIST', 129309: 'HANDSHAKE', 129310: 'HAND WITH INDEX AND MIDDLE FINGERS CROSSED', 129311: 'I LOVE YOU HAND SIGN', 129312: 'FACE WITH COWBOY HAT', 129313: 'CLOWN FACE', 129314: 'NAUSEATED FACE', 129315: 'ROLLING ON THE FLOOR LAUGHING', 129316: 'DROOLING FACE', 129317: 'LYING FACE', 129318: 'FACE PALM', 129319: 'SNEEZING FACE', 129320: 'FACE WITH ONE EYEBROW RAISED', 129321: 'GRINNING FACE WITH STAR EYES', 129322: 'GRINNING FACE WITH ONE LARGE AND ONE SMALL EYE', 129323: 'FACE WITH FINGER COVERING CLOSED LIPS', 129324: 'SERIOUS FACE WITH SYMBOLS COVERING MOUTH', 129325: 'SMILING FACE WITH SMILING EYES AND HAND COVERING MOUTH', 129326: 'FACE WITH OPEN MOUTH VOMITING', 129327: 'SHOCKED FACE WITH EXPLODING HEAD', 129328: 'PREGNANT WOMAN', 129329: 'BREAST-FEEDING', 129330: 'PALMS UP TOGETHER', 129331: 'SELFIE', 129332: 'PRINCE', 129333: 'MAN IN TUXEDO', 129334: 'MOTHER CHRISTMAS', 129335: 'SHRUG', 129336: 'PERSON DOING CARTWHEEL', 129337: 'JUGGLING', 129338: 'FENCER', 127470: 'REGIONAL INDICATOR SYMBOL LETTER I', 129340: 'WRESTLERS', 129341: 'WATER POLO', 129342: 'HANDBALL', 129344: 'WILTED FLOWER', 129345: 'DRUM WITH DRUMSTICKS', 129346: 'CLINKING GLASSES', 129347: 'TUMBLER GLASS', 129348: 'SPOON', 129349: 'GOAL NET', 127472: 'REGIONAL INDICATOR SYMBOL LETTER K', 129351: 'FIRST PLACE MEDAL', 129352: 'SECOND PLACE MEDAL', 129353: 'THIRD PLACE MEDAL', 129354: 'BOXING GLOVE', 129355: 'MARTIAL ARTS UNIFORM', 129356: 'CURLING STONE', 129357: 'LACROSSE STICK AND BALL', 129358: 'SOFTBALL', 129359: 'FLYING DISC', 129360: 'CROISSANT', 129361: 'AVOCADO', 129362: 'CUCUMBER', 129363: 'BACON', 129364: 'POTATO', 129365: 'CARROT', 129366: 'BAGUETTE BREAD', 129367: 'GREEN SALAD', 129368: 'SHALLOW PAN OF FOOD', 129369: 'STUFFED FLATBREAD', 129370: 'EGG', 129371: 'GLASS OF MILK', 129372: 'PEANUTS', 129373: 'KIWIFRUIT', 129374: 'PANCAKES', 129375: 'DUMPLING', 129376: 'FORTUNE COOKIE', 129377: 'TAKEOUT BOX', 129378: 'CHOPSTICKS', 129379: 'BOWL WITH SPOON', 129380: 'CUP WITH STRAW', 129381: 'COCONUT', 129382: 'BROCCOLI', 129383: 'PIE', 129384: 'PRETZEL', 129385: 'CUT OF MEAT', 129386: 'SANDWICH', 129387: 'CANNED FOOD', 129388: 'LEAFY GREEN', 129389: 'MANGO', 129390: 'MOON CAKE', 129391: 'BAGEL', 129392: 'SMILING FACE WITH SMILING EYES AND THREE HEARTS', 129395: 'FACE WITH PARTY HORN AND PARTY HAT', 129396: 'FACE WITH UNEVEN EYES AND WAVY MOUTH', 129397: 'OVERHEATED FACE', 129398: 'FREEZING FACE', 129402: 'FACE WITH PLEADING EYES', 129404: 'LAB COAT', 129405: 'GOGGLES', 129406: 'HIKING BOOT', 129407: 'FLAT SHOE', 129408: 'CRAB', 129409: 'LION FACE', 129410: 'SCORPION', 129411: 'TURKEY', 129412: 'UNICORN FACE', 129413: 'EAGLE', 129414: 'DUCK', 129415: 'BAT', 129416: 'SHARK', 129417: 'OWL', 129418: 'FOX FACE', 129419: 'BUTTERFLY', 129420: 'DEER', 129421: 'GORILLA', 127374: 'NEGATIVE SQUARED AB', 129422: 'LIZARD', 129423: 'RHINOCEROS', 127377: 'SQUARED CL', 127378: 'SQUARED COOL', 127379: 'SQUARED FREE', 127380: 'SQUARED ID', 127381: 'SQUARED NEW', 127382: 'SQUARED NG', 127383: 'SQUARED OK', 127384: 'SQUARED SOS', 127385: 'SQUARED UP WITH EXCLAMATION MARK', 127386: 'SQUARED VS', 129426: 'GIRAFFE FACE', 129427: 'ZEBRA FACE', 129428: 'HEDGEHOG', 129429: 'SAUROPOD', 129430: 'T-REX', 129431: 'CRICKET', 129432: 'KANGAROO', 129433: 'LLAMA', 129434: 'PEACOCK', 129435: 'HIPPOPOTAMUS', 129436: 'PARROT', 129437: 'RACCOON', 129438: 'LOBSTER', 129439: 'MOSQUITO', 129440: 'MICROBE', 129441: 'BADGER', 129442: 'SWAN', 129528: 'TEDDY BEAR', 129456: 'EMOJI COMPONENT RED HAIR', 129457: 'EMOJI COMPONENT CURLY HAIR', 129458: 'EMOJI COMPONENT BALD', 129459: 'EMOJI COMPONENT WHITE HAIR', 129460: 'BON
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"emoji_dict = {}\n",
|
||
|
"for e in emoji_set:\n",
|
||
|
" emoji_dict[e] = unicode_table[unicode_table['id'] == str(hex(e)[2:]).upper()]['description'].iloc[0]\n",
|
||
|
"\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"file_extension": ".py",
|
||
|
"mimetype": "text/x-python",
|
||
|
"name": "python",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"version": "3.6.5"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|