Unicode: Added 'emoji' trigger word

master
tagawa 2015-12-22 15:26:43 +00:00
parent bbb545c4ff
commit c3f77a117d
2 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,7 @@ use constant {
CODEPOINT_RE => qr/^ \s* (?:U \+|\\(?:u|x{(?=.*}))) (?<codepoint> [a-f0-9]{4,6})}? \s* $/xi, CODEPOINT_RE => qr/^ \s* (?:U \+|\\(?:u|x{(?=.*}))) (?<codepoint> [a-f0-9]{4,6})}? \s* $/xi,
NAME_RE => qr/^ (?<name> [A-Z][A-Z\s]+) $/xi, NAME_RE => qr/^ (?<name> [A-Z][A-Z\s]+) $/xi,
CHAR_RE => qr/^ \s* (?<char> .) \s* $/x, CHAR_RE => qr/^ \s* (?<char> .) \s* $/x,
UNICODE_RE => qr/^ (?:unicode|utf-(?:8|16|32)) \s+ (.+) $/xi, UNICODE_RE => qr/^ (?:unicode|emoji|utf-(?:8|16|32)) \s+ (.+) $/xi,
CODEPOINT => 1, CODEPOINT => 1,
NAME => 2, NAME => 2,
CHAR => 3, CHAR => 3,

View File

@ -32,6 +32,9 @@ ddg_goodie_test(
# Lookup by name, "utf-32 custard" # Lookup by name, "utf-32 custard"
"utf-32 custard" => test_zci("\x{1F36E} U+1F36E CUSTARD, decimal: 127854, HTML: &#127854;, UTF-8: 0xF0 0x9F 0x8D 0xAE, block: Miscellaneous Symbols And Pictographs"), "utf-32 custard" => test_zci("\x{1F36E} U+1F36E CUSTARD, decimal: 127854, HTML: &#127854;, UTF-8: 0xF0 0x9F 0x8D 0xAE, block: Miscellaneous Symbols And Pictographs"),
# Lookup by name, "emoji rocket"
"emoji rocket" => test_zci("\x{1F680} U+1F680 ROCKET, decimal: 128640, HTML: &#128640;, UTF-8: 0xF0 0x9F 0x9A 0x80, block: Transport And Map Symbols"),
# Lookup by character, "unicode à" # Lookup by character, "unicode à"
"unicode \x{263B}" => test_zci("\x{263B} U+263B BLACK SMILING FACE, decimal: 9787, HTML: &#9787;, UTF-8: 0xE2 0x98 0xBB, block: Miscellaneous Symbols"), "unicode \x{263B}" => test_zci("\x{263B} U+263B BLACK SMILING FACE, decimal: 9787, HTML: &#9787;, UTF-8: 0xE2 0x98 0xBB, block: Miscellaneous Symbols"),