4 ms·
So does Knuth's, which embeds a case conversion table directly in the code. http://onesixtythree.com/literate/literate2.pdf http://onesixtythree.com/literate/li
by philh 11y ago
So does Knuth's, which embeds a case conversion table directly in the code. http://onesixtythree.com/literate/literate2.pdf http://onesixtythree.com/literate/literate2.pdf
The shell script is easy enough to approximately fix:
tr -cs '[:alpha:]' '\n' |
tr '[:upper:]' '[:lower:]' |
sort |
uniq -c |
sort -rn |
sed ${1}q
(In my tests, it doesn't turn ẞ into ß, but it does turn É into é. "straße" is recognized as all one word, but not as the same word as "strasse" - but it's not clear whether it should be or not. I'm not sure how it'll handle normalization, if the same character is represented in two different ways.)