lang / unicode_utils

Unicode algorithms for Ruby 1.9
http://unicode-utils.rubyforge.org/
BSD 2-Clause "Simplified" License
113 stars 15 forks source link

Binary to quick lookup symbols by their names. #9

Open mudasobwa opened 11 years ago

mudasobwa commented 11 years ago

This is just a handy utility to lookup symbols from the command line using the power of unicode_utils.

E. g.:

$ uc_grep --help
Usage: uc_grep [options] NAME
    -o, --out TYPE                   Output style (full, symbol); default: full
    -s, --suggest                    Suggest results for misspelled words using hunspell; default: false
    -h, --help                       Show this message

$ uc_grep suit
========================================
Trying suit…
⇒  [#<U+2660 "♠" BLACK SPADE SUIT utf8:e2,99,a0>]
⇒  [#<U+2661 "♡" WHITE HEART SUIT utf8:e2,99,a1>]
⇒  [#<U+2662 "♢" WHITE DIAMOND SUIT utf8:e2,99,a2>]
⇒  [#<U+2663 "♣" BLACK CLUB SUIT utf8:e2,99,a3>]
⇒  [#<U+2664 "♤" WHITE SPADE SUIT utf8:e2,99,a4>]
⇒  [#<U+2665 "♥" BLACK HEART SUIT utf8:e2,99,a5>]
⇒  [#<U+2666 "♦" BLACK DIAMOND SUIT utf8:e2,99,a6>]
⇒  [#<U+2667 "♧" WHITE CLUB SUIT utf8:e2,99,a7>]
⇒  [#<U+329C "㊜" CIRCLED IDEOGRAPH SUITABLE utf8:e3,8a,9c>]

$ uc_grep -o symbol suit
========================================
Trying suit…
 ♠  ♡  ♢  ♣  ♤  ♥  ♦  ♧  ㊜