Commit 4cea7451 authored by Vít Starý Novotný's avatar Vít Starý Novotný
Browse files

When `include_prefix` or `include_suffix` is true, always yield something

parent a7b397ca
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -127,6 +127,9 @@ def extract_sentences(text: str,
            yield (regex.sub(r'^(\s*).*', r'\1', sentence_suffix),
            yield (regex.sub(r'^(\s*).*', r'\1', sentence_suffix),
                   regex.sub(r'^\s*(.*)', r'\1', sentence_suffix))
                   regex.sub(r'^\s*(.*)', r'\1', sentence_suffix))


    if (include_prefix or include_suffix) and not matches:
        yield ('', text)



def extract_ngrams(text: str, minn: int, maxn: int) -> Set[str]:
def extract_ngrams(text: str, minn: int, maxn: int) -> Set[str]:
    ngrams = set()
    ngrams = set()