=begin pod

=head1 NAME

uniname-words - look for words in unicode character names

=head1 SYNOPSIS

=begin code :lang<raku>
use uniname-words;

say uniname-words.elems;  # 262166

say .uniname for uniname-words<love>;
# LOVE HOTEL
# LOVE LETTER
# I LOVE YOU HAND SIGN

say .uniname for uniname-words(<left bracket>);
=end code

=head1 DESCRIPTION

The C<uniname-words> distribution exports a single subroutine:
C<uniname-words>.  When called without a parameter, it returns a C<Map>
with each word (/w+) from the unicode database (active at installation
of the module) as a key (in lowercase), and an C<int32> array of the
codepoints that have that word in their name, as the value.

All Unicode reserved codepoints are available under the C<reserved>
key: the rest of the name can be deduced from the codepoint value.

When the C<uniname-words> sub is called with one or more arguments,
they are considered to be words to return the codepoints of:  these
can be specified as a C<Str> or as a C<Regex>.  Given words will be
automatically lowercased to be checked.  An optional C<:partial> named
argument can be specified to return the codepoints of words that partially
match.

By default, if more than one word has been specified, B<all> words must
occur in the unicode name to be included.  An optional C<:any> named
argument can be specified that B<any> of the specified words should occur.

=head1 uw

This module also install a command-line utility C<uw>, that takes one
or more words, and the C<--partial> and C<--any> parameters, just like
the C<uniname-words> sub does, and lists the names of the selected
code points on STDOUT.  It also additionally takes a C<--hex> parameter
(to just see the hexadecimal values), a C<--name> parameter (to just see
the names) and/or a C<--char> (to just see a rendition).  These 3 parameters
can also be mixed in any combination.

=head1 un

This module also install a command-line utility C<un>, that takes one
or more strings, and lists the names of the code points of these strings
on STDOUT. It also additionally takes a C<--hex> parameter (to just see the
hexadecimal values), a C<--name> parameter (to just see the names) and/or
a C<--char> (to just see a rendition).  These 3 parameters can also be mixed
in any combination.

=head1 INSTALLATION NOTE

Installing (or running this module for the first time after a
runtime update) may take up to a minute (or possibly more on
slower machines) because the entire unicode database is *then*
checked, allowing it to remain up-to-date across versions of the
run-time.

=head1 AUTHOR

Elizabeth Mattijsen <liz@raku.rocks>

Source can be located at: https://codeberg.org/lizmat/uniname-words . Comments and
Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a
L<small sponsorship|https://github.com/sponsors/lizmat/>  would mean a great
deal to me!

=head1 COPYRIGHT AND LICENSE

Copyright 2021, 2022, 2023, 2024, 2025, 2026 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

=end pod

# vim: expandtab shiftwidth=4
