Yorùbá stop word list contains bare diacritics and consonant fragments
How to reproduce the behaviour
The Yorùbá stop word list (spacy/lang/yo/stop_words.py) contains 91 entries, and 38 of them are single characters. Several of these are not words:
- Bare combining marks: U+0300, U+0301, U+0323
- Isolated consonants: b, d, f, g, j, k, l, p, r, s, t, w, y, ṣ
- Vowels that only occur inside words, not on their own: à, e, è, i, ì, u, ù
To reproduce:
python -c "from spacy.lang.yo.stop_words import STOP_WORDS as s; print(len(s)); print([ascii(w) for w in sorted(s) if len(w) == 1])"
It looks like the list was built from text that wasn't Unicode normalised, so accents and letters were split into separate entries. The list appears to have been imported from the dohliam/more-stoplists Yorùbá list when Yorùbá support was added in #4614. As a result, token.is_stop is unreliable for Yorùbá, and a standalone combining mark in the set is never a meaningful match.
Some single-character entries are real Yorùbá words and should stay, for example:
- ó (he/she/it): Ó ń sùn
- ń (progressive marker): Wọ́n ń jẹun
- ò (negation, from kò): Mi ò lọ
- á, é, í, ú (third-person object pronouns): Ó rí í
I'm a Yorùbá speaker working on Yorùbá NLP and would be happy to open a PR that removes the 24 invalid entries and adds a test to prevent this happening again.
Your Environment
- Operating System: Windows
- Python Version Used: 3.14.6
- spaCy Version Used: 3.8.16
- Environment Information: Installed with pip
Source: explosion/spaCy