3 ms·
That argument only works if you don't see Pascal as an already-heavily developed language. Pascal itself also evolves. Perhaps you could run Knuth's code on mod
by vinceguidry 11y ago
That argument only works if you don't see Pascal as an already-heavily developed language. Pascal itself also evolves. Perhaps you could run Knuth's code on modern Delphi, perhaps it would break. The proof is in the pudding, as they say, and the shell version is much more likely to be used by anyone solving that particular problem.
- reagency 11y agoThe shell version completely fails on Unicode or even Latin ASCII.
- philh 11y agoSo 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.)