Skip to content

Commit

Permalink
Merge pull request #74 from nipunsadvilkar/npn-newline-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nipunsadvilkar authored Aug 11, 2020
2 parents 92362f7 + 60983a2 commit 9069997
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# v0.3.1
- 🚑 ✅ Handle Newline character & update tests

# v0.3.0
- ✨ 💫 Support Multiple languages - \#2
- 🏎⚡️💯 Benchmark across Segmentation Tools, Libraries and Algorithms
- 🎨 ♻️ Update sentence char_span logic
- ⚡️ Performance improvements - \#41
- ♻️🐛 Refactor AbbreviationReplacer

# v0.3.0rc
- ✨ 💫 sent `char_span` through with spaCy & regex approach - \#63
- ♻️ Refactoring to support multiple languages
Expand Down
2 changes: 1 addition & 1 deletion pysbd/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/

__title__ = "pysbd"
__version__ = "0.3.0"
__version__ = "0.3.1"
__summary__ = "pysbd (Python Sentence Boundary Disambiguation) is a rule-based sentence boundary detection that works out-of-the-box across many languages."
__uri__ = "http://nipunsadvilkar.github.io/"
__author__ = "Nipun Sadvilkar"
Expand Down
1 change: 1 addition & 0 deletions pysbd/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(self, text, lang, char_span=False):
def process(self):
if not self.text:
return self.text
self.text = self.text.replace('\n', '\r')
li = ListItemReplacer(self.text)
self.text = li.add_line_break()
self.replace_abbreviations()
Expand Down
8 changes: 7 additions & 1 deletion tests/regression/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@
('#55', "She turned to him, \"This is great.\" She held the book out to show him.",
[
('She turned to him, "This is great." ', 0, 36), ('She held the book out to show him.', 36, 70)
])
]),
('#56',
"""This eBook is for the use of anyone anywhere at no cost
you may copy it, give it away or re-use it under the terms of the this license
""",
[('This eBook is for the use of anyone anywhere at no cost\n', 0, 56),
('you may copy it, give it away or re-use it under the terms of the this license\n', 56, 135)])

]

Expand Down

0 comments on commit 9069997

Please sign in to comment.