def config_argparser(psr): """ Subcommand flags. You should create and pass in the subparser to which the flags are to be added. """ # note: not the usual input args psr.add_argument('corpus', metavar='DIR', help='corpus dir') psr.add_argument('--output', metavar='DIR', required=True, help='output dir') psr.add_argument('--no-draw', action='store_false', dest='draw', default=True, help='Do not actually draw the graph') psr.add_argument('--strip-cdus', action='store_true', help='Strip away CDUs (substitute w heads)') educe_group = psr.add_argument_group('corpus filtering arguments') add_corpus_filters(educe_group, fields=fields_without(["stage"])) psr.set_defaults(func=main)
def config_argparser(parser): """ Subcommand flags. You should create and pass in the subparser to which the flags are to be added. """ # note: not the usual input args parser.add_argument('corpus', metavar='DIR', help='corpus dir') parser.add_argument('rel_types', metavar='REL_LABEL', nargs='+', help='relation labels to keep') parser.add_argument('--output', metavar='DIR', required=True, help='output dir') parser.add_argument('--no-draw', action='store_false', dest='draw', default=True, help='Do not actually draw the graph') educe_group = parser.add_argument_group('corpus filtering arguments') # doesn't make sense to filter on stage for graphs add_corpus_filters(educe_group, fields=fields_without(["stage"])) parser.set_defaults(func=main)
def config_argparser(parser): """ Subcommand flags. You should create and pass in the subparser to which the flags are to be added. """ # note: not the usual input args parser.add_argument('corpus', metavar='DIR', help='corpus dir') parser.add_argument('--output', metavar='DIR', required=True, help='output dir') parser.add_argument('--no-draw', action='store_false', dest='draw', default=True, help='Do not actually draw the graph') parser.add_argument('--highlight', nargs='+', metavar='ANNO_ID', type=anno_id, help='Highlight these annotations') parser.add_argument('--live', action='store_true', help='Input is a flat collection of aa/ac files)') # TODO: would be nice to enforce these groups of args mutually excluding # but not sure if the library actually supports it psr_rel = parser.add_argument_group("relation graphs") psr_rel.add_argument('--split', action='store_true', help='Separate file for each connected component') psr_rel.add_argument('--strip-cdus', action='store_true', help='Strip away CDUs') psr_rel.add_argument('--strip-mode', choices=['head', 'broadcast', 'custom'], default='head', help='CDUs stripping method') psr_rfc = parser.add_argument_group("RFC graphs") psr_rfc.add_argument('--rfc', choices=['basic', 'mlast'], help='Highlight RFC frontier and violations') psr_enc = parser.add_argument_group("enclosure graphs") psr_enc.add_argument('--enclosure', action='store_true', help='Generate enclosure graphs') psr_enc.add_argument('--tokens', action='store_true', help='Include pos-tagged tokens') educe_group = parser.add_argument_group('corpus filtering arguments') add_corpus_filters(educe_group, fields=fields_without(["stage"])) parser.set_defaults(func=main)
def config_argparser(parser): """ Subcommand flags. You should create and pass in the subparser to which the flags are to be added. """ parser.add_argument('corpus', metavar='DIR', nargs='?', help='corpus dir') add_corpus_filters(parser, fields=fields_without(["stage"])) add_usual_output_args(parser, default_overwrite=True) parser.set_defaults(func=main)
def config_argparser(parser): """ Subcommand flags. """ parser.add_argument('corpus', metavar='DIR', help='Corpus dir (eg. data/pilot)') parser.add_argument('resources', metavar='DIR', help='Resource dir (eg. data/resource)') parser.add_argument('--output', metavar='FILE', help='Output file') # add flags --doc, --subdoc, etc to allow user to filter on these things add_corpus_filters(parser, fields=fields_without(["stage"])) parser.set_defaults(func=main)
def config_argparser(parser): """ Subcommand flags. You should create and pass in the subparser to which the flags are to be added. """ parser.add_argument('corpus', metavar='DIR', nargs='?', help='corpus dir') parser.add_argument('--strip-cdus', action='store_true', help='remove CDUs from graphs') parser.add_argument('--mode', choices=['violations', 'power'], default='violations', help='count RFC violations or filtering power') add_corpus_filters(parser, fields=fields_without(["stage"])) add_usual_output_args(parser) parser.set_defaults(func=main)