help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any faster way to find frequency of words?


From: Emanuel Berg
Subject: Re: Any faster way to find frequency of words?
Date: Sun, 09 May 2021 17:02:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis wrote:

>        (text (text-alphabetic-only text))
>        (words (split-string text " " t " ")))

Here is what I would try first

  1. `buffer-substring'
  2. `split-string'
  3. `delete-dups'
  4. loop and do `how-many'
  5. get a new list with '(occurrences word)
  6. sort WRT occurrences
  7. loop and (insert "%d %s\n" occ wrd)

Easy. Fast enough?

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]