Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 avoiding work at the Monastery: (6)
As of 2014-09-22 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (206 votes), past polls