A
Anthony Liu
I am kinda new to Python, but not new to programming.
I am a certified Java programmer.
I don't want to read line after line, neither do I
want to read the whole file all at once. Thus none of
read(), readline(), readlines() is what I want. I want
to read a text file sentence by sentence.
A sentence by definition is roughly the part between a
full stop and another full stop or !, ?
So, for example, for the following text:
"Some words here, and some other words. Then another
segment follows, and more. This is a question, a junk
question, followed by a question mark?"
It has 3 sentences (2 full stops and 1 question mark),
and therefore I want to read it in 3 lumps and each
lump gives me one complete sentence as follows:
lump 1: Some words here, and some other words.
lump 2: Then another segment follows, and more.
lump 3: This is a question, a junk question, followed
by a question mark?
How can I achieve this? Do we have a readsentence()
function?
Please give a hint. Thank you!
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com
I am a certified Java programmer.
I don't want to read line after line, neither do I
want to read the whole file all at once. Thus none of
read(), readline(), readlines() is what I want. I want
to read a text file sentence by sentence.
A sentence by definition is roughly the part between a
full stop and another full stop or !, ?
So, for example, for the following text:
"Some words here, and some other words. Then another
segment follows, and more. This is a question, a junk
question, followed by a question mark?"
It has 3 sentences (2 full stops and 1 question mark),
and therefore I want to read it in 3 lumps and each
lump gives me one complete sentence as follows:
lump 1: Some words here, and some other words.
lump 2: Then another segment follows, and more.
lump 3: This is a question, a junk question, followed
by a question mark?
How can I achieve this? Do we have a readsentence()
function?
Please give a hint. Thank you!
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com