Skip to content

Examples of modifying sentence segmentation rules. #109

Answered by nipunsadvilkar
delvinso asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @delvinso thanks for using pysbd.

Unfortunately, there is no specific documentation about modifying rules as there are so many and each rule is associated with some form of transformation which is taken as a input by other rule.

To illustrate it further:

pySBD/pysbd/processor.py

Lines 32 to 37 in 5905f13

li = ListItemReplacer(self.text)
self.text = li.add_line_break()
self.replace_abbreviations()
self.replace_numbers()
self.replace_continuous_punctuation()
self.replace_periods_before_numeric_references()

As you can see above, all those operations needs to be performed in that sequence as they are interrelated. The way these are structured are h…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nipunsadvilkar
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #108 on February 25, 2022 07:33.