Skip to content

Commit

Permalink
Merge pull request #247 from TranslatorSRI/fix-unii_labels_and_synonyms
Browse files Browse the repository at this point in the history
Line 62637 of the January 27, 2024 release reads:
> Alcolec Granules†	bn	1DI56QDM62	LECITHIN, SOYBEAN

This is encoded in Latin-1, not UTF-8, so we need to modify how we read this file.
  • Loading branch information
gaurav authored Apr 26, 2024
2 parents 1db19eb + 4d292e2 commit f556c68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datahandlers/unii.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def make_labels_and_synonyms(inputfile,labelfile,synfile):
syncol = 0
wrotelabels = set()
wrotesyns = set()
with open(inputfile,'r') as inf, open(labelfile,'w') as lf, open(synfile,'w') as sf:
with open(inputfile,'r', encoding='latin-1') as inf, open(labelfile,'w') as lf, open(synfile,'w') as sf:
h = inf.readline()
for line in inf:
parts = line.strip().split('\t')
Expand Down

0 comments on commit f556c68

Please sign in to comment.