Skip to content
Merged

Format #13929

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions spacy/lang/af/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Source: https://github.com/stopwords-iso/stopwords-af

STOP_WORDS = set(
"""
STOP_WORDS = set("""
'n
aan
af
Expand Down Expand Up @@ -53,5 +52,4 @@
was
wat
ʼn
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/am/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Stop words by Teshome Kassie http://etd.aau.edu.et/bitstream/handle/123456789/3315/Teshome%20Kassie.pdf?sequence=1&isAllowed=y
# Stop words by Tihitina Petros http://etd.aau.edu.et/bitstream/handle/123456789/3384/Tihitina%20Petros.pdf?sequence=1&isAllowed=y

STOP_WORDS = set(
"""
STOP_WORDS = set("""
ግን አንቺ አንተ እናንተ ያንተ ያንቺ የናንተ ራስህን ራስሽን ራሳችሁን
ሁሉ ኋላ በሰሞኑ አሉ በኋላ ሁኔታ በኩል አስታውቀዋል ሆነ በውስጥ
አስታውሰዋል ሆኑ ባጣም እስካሁን ሆኖም በተለይ አሳሰበ ሁል በተመለከተ
Expand All @@ -29,5 +28,4 @@
በዚህም መሆን ምንጊዜም እነዚህም በዚህና ያለ ስም
ሲኖር ከዚህም መሆኑን በሁኔታው የማያንስ እነዚህኑ ማንም ከነዚሁ
ያላቸውን እጅግ ሲሆኑ ለሆኑ ሊሆን ለማናቸውም
""".split()
)
""".split())
12 changes: 4 additions & 8 deletions spacy/lang/ar/lex_attrs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from ...attrs import LIKE_NUM

_num_words = set(
"""
_num_words = set("""
صفر
واحد
إثنان
Expand Down Expand Up @@ -51,11 +50,9 @@
مليون
مليار
مليارات
""".split()
)
""".split())

_ordinal_words = set(
"""
_ordinal_words = set("""
اول
أول
حاد
Expand All @@ -70,8 +67,7 @@
ثامن
تاسع
عاشر
""".split()
)
""".split())


def like_num(text):
Expand Down
6 changes: 2 additions & 4 deletions spacy/lang/ar/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
STOP_WORDS = set(
"""
STOP_WORDS = set("""
من
نحو
لعل
Expand Down Expand Up @@ -386,5 +385,4 @@
وإن
ولو
يا
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/az/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Source: https://github.com/eliasdabbas/advertools/blob/master/advertools/stopwords.py
STOP_WORDS = set(
"""
STOP_WORDS = set("""
amma
arasında
artıq
Expand Down Expand Up @@ -141,5 +140,4 @@
əlbəttə
ən
əslində
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/bg/stop_words.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
https://postvai.com/books/stop-dumi.pdf - Additions to the original list in order to improve it.
"""

STOP_WORDS = set(
"""
STOP_WORDS = set("""
а автентичен аз ако ала
бе без беше би бивш бивша бившо бивши бил била били било благодаря близо бъдат
Expand Down Expand Up @@ -76,5 +75,4 @@
юмрук
я як
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/bn/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
STOP_WORDS = set(
"""
STOP_WORDS = set("""
অতএব অথচ অথবা অনুযায়ী অনেক অনেকে অনেকেই অন্তত অবধি অবশ্য অর্থাৎ অন্য অনুযায়ী অর্ধভাগে
আগামী আগে আগেই আছে আজ আদ্যভাগে আপনার আপনি আবার আমরা আমাকে আমাদের আমার আমি আর আরও
ইত্যাদি ইহা
Expand Down Expand Up @@ -38,5 +37,4 @@
সাধারণ সামনে সঙ্গে সঙ্গেও সব সবার সমস্ত সম্প্রতি সময় সহ সহিত সাথে সুতরাং সে সেই সেখান সেখানে সেটা সেটাই সেটাও সেটি স্পষ্ট স্বয়ং
হইতে হইবে হইয়া হওয়া হওয়ায় হওয়ার হচ্ছে হত হতে হতেই হন হবে হবেন হয় হয়তো হয়নি হয়ে হয়েই হয়েছিল হয়েছে হাজার
হয়েছেন হল হলে হলেই হলেও হলো হিসাবে হিসেবে হৈলে হোক হয় হয়ে হয়েছে হৈতে হইয়া হয়েছিল হয়েছেন হয়নি হয়েই হয়তো হওয়া হওয়ার হওয়ায়
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/bo/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Source: https://zenodo.org/records/10148636

STOP_WORDS = set(
"""
STOP_WORDS = set("""
འི་
།
དུ་
Expand Down Expand Up @@ -194,5 +193,4 @@
གིང་
ཚ་
ཀྱང
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/ca/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
STOP_WORDS = set(
"""
STOP_WORDS = set("""
a abans ací ah així això al aleshores algun alguna algunes alguns alhora allà allí allò
als altra altre altres amb ambdues ambdós anar ans apa aquell aquella aquelles aquells
aquest aquesta aquestes aquests aquí
Expand Down Expand Up @@ -48,5 +47,4 @@
va vaig vam van vas veu vosaltres vostra vostre vostres
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/cs/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Source: https://github.com/Alir3z4/stop-words
# Source: https://github.com/stopwords-iso/stopwords-cs/blob/master/stopwords-cs.txt

STOP_WORDS = set(
"""
STOP_WORDS = set("""
a
aby
ahoj
Expand Down Expand Up @@ -361,5 +360,4 @@
zatímco
ze
že
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/da/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Source: Handpicked by Jens Dahl Møllerhøj.

STOP_WORDS = set(
"""
STOP_WORDS = set("""
af aldrig alene alle allerede alligevel alt altid anden andet andre at
bag begge blandt blev blive bliver burde bør
Expand Down Expand Up @@ -41,5 +40,4 @@
var ved vi via vil ville vore vores vær være været
øvrigt
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/de/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
STOP_WORDS = set(
"""
STOP_WORDS = set("""
á a ab aber ach acht achte achten achter achtes ag alle allein allem allen
aller allerdings alles allgemeinen als also am an andere anderen anderem andern
anders auch auf aus ausser außer ausserdem außerdem
Expand Down Expand Up @@ -74,5 +73,4 @@
zehn zehnte zehnten zehnter zehntes zeit zu zuerst zugleich zum zunächst zur
zurück zusammen zwanzig zwar zwei zweite zweiten zweiter zweites zwischen
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/dsb/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
STOP_WORDS = set(
"""
STOP_WORDS = set("""
a abo aby ako ale až
daniž dokulaž
Expand All @@ -11,5 +10,4 @@
pak pótom
teke togodla
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/el/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Stop words
# Link to greek stop words: https://www.translatum.gr/forum/index.php?topic=3550.0?topic=3550.0
STOP_WORDS = set(
"""
STOP_WORDS = set("""
αδιάκοπα αι ακόμα ακόμη ακριβώς άλλα αλλά αλλαχού άλλες άλλη άλλην
άλλης αλλιώς αλλιώτικα άλλο άλλοι αλλοιώς αλλοιώτικα άλλον άλλος άλλοτε αλλού
άλλους άλλων άμα άμεσα αμέσως αν ανά ανάμεσα αναμεταξύ άνευ αντί αντίπερα αντίς
Expand Down Expand Up @@ -83,5 +82,4 @@
χωρίς χωριστά
ω ως ωσάν ωσότου ώσπου ώστε ωστόσο ωχ
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/en/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Stop words
STOP_WORDS = set(
"""
STOP_WORDS = set("""
a about above across after afterwards again against all almost alone along
already also although always am among amongst amount an and another any anyhow
anyone anything anyway anywhere are around as at
Expand Down Expand Up @@ -62,8 +61,7 @@
whither who whoever whole whom whose why will with within without would
yet you your yours yourself yourselves
""".split()
)
""".split())

contractions = ["n't", "'d", "'ll", "'m", "'re", "'s", "'ve"]
STOP_WORDS.update(contractions)
Expand Down
6 changes: 2 additions & 4 deletions spacy/lang/es/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
STOP_WORDS = set(
"""
STOP_WORDS = set("""
a acuerdo adelante ademas además afirmó agregó ahi ahora ahí al algo alguna
algunas alguno algunos algún alli allí alrededor ambos ante anterior antes
apenas aproximadamente aquel aquella aquellas aquello aquellos aqui aquél
Expand Down Expand Up @@ -76,5 +75,4 @@
vosotras vosotros voy vuestra vuestras vuestro vuestros
y ya yo
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/et/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Source: https://github.com/stopwords-iso/stopwords-et

STOP_WORDS = set(
"""
STOP_WORDS = set("""
aga
ei
et
Expand Down Expand Up @@ -37,5 +36,4 @@
ta
te
ära
""".split()
)
""".split())
6 changes: 2 additions & 4 deletions spacy/lang/eu/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Source: https://github.com/stopwords-iso/stopwords-eu
# https://www.ranks.nl/stopwords/basque
# https://www.mustgo.com/worldlanguages/basque/
STOP_WORDS = set(
"""
STOP_WORDS = set("""
al
anitz
arabera
Expand Down Expand Up @@ -101,5 +100,4 @@
zuek
zuen
zuten
""".split()
)
""".split())
12 changes: 4 additions & 8 deletions spacy/lang/fa/lex_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
YE_NUN = "ین"


_num_words = set(
"""
_num_words = set("""
صفر
یک
دو
Expand Down Expand Up @@ -63,15 +62,12 @@
کوادریلیون
کادریلیارد
کوینتیلیون
""".split()
)
""".split())

_ordinal_words = set(
"""
_ordinal_words = set("""
اول
سوم
سی‌ام""".split()
)
سی‌ام""".split())

_ordinal_words.update({num + MIM for num in _num_words})
_ordinal_words.update({num + ZWNJ_O_MIM for num in _num_words})
Expand Down
6 changes: 2 additions & 4 deletions spacy/lang/fa/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Stop words from HAZM package
STOP_WORDS = set(
"""
STOP_WORDS = set("""
و
در
به
Expand Down Expand Up @@ -389,5 +388,4 @@
لذا
زاده
گردد
اینجا""".split()
)
اینجا""".split())
6 changes: 2 additions & 4 deletions spacy/lang/fi/stop_words.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Source https://github.com/stopwords-iso/stopwords-fi/blob/master/stopwords-fi.txt
# Reformatted with some minor corrections
STOP_WORDS = set(
"""
STOP_WORDS = set("""
aiemmin aika aikaa aikaan aikaisemmin aikaisin aikana aikoina aikoo aikovat
aina ainakaan ainakin ainoa ainoat aiomme aion aiotte aivan ajan alas alemmas
alkuisin alkuun alla alle aloitamme aloitan aloitat aloitatte aloitattivat
Expand Down Expand Up @@ -106,5 +105,4 @@
ympäri
älköön älä
""".split()
)
""".split())
12 changes: 4 additions & 8 deletions spacy/lang/fr/lex_attrs.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
from ...attrs import LIKE_NUM

_num_words = set(
"""
_num_words = set("""
zero un une deux trois quatre cinq six sept huit neuf dix
onze douze treize quatorze quinze seize dix-sept dix-huit dix-neuf
vingt trente quarante cinquante soixante soixante-dix septante quatre-vingt huitante quatre-vingt-dix nonante
cent mille mil million milliard billion quadrillion quintillion
sextillion septillion octillion nonillion decillion
""".split()
)
""".split())

_ordinal_words = set(
"""
_ordinal_words = set("""
premier première deuxième second seconde troisième quatrième cinquième sixième septième huitième neuvième dixième
onzième douzième treizième quatorzième quinzième seizième dix-septième dix-huitième dix-neuvième
vingtième trentième quarantième cinquantième soixantième soixante-dixième septantième quatre-vingtième huitantième quatre-vingt-dixième nonantième
centième millième millionnième milliardième billionnième quadrillionnième quintillionnième
sextillionnième septillionnième octillionnième nonillionnième decillionnième
""".split()
)
""".split())


def like_num(text):
Expand Down
Loading