I recently decided to download some dictation software, in order to help with my writing. However, it doesn't work very well when I'm coding, since I have to change from saying words to symbols and back again. It's even worse when I'm coding in an esoteric language which is all symbols.
In order to make my use of the dictation program more consistent, I decided to switch it over to character mode, where I just say the name of each character instead. Problem solved! Though this does delay my novel's release date a little bit...
So, assuming that the longer the name of a character, the longer it takes to say, how long will it take me to spell out some of my programs/sentences?
Specifications
Given a string consisting of only printable ASCII, return the sum of each character's unicode name. For example, /
is called SOLIDUS
with 7 characters, and A
is LATIN CAPITAL LETTER A
with 22 characters.
But remember, I have to say your programs out loud to execute them, so their score will be based on how long it takes me to say them, i.e. as the sum of the lengths of each character's unicode name.
Test Cases:
In format input => output
with no trailing/leading spaces in input.
A => 22
/ => 7
Once upon a time... => 304
slurp.uninames>>.comb.sum.say => 530
JoKing => 124
!" #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ => 1591
Double-check your \s on the last test case ;) => 755
<say "<$_>~~.EVAL">~~.EVAL => 388
,[.,] => 58
19 => 19
Rules:
- Input to your program will only consist of printable ASCII characters, that is, the codepoints 32 (space) to 126 (tilde).
- For convenience sake, here is the list of lengths of the characters you have to handle:
[5,16,14,11,11,12,9,10,16,17,8,9,5,12,9,7,10,9,9,11,10,10,9,11,11,10,5,9,14,11,17,13,13,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,19,15,20,17,8,12,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,18,13,19,5]
- For convenience sake, here is the list of lengths of the characters you have to handle:
- Here is a reference program you can use to score your program.
- Peter Taylor has pointed out that the reference program normalises some unicode characters. It should still work for most solutions, but feel free to correct it if you need
- Since you're saying what the characters actually look like, your solution will be scored by the characters that are displayed, not the bytes involved. This is directed at languages with custom encodings.
- You can assume that I've memorised the entire Unicode library and can say whatever strange characters you use.
- Sorry Rogem, but answers have to be composed of displayable characters. Unprintables are fine, I just have to be able to read the characters out loud.
- Whatever you do, do not use
ﯹ
in your program.
ARABIC LIGATURE UIGHUR KIRGHIZ YEH WITH HAMZA ABOVE WITH ALEF MAKSURA ISOLATED FORM
this will be the full name of my child \$\endgroup\$\x[2126]
is counted as\x[3a9]
. \$\endgroup\$