Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: character offset to word offset

by newbio (Beadle)
on Sep 09, 2008 at 03:05 UTC ( [id://709960]=note: print w/replies, xml ) Need Help??


in reply to character offset to word offset

Dear Monks, Thanks a lot for your help. This is not a homework problem but part of + a bigger project. Here is how I did it: substr($sentence, $_, 0) = '**' for @temp1; #@temp1 contains the desce +nding character positions used for marking. @temp2=split(' ', $sentence); #indices of the elements in @temp2 that +have ^\*\* will give me their word count from the start. New thing that I learned here is that substr() could also be used for +assignment...:). Thank you all beloved monks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2026-03-06 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.