Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Keywords and keyphrases extraction from text

by cosmicperl (Chaplain)
on May 13, 2009 at 18:00 UTC ( [id://763853]=note: print w/replies, xml ) Need Help??


in reply to Keywords and keyphrases extraction from text

Hi vit,
  Funnily enough I just updating a script that does something like this. The code I use is:-
### Clean up the text to make it easier to search $bodytext =~ s/\n/ /gis; $bodytext =~ s/\r//gis; $bodytext =~ s/\t/ /gis; $bodytext =~ s/ - / /gis; while ($bodytext =~ / /) { $bodytext =~ s/ / /gis; }#while ### match 2 word groups while ($bodytext =~ /\b([A-Za-z'\-]+ [A-Za-z'\-]+)\b/g) { print "$1\n"; }#while
It's a bit hacky, but works. Although there is a nasty bug with it, I'm hoping someone will have the answer here


Lyle

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-05-23 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found