Ask Your Question
0

Count occurence of words and phrases

asked 2021-03-04 16:31:47 +0200

lduperval gravatar image

updated 2021-03-05 03:44:41 +0200

Hi,

I'm looking for a tool or extension like the Linguist extension that can take some words and phrases as input, and count how many times they show up in a document. For example, I would have different counts for:

social
media
social media

Is there such a tool/extension? If not, maybe I will tweak Linguist to do that... if I can.

The reason I need this: I do a lot of SEO writing. With such writing, I need to make sure that some words or phrases appear in the text. But I also don't want the same words or phrases to appear too often. When I write, I often don't notice the "density" until I read the final text.

This tool does it, but it doesn't find all the phrases I want, and it doesn't tell me the ones that should appear but are not there.

I read the early replies, and most of the options are manual.

I feel like my best option, at this point, is to modify Linguist to support what I want by:

  • adding the ability to take a list of words or phrases as input
  • output (in a separate document) the sorted count and percentage for each

Hopefully, this is clearer.

If there is something obvious that I'm overlooking, let me know.

Thanks,

L

(reformatted by ajlittoz to make the example clear)

edit retag flag offensive close merge delete

Comments

Can't answer to such a vague question. What is your purpose beyond counting words? In which format are your documents recorded: .txt, .odt, .doc(x), … Is it important to keep the formatting (because formatting make it difficult to use brute force searching)?

Provide any clue which could help to give you an advice.

Please do not use Add Answer but edit your original question to enhance the details of your question (answers are reserved for solutions to a problem on this Q&A site).

ajlittoz gravatar imageajlittoz ( 2021-03-04 16:45:06 +0200 )edit

If you're willing to export without formatting (as .txt), you have specialised apps like GLIMPSE or SWISH-E (the latter being more fit for web pages lookup). Common utilities like grep or awk could be a starting point.

ajlittoz gravatar imageajlittoz ( 2021-03-04 18:47:19 +0200 )edit

For searching words, follow @m.a.riosv answer.

To count phrases, you can also use Ctrl+H and Replace all, and look at the new info in the Find & Replace dialog, then Undo

image description

¹ There is a bug here in version 6.4.7.2 (not seen in 7.0.4.2, nor in 7.1.0.3) that undo wouldn't work as expected. So, save your changes before trying that.

LeroyG gravatar imageLeroyG ( 2021-03-05 00:43:02 +0200 )edit

There is a bug

I restored my user profile at no avail.

LeroyG gravatar imageLeroyG ( 2021-03-05 00:44:53 +0200 )edit

Hopefully when you improve Linguist you will publish your solution

Astur gravatar imageAstur ( 2021-03-05 04:05:53 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2021-03-05 00:00:44 +0200

m.a.riosv gravatar image

Count words one by one it's easy.

Select the word - [Ctrl+H] - Find All, on the status bar you can see how many times it is found.

To know about phrases,
Select the phrase, in the status bar you can see how many words it has, take note - [Ctrl+H] - Find All, on the status bar you can see how many words has been found, divide by the number of words in the phrase.

edit flag offensive delete link more

Comments

Not Ctrl + H, but Ctrl + F

Astur gravatar imageAstur ( 2021-03-05 03:49:04 +0200 )edit

Not Ctrl + H, but Ctrl + F

Ctrl + H for Find & Replace, and Ctrl + F for Find. Both work here.

LeroyG gravatar imageLeroyG ( 2021-03-05 11:55:23 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2021-03-04 16:31:47 +0200

Seen: 49 times

Last updated: Mar 05