diff options
author | René Scheibe <rene.scheibe@gmail.com> | 2014-09-26 22:23:07 +0200 |
---|---|---|
committer | René Scheibe <rene.scheibe@gmail.com> | 2014-09-29 10:37:21 +0200 |
commit | 52fd50b24933da0702a69df2b366ca5267f717a0 (patch) | |
tree | 02f74d83d65dfc8e0ba31bf1331b76f28b215e01 | |
parent | 7aee68bb664d23b895d71401681dbb2d4043e6b1 (diff) | |
download | ninka-52fd50b24933da0702a69df2b366ca5267f717a0.tar.gz |
fix handling of abbreviations at the beginning of a line
- the code was not in sync with the comment
-rw-r--r-- | lib/Ninka/SentenceExtractor.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Ninka/SentenceExtractor.pm b/lib/Ninka/SentenceExtractor.pm index c0dec2e..2e7fe27 100644 --- a/lib/Ninka/SentenceExtractor.pm +++ b/lib/Ninka/SentenceExtractor.pm @@ -208,9 +208,9 @@ sub split_text { } else { $last_word = lc $last_word; - # only accept abbreviations if the previous char to the abbrev is space or - # is empty (beginning of line). This avoids things like .c - if (length($before) > 0 && $before eq ' ' && $self->{abbreviations}{$last_word}) { + # Only accept abbreviations if the previous char is empty (beginning of line) or a space. + # This avoids things like .c + if (($before eq '' || $before eq ' ') && $self->{abbreviations}{$last_word}) { $current_sentence .= $sentence; next; } else { |