Following a tutorial in a book, using the following code to split text into sentences,
def sentences
gsub(/\n|\r/, ' ').split(/\.\s*/)
end
It works, but if theres a newline which began without a period preceding it, for example,
Hello. two line sentence
and heres the new line
theres a "\t" placed at the beginning of each sentence. So if i called the method on the above sentence i would get
["Hello." "two line sentence /tand heres the new line"]
Any help would be much appreciated! Thanks!