diff --git a/examples/sample.ipynb b/examples/sample.ipynb index 70ed68c..3612465 100644 --- a/examples/sample.ipynb +++ b/examples/sample.ipynb @@ -556,7 +556,7 @@ "@spacy.registry.misc(\"prefix_scrubber\")\n", "def prefix_scrubber():\n", "\tdef scrubber_func(span: Span) -> str:\n", - "\t\twhile span[0].text in (\"a\", \"the\", \"their\", \"every\", \"other\"):\n", + "\t\twhile len(span) > 1 and span[0].text in (\"a\", \"the\", \"their\", \"every\", \"other\"):\n", "\t\t\tspan = span[1:]\n", "\t\treturn span.text\n", "\treturn scrubber_func\n",