def test_tokenizer_explain_fuzzy(lang: str, sentence: str) -> None:
    """
    Tests whether output of tokenizer.explain() matches tokenizer output. Input generated by hypothesis.
    lang (str): Language to test.
    text (str): Fuzzily generated sentence to tokenize.
    """

    tokenizer: Tokenizer = spacy.blank(lang).tokenizer
    # Tokenizer.explain is not intended to handle whitespace or control
    # characters in the same way as Tokenizer
    sentence = re.sub(r"\s+", " ", sentence).strip()
    tokens = [t.text for t in tokenizer(sentence)]
    debug_tokens = [t[1] for t in tokenizer.explain(sentence)]
    assert tokens == debug_tokens, f"{tokens}, {debug_tokens}, {sentence}"

    Tests whether output of tokenizer.explain() matches tokenizer output. Input generated by hypothesis.
    lang (str): Language to test.
    text (str): Fuzzily generated sentence to tokenize.
    
spacy/tests/tokenizer/test_explain.py