Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Extracting the sentences from a webpage

by kyle (Abbot)
on Dec 07, 2009 at 22:31 UTC ( #811637=note: print w/ replies, xml ) Need Help??


in reply to Extracting the sentences from a webpage

I've never used Text::Sentence or Lingua::EN::Sentence, but they look like good places to start.

It looks as if you're trying to take a double space as the end of a sentence. Is that a special feature of your input text?

I'd do your @realSentences filtering with grep.

my @realSentence = grep { / / } @sentences;

In fact, from the split on down could be reduced to:

print "$_\n" for grep { / / } split /\./, $clean_text;


Comment on Re: Extracting the sentences from a webpage
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2015-07-02 08:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (31 votes), past polls