def test_issue10086(en_tokenizer):
    """Test special case works when part of infix substring."""
    text = "No--don't see"

    # without heuristics: do n't
    en_tokenizer.faster_heuristics = False
    doc = en_tokenizer(text)
    assert "n't" in [w.text for w in doc]
    assert "do" in [w.text for w in doc]

    # with (default) heuristics: don't
    en_tokenizer.faster_heuristics = True
    doc = en_tokenizer(text)
    assert "don't" in [w.text for w in doc]
Test special case works when part of infix substring.
spacy/tests/tokenizer/test_tokenizer.py