53f8526ad5dff1e71cd90b420dad8a426d94d33d,pysbd/abbreviation_replacer.py,,replace_prepositive_abbr,#Any#Any#,16
Before Change
def replace_prepositive_abbr(txt, abbr):
txt = re.sub(r"(?<=\s{abbr})\.(?=\s)|(?<=^{abbr})\.(?=\s)".format(abbr=abbr.strip()), "∯", txt)
txt = re.sub(r"(?<=\s{abbr})\.(?=:\d+)|(?<=^{abbr})\.(?=:\d+)".format(abbr=abbr.strip()), "∯", txt)
return txt
After Change
def replace_prepositive_abbr(txt, abbr):
// prepend a space to avoid needing another regex for start of string
txt = " " + txt
txt = re.sub(r"(?<=\s{abbr})\.(?=(\s|:\d+))".format(abbr=abbr.strip()), "∯", txt)
// remove the prepended space
txt = txt[1:]
return txt
def replace_period_of_abbr(txt, abbr):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances Project Name: nipunsadvilkar/pySBD
Commit Name: 53f8526ad5dff1e71cd90b420dad8a426d94d33d
Time: 2019-11-07
Author: daniel@allenai.org
File Name: pysbd/abbreviation_replacer.py
Class Name:
Method Name: replace_prepositive_abbr
Project Name: nipunsadvilkar/pySBD
Commit Name: 53f8526ad5dff1e71cd90b420dad8a426d94d33d
Time: 2019-11-07
Author: daniel@allenai.org
File Name: pysbd/abbreviation_replacer.py
Class Name:
Method Name: replace_pre_number_abbr
Project Name: nipunsadvilkar/pySBD
Commit Name: 53f8526ad5dff1e71cd90b420dad8a426d94d33d
Time: 2019-11-07
Author: daniel@allenai.org
File Name: pysbd/abbreviation_replacer.py
Class Name:
Method Name: replace_period_of_abbr