tacl.command package

Submodules

tacl.command.formatters module

class tacl.command.formatters.ParagraphFormatter(prog, indent_increment=2, max_help_position=24, width=None)[source]

Bases: argparse.ArgumentDefaultsHelpFormatter

argparse formatter to maintain paragraph breaks in text, while wrapping those blocks.

Code minimally adapted from the patch at http://bugs.python.org/file28091, authored by rurpy2.

tacl.command.utils module

Functions useful when writing command-line scripts that interact with tacl.

tacl.command.utils.add_common_arguments(parser)[source]

Adds common arguments for all parsers.

tacl.command.utils.add_corpus_arguments(parser)[source]

Adds common arguments for commands making use of a corpus to parser.

tacl.command.utils.add_db_arguments(parser, db_option=False)[source]

Adds common arguments for the database sub-commands to parser.

db_option provides a means to work around https://bugs.python.org/issue9338 whereby a positional argument that follows an optional argument with nargs=’+’ will not be recognised. When db_optional is True, create the database argument as a required optional argument, rather than a positional argument.

tacl.command.utils.add_query_arguments(parser)[source]

Adds common arguments for query sub-commonads to parser.

tacl.command.utils.add_supplied_query_arguments(parser)[source]

Adds common arguments for supplied query sub-commands to parser.

tacl.command.utils.add_tokenizer_argument(parser)[source]
tacl.command.utils.configure_logging(verbose, logger)[source]

Configures the logging used.

tacl.command.utils.get_catalogue(path)[source]

Returns a tacl.Catalogue.

tacl.command.utils.get_corpus(args)[source]

Returns a tacl.Corpus.

tacl.command.utils.get_data_store(args)[source]

Returns a tacl.DataStore.

tacl.command.utils.get_ngrams(path)[source]

Returns a list of n-grams read from the file at path.

tacl.command.utils.get_tokenizer(args)[source]

Module contents