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

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

Re: Counting words


From: thorne
Subject: Re: Counting words
Date: Thu, 12 Apr 2007 06:14:14 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.51 (gnu/linux)

> Wilfred Zegwaard (privé) wrote:
>> I found the wordcount thing.
>> I mean specific instances of words. The number of times eg that
>> "the" occurs in a text. But I need to search on specific
>> combinations, like "the exact word", but also a fuzzy search on
>> specific combinations.

My versions of Emacs i use (22 and 23) both have an interactive
function called `how-many' (aliased to `count-matches' also) that
counts the number of matches for a regexp in a buffer.  Is that what
you are looking for?

I was just using it last night editing a large fiction work to look
for possibly overused words.

,----[ C-h f how-many RET ]
| how-many is an interactive compiled Lisp function in `replace.el'.
| (how-many regexp &optional rstart rend interactive)
| 
| Print and return number of matches for regexp following point.
| When called from Lisp and interactive is omitted or nil, just return
| the number, do not print it; if interactive is t, the function behaves
| in all respects has if it had been called interactively.
| 
| If regexp contains upper case characters (excluding those preceded by `\'),
| the matching is case-sensitive.
| 
| Second and third arg rstart and rend specify the region to operate on.
| 
| Interactively, in Transient Mark mode when the mark is active, operate
| on the contents of the region.  Otherwise, operate from point to the
| end of (the accessible portion of) the buffer.
| 
| This function starts looking for the next match from the end of
| the previous match.  Hence, it ignores matches that overlap
| a previously found match.
`----


-- 
þ    theron tlåx    þ
(compose-mail (concat "thorne@" (rot13 "gvzoeny") ".net"))


reply via email to

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