How to use the pylanguagetool.converters.supported_extensions function in pyLanguagetool

To help you get started, we’ve selected a few pyLanguagetool examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Findus23 / pyLanguagetool / pylanguagetool / __init__.py View on Github external
def init_config():
    p = configargparse.ArgParser(default_config_files=["~/.config/pyLanguagetool.conf"],
                                 config_file_parser_class=CustomConfigFileParser.CustomConfigFileParser)
    p.add_argument("-V", "--version", default=False, action='store_true')
    p.add_argument("-v", "--verbose", env_var="VERBOSE", default=False, action='store_true')
    p.add_argument("-a", "--api-url", env_var="API_URL", default="https://languagetool.org/api/v2/",
                   help="the URL of the v2 languagetool API, should end with '/v2/'")
    p.add_argument("--no-color", env_var="NO_COLOR", action='store_true', default=False, help="don't color output")
    p.add_argument("-c", "--clipboard", env_var="CLIPBOARD", action='store_true', default=False,
                   help="get text from system clipboard")
    p.add_argument("-s", "--single-line", env_var="SINGLE_LINE", action='store_true', default=False,
                   help="check every line on its own")
    p.add_argument("-t", "--input-type", env_var="INPUT_TYPE",
                   choices=converters.supported_extensions,
                   help="if not plaintext")
    p.add_argument("-u", "--explain-rule", env_var="EXPLAIN_RULE", action="store_true", default=False,
                   help="print URLs with more information about rules")
    p.add_argument('input file', help='input file', nargs='?')
    p.add_argument("-r", "--rules", env_var="RULES", action='store_true', default=False,
                   help="show the matching rules")
    p.add_argument("--rule-categories", env_var="RULE_CATEGORIES", action='store_true', default=False,
                   help="show the the categories of the matching rules")
    p.add_argument('-l', '--lang', env_var='TEXTLANG', default="auto",
                   help="A language code like en or en-US, or auto to guess the language automatically (see preferredVariants below). For languages with variants (English, German, Portuguese) spell checking will only be activated when you specify the variant, e.g. en-GB instead of just en."
                   )
    p.add_argument("-m", "--mother-tongue", env_var="MOTHER__TONGUE",
                   help="A language code of the user's native language, enabling false friends checks for some language pairs."
                   )
    p.add_argument("-p", "--preferred-variants", env_var="PREFERRED_VARIANTS",
                   help="Comma-separated list of preferred language variants. The language detector used with language=auto can detect e.g. English, but it cannot decide whether British English or American English is used. Thus this parameter can be used to specify the preferred variants like en-GB and de-AT. Only available with language=auto."