• Re: From JoyceUlysses.txt -- words occurring exactly once

    From Stefan Monnier@21:1/5 to All on Thu May 30 18:45:00 2024
    XPost: comp.lang.lisp

    Given a text file of a novel (JoyceUlysses.txt) ...
    could someone give me a pretty fast (and simple) program that'd give me
    a list of all words occurring exactly once?

    tr ' .;:,?!' '\n' | sort | uniq -u

    ?


    - Stefan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to All on Fri May 31 00:40:59 2024
    XPost: comp.lang.lisp

    could someone give me a pretty fast (and simple) program that'd give
    me a list of all words occurring exactly once?

    To first approximation, this works for me (bash command):

    tr -c "[a-zA-Z-]" "\n" < ulysses.txt |sort|uniq -c|sort -n

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)