Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^9: putting text into array word by word

by Not_a_Number (Parson)
on Jan 10, 2012 at 20:02 UTC ( #947230=note: print w/ replies, xml ) Need Help??

in reply to Re^8: putting text into array word by word
in thread putting text into array word by word

OK, let's extract another worm from the can we've opened. Say we want to count all the times 'John' appears in a text. Given a sentence:

Was it John or John's brother?

Should the count be one or two?

Comment on Re^9: putting text into array word by word
Replies are listed 'Best First'.
Re^10: putting text into array word by word
by jms53 (Monk) on Jan 10, 2012 at 20:14 UTC

    Actually, that is the next part of what I'm going to do.

    However, since I am only interested in words from the English dictionary, it doesn't matter so much whether John's is counted or not as John. (export to csv, open in spreadsheet).

    I would however be extremely interested in knowing how you would change this, as I will get that kind of issue with contractions (it's, wouldn't, etc. that I had planned on tackling with a spreadsheet, (but then again, I am trying to minimize user interaction)

    Thank you

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://947230]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2016-02-08 19:43 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (283 votes), past polls