Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Identifying scripts (writing systems)

by Anonymous Monk
on Sep 16, 2014 at 22:28 UTC ( [id://1100850]=note: print w/replies, xml ) Need Help??


in reply to Identifying scripts (writing systems)

Perhaps charscript() and charscripts() from Unicode::UCD could help?

Replies are listed 'Best First'.
Re^2: Identifying scripts (writing systems)
by AppleFritter (Vicar) on Sep 16, 2014 at 22:45 UTC

    Ah, I had a hunch there would be another solution, one that I'd overlooked! Indeed, you're right, the following also works (and is faster to boot):

    use Unicode::UCD qw/charscript/; # ... my %scripts; $scripts{charscript ord substr $_, 0, 1}++ foreach (@lines);

    And it appears that Unicode::UCD was added to the Perl core in 5.8, so I can't even claim victory on that front... on the other hand, I enjoyed working on this, so although I could've saved my time, I didn't strictly waste it. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1100850]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-20 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found