Sujet : Re: The joy of pipes
De : * (at) *nospam* eli.users.panix.com (Eli the Bearded)
Groupes : comp.os.linux.miscDate : 15. Nov 2024, 07:41:40
Autres entêtes
Organisation : Some absurd concept
Message-ID : <eli$2411150141@qaz.wtf>
References : 1 2 3 4
User-Agent : Vectrex rn 2.1 (beta)
In comp.os.linux.misc, John Ames <
commodorejohn@gmail.com> wrote:
Eli the Bearded <*@eli.users.panix.com> wrote:
Okay, I give up.
1. How does that relate to EBCDIC?
(I think it was a topic shift to applications of *nix pipes...?)
Traditional Unix "spell", which merely outputs words not recognized
without context or even line numbers, is an application of pipes.
Roughly like this:
--8<---------------cut here---------------start------------->8---
cat ~/.spell.words /usr/dict/words 2>/dev/null |
tr A-Z a-z |
tr -dc a-z'
' |
grep '[a-z]' |
SPELLSTEMTOOL |
sort -u > $TMPFILE_A
< $INPUT_FILE tr -s ' ^I!$&()_+[]{}:l"'\''\.,?/-' '
' |
tr A-Z a-z |
tr -dc a-z'
' |
grep '[a-z]' |
sort -u > $TMPFILE_B
comm -13 $TMPFILE_A $TMPFILE_B
--8<---------------cut here---------------end--------------->8---
Where SPELLSTEMTOOL is a heuristic that tries to make "try" into "tries"
and related dictionary fixes to compensate for the words file not having
all the variants. (These days it is /usr/share/dict/words but also
these days traditional spell is hard to find. Gnu spell is different.)
Elijah
------
or maybe the stem tool worked on file B in the other direction