What I want to do is go up to three keywords at a time (one word, two words and three word phrases). The one word is easy, I'll rip through the array and populate a $hash++ with it. But now moving on to two and three keyword phrases.
I was thinking about tossing in a regex in the split (assuming we can do that) to match 2 words and 3 words. Unfortunately my regex skills aren't up to par quite yet and not sure how to go about that.
The first problem I am having is it's breaking up on my apostraphes making the following 's' a new word I don't want that.
I would like to see some advice on how to go about doing this the way I am trying to before seeing other methods on how to do this. I know there are ways to produce shorter code, but this is probably easiest for me to understand right now.my $content = qq(Three blind mice. Three blind mice. See how they ru +n. See how they run. The butcher's wife came after them with a knif +e, three blind mice.); my @words = split(/\W/, $content); chomp(@words); foreach (@words) { print "$_\n"; }
In reply to Word density by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |