Мне довелось обыскать везде и не удалось найти решение для подсчета числа предложений в строке с использованием Ruby. Кто-нибудь, как это сделать?Count Number of Sentence Ruby
Пример
string = "The best things in an artist’s work are so much a matter of intuition, that there is much to be said for the point of view that would altogether discourage intellectual inquiry into artistic phenomena on the part of the artist. Intuitions are shy things and apt to disappear if looked into too closely. And there is undoubtedly a danger that too much knowledge and training may supplant the natural intuitive feeling of a student, leaving only a cold knowledge of the means of expression in its place. For the artist, if he has the right stuff in him ... "
Эта строка должна возвращать число 4
.
http://stackoverflow.com/a/18089658/517483 может помочь. –
Как вы определяете «предложение»? – Stefan