Skip to content

Commit

Permalink
Merge pull request #22 from aksafan/emoji15
Browse files Browse the repository at this point in the history
Added support for Emoji 15
  • Loading branch information
aaronpk authored May 31, 2023
2 parents cb7234d + 8dadec6 commit 7129938
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
31 changes: 31 additions & 0 deletions src/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@
"1F423": "hatching_chick",
"1F424": "baby_chick",
"1F425": "hatched_chick",
"1F426-200D-2B1B": "black_bird",
"1F426": "bird",
"1F427": "penguin",
"1F428": "koala",
Expand Down Expand Up @@ -2489,6 +2490,7 @@
"1F6D5": "hindu_temple",
"1F6D6": "hut",
"1F6D7": "elevator",
"1F6DC": "wireless",
"1F6DD": "playground_slide",
"1F6DE": "wheel",
"1F6DF": "ring_buoy",
Expand Down Expand Up @@ -3507,6 +3509,9 @@
"1FA72": "briefs",
"1FA73": "shorts",
"1FA74": "thong_sandal",
"1FA75": "light_blue_heart",
"1FA76": "grey_heart",
"1FA77": "pink_heart",
"1FA78": "drop_of_blood",
"1FA79": "adhesive_bandage",
"1FA7A": "stethoscope",
Expand All @@ -3519,6 +3524,8 @@
"1FA84": "magic_wand",
"1FA85": "pinata",
"1FA86": "nesting_dolls",
"1FA87": "maracas",
"1FA88": "flute",
"1FA90": "ringed_planet",
"1FA91": "chair",
"1FA92": "razor",
Expand Down Expand Up @@ -3548,6 +3555,9 @@
"1FAAA": "identification_card",
"1FAAB": "low_battery",
"1FAAC": "hamsa",
"1FAAD": "folding_hand_fan",
"1FAAE": "hair_pick",
"1FAAF": "khanda",
"1FAB0": "fly",
"1FAB1": "worm",
"1FAB2": "beetle",
Expand All @@ -3559,6 +3569,10 @@
"1FAB8": "coral",
"1FAB9": "empty_nest",
"1FABA": "nest_with_eggs",
"1FABB": "hyacinth",
"1FABC": "jellyfish",
"1FABD": "wing",
"1FABF": "goose",
"1FAC0": "anatomical_heart",
"1FAC1": "lungs",
"1FAC2": "people_hugging",
Expand All @@ -3580,6 +3594,8 @@
"1FAC5-1F3FD": "person_with_crown",
"1FAC5-1F3FE": "person_with_crown",
"1FAC5-1F3FF": "person_with_crown",
"1FACE": "moose",
"1FACF": "donkey",
"1FAD0": "blueberries",
"1FAD1": "bell_pepper",
"1FAD2": "olive",
Expand All @@ -3590,6 +3606,8 @@
"1FAD7": "pouring_liquid",
"1FAD8": "beans",
"1FAD9": "jar",
"1FADA": "ginger_root",
"1FADB": "pea_pod",
"1FAE0": "melting_face",
"1FAE1": "saluting_face",
"1FAE2": "face_with_open_eyes_and_hand_over_mouth",
Expand All @@ -3598,6 +3616,7 @@
"1FAE5": "dotted_line_face",
"1FAE6": "biting_lip",
"1FAE7": "bubbles",
"1FAE8": "shaking_face",
"1FAF0": "hand_with_index_finger_and_thumb_crossed",
"1FAF0-1F3FB": "hand_with_index_finger_and_thumb_crossed",
"1FAF0-1F3FC": "hand_with_index_finger_and_thumb_crossed",
Expand Down Expand Up @@ -3640,6 +3659,18 @@
"1FAF6-1F3FD": "heart_hands",
"1FAF6-1F3FE": "heart_hands",
"1FAF6-1F3FF": "heart_hands",
"1FAF7": "leftwards_pushing_hand",
"1FAF7-1F3FB": "leftwards_pushing_hand",
"1FAF7-1F3FC": "leftwards_pushing_hand",
"1FAF7-1F3FD": "leftwards_pushing_hand",
"1FAF7-1F3FE": "leftwards_pushing_hand",
"1FAF7-1F3FF": "leftwards_pushing_hand",
"1FAF8": "rightwards_pushing_hand",
"1FAF8-1F3FB": "rightwards_pushing_hand",
"1FAF8-1F3FC": "rightwards_pushing_hand",
"1FAF8-1F3FD": "rightwards_pushing_hand",
"1FAF8-1F3FE": "rightwards_pushing_hand",
"1FAF8-1F3FF": "rightwards_pushing_hand",
"203C": "bangbang",
"203C-FE0F": "bangbang",
"2049": "interrobang",
Expand Down
2 changes: 1 addition & 1 deletion src/regexp.json

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions tests/EmojiDetectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ public function testDetectEvenSimplerEmoji() {
$this->assertSame('', is_single_emoji($string)['emoji']);
}

public function testDetectEmoji15() {
$string = '🫨';
$emoji = detect_emoji($string);
$this->assertCount(1, $emoji);
$this->assertSame('🫨', $emoji[0]['emoji']);
$this->assertSame('shaking_face', $emoji[0]['short_name']);
$this->assertSame('1FAE8', $emoji[0]['hex_str']);
$this->assertSame(0, $emoji[0]['byte_offset']);
$this->assertSame('🫨', is_single_emoji($string)['emoji']);

$string = '🪿';
$emoji = detect_emoji($string);
$this->assertCount(1, $emoji);
$this->assertSame('🪿', $emoji[0]['emoji']);
$this->assertSame('goose', $emoji[0]['short_name']);
$this->assertSame('1FABF', $emoji[0]['hex_str']);
$this->assertSame(0, $emoji[0]['byte_offset']);
$this->assertSame('🪿', is_single_emoji($string)['emoji']);
}

public function testDetectEmojiWithZWJ() {
$string = '👨‍👩‍👦‍👦';
$emoji = detect_emoji($string);
Expand Down

0 comments on commit 7129938

Please sign in to comment.