Jump to content
UBot Underground

Recommended Posts

Here's what I am trying to do but can't seem to figure out:

 

I scrape a page of text, and I want to count how many times a specific word or phrase is used in that content.

 

Example: the dog has fleas, but his fleas are trained to act like dogs, so the dogs fleas are going to make a great circus act.

 

I want to count how many times the word "fleas" has been used in the content.

 

Of course, the control word (fleas in this case) would be in the form of a variable that the user would enter the phrase/word to search for.

 

Any idea on how to achieve this?

 

Link to post
Share on other sites

if you want to catch Fleas, and fleas, then you could have the keyword change case, find and replace both the words through the text with something like '@@@keyword@@@' and then split with that as the delimiter.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...