Add sus updates
This commit is contained in:
parent
a7e3dc11fd
commit
3ef1a72418
1 changed files with 2496 additions and 964 deletions
|
|
@ -9,7 +9,6 @@ from .external.pylatexenc.latex2text import LatexNodes2Text
|
|||
from .logger.create_logger import create_logger
|
||||
|
||||
logger = create_logger("clean")
|
||||
|
||||
latex = LatexNodes2Text()
|
||||
|
||||
|
||||
|
|
@ -46,6 +45,10 @@ def clean(
|
|||
text = "".join([c for c in text if not unicodedata.combining(c)])
|
||||
text = unidecode.unidecode(text)
|
||||
|
||||
text = re.sub(
|
||||
r"\b[a-zA-Z](?:[\t ]+[a-zA-Z]\b)+", lambda m: re.sub(r"[\t ]", "", m[0]), text
|
||||
) # A R T I C L E => ARTICLE
|
||||
|
||||
if remove_brackets:
|
||||
text = re.sub(r"\[[^\]]*\]", " ", text)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue