Skip to content

Commit

Permalink
Don't require whitespace.
Browse files Browse the repository at this point in the history
Consume whitespace if there is any, but still match if there isn't. This makes most sense for \n followed immediately by ¿. This also means we don't have to backtrack if there isn't any whitespace after a line ending.
  • Loading branch information
Sjord committed Oct 12, 2022
1 parent cf3ead4 commit fe59143
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dateparser/languages/locale.py
Expand Up @@ -263,7 +263,7 @@ def _sentence_split(self, string, settings):

splitters_dict = {1: r'[\.!?;…\r\n]+(?:\s|$)*', # most European, Tagalog, Hebrew, Georgian,
# Indonesian, Vietnamese
2: r'[\.!?;…\r\n]+(\s+[¡¿]*|$)|[¡¿]+', # Spanish
2: r'[\.!?;…\r\n]+(\s*[¡¿]*|$)|[¡¿]+', # Spanish
3: r'[|!?;\r\n]+(?:\s|$)+', # Hindi and Bangla
4: r'[。…‥\.!??!;\r\n]+(?:\s|$)+', # Japanese and Chinese
5: r'[\r\n]+', # Thai
Expand Down

0 comments on commit fe59143

Please sign in to comment.