api.wikibrain-core.0.7.2.source-code.make_lang_constants.py Maven / Gradle / Ivy
#!/usr/bin/python -O
import codecs
for line in codecs.open('languages.tsv', 'r', encoding='utf-8'):
(id, langCode) = line.split('\t')[:2]
if id != 'id': # skip header
v = langCode.upper().replace('-', '_')
print(' public static final Language %s = Language.getByLangCode("%s");' % (v, langCode))
© 2015 - 2025 Weber Informatics LLC | Privacy Policy