All Downloads are FREE. Search and download functionalities are using the official Maven repository.

api.wikibrain-core.0.7.2.source-code.make_lang_constants.py Maven / Gradle / Ivy

There is a newer version: 0.9.1
Show newest version
#!/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