We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd0ab50 commit 4ebef18Copy full SHA for 4ebef18
guardrails/validator_base.py
@@ -71,10 +71,10 @@ def split_sentence_word_tokenizers_jl(
71
is_minimum_length = True
72
73
# check for potential line endings, which is what split_sentences does
74
- chunk_with_potential_line_endings, count = re.sub(
+ chunk_with_potential_line_endings, count = re.subn(
75
r"([?!.])(?=\s|$)", rf"\1{separator}", chunk
76
)
77
- any_potential_line_endings = int(count) > 0
+ any_potential_line_endings = count > 0
78
if not is_minimum_length or not any_potential_line_endings:
79
return []
80
0 commit comments