Skip to content

Commit

Permalink
Always add the language itself to the list of similar languages (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-c authored Jan 9, 2024
1 parent 70d832a commit 43d9f0e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 49 deletions.
96 changes: 48 additions & 48 deletions src/fastspell/config/similar.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
#Target langs (keys) dict for mistakeable languages (values)
similar:
af: [nl, de, af]
az: [tr, az]
be: [ru, uk, be]
bg: [mk, ru, bg]
bs: [hr, sr_lat, sl, bs] #should add me (not adding because dict is the same as sr)
ca: [es, oc, ca]
cs: [sk, cs]
cy: [ga, en, cy]
da: [nb, sv, da]
es: [gl, ca, es]
fa: [ar, az, fa]
ga: [cy, en, ga]
gl: [es, pt, gl]
hbs_lat: [sl, hbs_lat]
hbs_cyr: [ru, mk, bg, hbs_cyr]
hi: [mr, ne, hi] #add SD
hr: [bs, sr_lat, sl, hr] #should add me (not adding because dict is the same as sr)
id: [ms, id]
is: [da, nb, nn, sv, is]
iw: [yi, iw]
kk: [ky, tt, ru, kk]
ky: [ru, kk, tt, mn, ky]
lv: [lt, lv]
me_lat: [hr, sl, me_lat]
me_cyr: [bg, mk, ru, me_cyr] #
mk: [bg, sr_cyr, ru, mk]
mn: [ru, ky, bg, mn]
mr: [hi, mr]
ms: [id, ms]
nb: [da, sv, nn, nb]
ne: [mr, hi, ne]
nl: [af, nl]
nn: [nb, da, sv, nn]
"no": [da, sv, nn, "no"] #same as NB, since dict is the same
#ps: [ar, fa, ps]
pt: [es, gl, pt]
ru: [uk, bg, ru]
sk: [cs, pl, sk]
sl: [sr_lat, hr, bs, sl]
so: [en, fi, cy, kn, so]
sr_cyr: [mk, bg, ru, sr_cyr] #should add me (not adding because dict is the same as sr)
sr_lat: [bs, hr, sl, sr_lat]
sv: [da, nb,sv]
tt: [kk, ky, ru, tt] #maybe add BA
uk: [be, ru, uk, mk, bg]
ur: [fa, ar, ur]
uz: [tr, uz]
yi: [he, yi]
af: [nl, de]
az: [tr]
be: [ru, uk]
bg: [mk, ru]
bs: [hr, sr_lat, sl] #should add me (not adding because dict is the same as sr)
ca: [es, oc]
cs: [sk]
cy: [ga, en]
da: [nb, sv]
es: [gl, ca]
fa: [ar, az]
ga: [cy, en]
gl: [es, pt]
hbs_lat: [sl]
hbs_cyr: [ru, mk, bg]
hi: [mr, ne] #add SD
hr: [bs, sr_lat, sl] #should add me (not adding because dict is the same as sr)
id: [ms]
is: [da, nb, nn, sv]
iw: [yi]
kk: [ky, tt, ru]
ky: [ru, kk, tt, mn]
lv: [lt]
me_lat: [hr, sl]
me_cyr: [bg, mk, ru] #
mk: [bg, sr_cyr, ru]
mn: [ru, ky, bg]
mr: [hi]
ms: [id]
nb: [da, sv, nn]
ne: [mr, hi]
nl: [af]
nn: [nb, da, sv]
"no": [da, sv, nn] #same as NB, since dict is the same
#ps: [ar, fa]
pt: [es, gl]
ru: [uk, bg]
sk: [cs, pl]
sl: [sr_lat, hr, bs]
so: [en, fi, cy, kn]
sr_cyr: [mk, bg, ru] #should add me (not adding because dict is the same as sr)
sr_lat: [bs, hr, sl]
sv: [da, nb]
tt: [kk, ky, ru] #maybe add BA
uk: [be, ru, mk, bg]
ur: [fa, ar]
uz: [tr]
yi: [he]
2 changes: 1 addition & 1 deletion src/fastspell/fastspell.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def load_hunspell_dicts(self):
self.similar = []
for sim_entry in self.similar_langs:
if sim_entry.split('_')[0] == self.lang:
self.similar.append(self.similar_langs[sim_entry])
self.similar.append(self.similar_langs[sim_entry] + [self.lang])

logging.debug(f"Similar lists for '{self.lang}': {self.similar}")
self.hunspell_objs = {}
Expand Down

0 comments on commit 43d9f0e

Please sign in to comment.