Created
May 20, 2013 21:49
-
-
Save ispedals/5615858 to your computer and use it in GitHub Desktop.
Display the character name of farsi letters in a sentence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!perl | |
| use v5.12; | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use Unicode::UCD 'charinfo'; | |
| my $SENTENCE = ''; | |
| foreach (split(' ',$SENTENCE)){ | |
| foreach (split('')){ | |
| my $letter=charinfo(ord($_))->{'name'}; | |
| $letter =~ s/^arabic letter( farsi)?\s*//i; | |
| print "|$letter"; | |
| } | |
| print "\n"; | |
| say '-' x 50; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment