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

Liste des GroupesRevenir à cl python 
Sujet : Re: From JoyceUlysses.txt -- words occurring exactly once
De : dieter.maurer (at) *nospam* online.de
Groupes : comp.lang.python
Date : 31. May 2024, 18:59:15
Autres entêtes
Message-ID : <mailman.76.1717182444.2909.python-list@python.org>
References : 1 2
User-Agent : VM 8.0.12-devo-585 under 21.4 (patch 24) "Standard C" XEmacs Lucid (x86_64-linux-gnu)
HenHanna wrote at 2024-5-30 13:03 -0700:
>
Given a text file of a novel (JoyceUlysses.txt) ...
>
could someone give me a pretty fast (and simple) Python program that'd
give me a list of all words occurring exactly once?

Your task can be split into several subtasks:
 * parse the text into words

   This depends on your notion of "word".
   In the simplest case, a word is any maximal sequence of non-whitespace
   characters. In this case, you can use `split` for this task

 * Make a list unique -- you can use `set` for this

              -- Also, a list of words occurring once, twice or 3 times

For this you count the number of occurrences in a `list`.
You can use the `count` method of lists for this.

All individual subtasks are simple. I am confident that
you will be able to solve them by yourself (if you are willing
to invest a bit of time).

Date Sujet#  Auteur
30 May 24 * From JoyceUlysses.txt -- words occurring exactly once28HenHanna
30 May 24 +* Re: From JoyceUlysses.txt -- words occurring exactly once15dn
31 May 24 i`* Re: From JoyceUlysses.txt -- words occurring exactly once14HenHanna
1 Jun 24 i +- Re: From JoyceUlysses.txt -- words occurring exactly once1Peter J. Holzer
1 Jun 24 i +- Re: From JoyceUlysses.txt -- words occurring exactly once1Thomas Passin
5 Jun 24 i +- Re: From JoyceUlysses.txt -- words occurring exactly once1dn
5 Jun 24 i +- Re: From JoyceUlysses.txt -- words occurring exactly once1Grant Edwards
5 Jun 24 i +- Re: From JoyceUlysses.txt -- words occurring exactly once1Thomas Passin
7 Jun 24 i +- Re: From JoyceUlysses.txt -- words occurring exactly once1Mats Wichmann
8 Jun 24 i +* Re: From JoyceUlysses.txt -- words occurring exactly once2Larry Martell
8 Jun 24 i i`- Re: From JoyceUlysses.txt -- words occurring exactly once1Stefan Ram
8 Jun 24 i +- Re: From JoyceUlysses.txt -- words occurring exactly once1Thomas Passin
8 Jun 24 i +- Re: From JoyceUlysses.txt -- words occurring exactly once1<avi.e.gross
8 Jun 24 i +- Re: From JoyceUlysses.txt -- words occurring exactly once1Thomas Passin
9 Jun 24 i +- Re: From JoyceUlysses.txt -- words occurring exactly once1<avi.e.gross
9 Jun 24 i `- Re: From JoyceUlysses.txt -- words occurring exactly once1Grant Edwards
31 May 24 +* Re: From JoyceUlysses.txt -- words occurring exactly once2Pieter van Oostrum
31 May 24 i`- Re: From JoyceUlysses.txt -- words occurring exactly once1Grant Edwards
31 May 24 +- Re: From JoyceUlysses.txt -- words occurring exactly once1dieter.maurer
31 May 24 +- Re: From JoyceUlysses.txt -- words occurring exactly once1Thomas Passin
1 Jun 24 `* Re: From JoyceUlysses.txt -- words occurring exactly once8Mats Wichmann
3 Jun 24  `* Re: From JoyceUlysses.txt -- words occurring exactly once7Edward Teach
3 Jun 24   +* Re: From JoyceUlysses.txt -- words occurring exactly once5Grant Edwards
4 Jun 24   i`* Re: From JoyceUlysses.txt -- words occurring exactly once4Edward Teach
4 Jun 24   i +- Re: From JoyceUlysses.txt -- words occurring exactly once1Grant Edwards
4 Jun 24   i +- Re: From JoyceUlysses.txt -- words occurring exactly once1<avi.e.gross
5 Jun 24   i `- Re: From JoyceUlysses.txt -- words occurring exactly once1Chris Angelico
4 Jun 24   `- Re: From JoyceUlysses.txt -- words occurring exactly once1dieter.maurer

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal