From 7aea5d121149b799b9342859ea66a17c1ec6342e Mon Sep 17 00:00:00 2001 From: Mark Shoulson Date: Thu, 17 Mar 2016 17:11:31 -0400 Subject: Add new Emoji file and support. emojilist is a list snipped out of UnicodeData.txt emojitrans1.pl converts it to an intermediate form, sorta XCompose-like, but with shortcuts (more XCompose-like than it needs to be, sorry), which is emoji-interim. Edit that to comment out things that shouldn't happen, choose key combos, etc. Then use emojitrans2.pl to translate that to true emoji.compose, which is an XCompose file you can include. --- emojitrans2.pl | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 emojitrans2.pl (limited to 'emojitrans2.pl') diff --git a/emojitrans2.pl b/emojitrans2.pl new file mode 100755 index 0000000..2637c19 --- /dev/null +++ b/emojitrans2.pl @@ -0,0 +1,40 @@ +#!/usr/bin/perl -p +BEGIN { binmode(STDOUT, ":utf8"); + binmode(STDIN, ":utf8"); + +%specials = ('%' => 'percent', + '-' => 'minus', + '>' => 'greater', + '<' => 'less', + ',' => 'comma', + '.' => 'period', + '$' => 'dollar', + '!' => 'exclam', + '?' => 'question', + '+' => 'plus', + '/' => 'slash', + '#' => 'numbersign', + '@' => 'at', +); + +sub splitup { + my $arg=shift; + local $_; + my @out; + my $rv; + return "\{$arg\}" if length($arg) > 7; + @out=split //, $arg; + $rv=""; + for (@out) { + $_ = $specials{$_} // $_; + $rv .= " <$_>"; + } + return $rv; +} + +} + +unless (/^#/) { + s// /; + s({([][[:alnum:] _+%@><,.^\$+#()!/-]+)})(splitup($1))e; +} -- cgit v1.2.3