We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
im using argos-translate-html like in the example code
import argostranslate.package, argostranslate.translate import translatehtml from_code = "de" to_code = "en" with open("input.html", "r") as f: html_doc = f.read() # Translate installed_languages = argostranslate.translate.get_installed_languages() from_lang = list(filter(lambda x: x.code == from_code, installed_languages))[0] to_lang = list(filter(lambda x: x.code == to_code, installed_languages))[0] translation = from_lang.get_translation(to_lang) # this produces the warnings translated_soup = translatehtml.translate_html(translation, html_doc) print(translated_soup)
running the code floods my terminal with
WARNING: Language de package default expects mwt, which has been added
how can i add mwt to avoid these warnings?
mwt
the warnings are produced by stanza
logger = logging.getLogger('stanza') logger.warning("Language %s package %s expects mwt, which has been added", lang, value)
quickfix:
#!/usr/bin/env python3 import sys # https://github.com/argosopentech/argos-translate import argostranslate.translate # hide warnings: "Language %s package %s expects mwt, which has been added" import logging #logging.getLogger("stanza").setLevel(logging.ERROR) # no effect logging.getLogger("stanza").disabled = True input_text = sys.stdin.read() from_code = sys.argv[1] to_code = sys.argv[2] translated_text = argostranslate.translate.translate(input_text, from_code, to_code) sys.stdout.write(translated_text)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
im using argos-translate-html like in the example code
running the code floods my terminal with
how can i add
mwt
to avoid these warnings?the warnings are produced by stanza
quickfix:
The text was updated successfully, but these errors were encountered: