def __init__(self): Frontend.__init__(self, stats=False, colour=True) self.description = "Attempt all tests with default settings." self.add_argument("-v", "--verbose", dest="verbose", action="store_true", help="Verbose test output") self.add_argument("-X", "--statistics", dest="stats", nargs='?', const='quality-stats.xml', default=None, help="XML file that statistics are to be stored in") self.add_argument("-o", "--html", dest="outdir", nargs='?', const='htmlout', default=None, help="Output directory for HTML content") self.add_argument("aqx", nargs=1, help="Apertium Quality XML configuration file") self.args = args = self.parse_args() AutoTest.__init__(self, self.args.stats, self.args.outdir, self.args.aqx[0], self.args.verbose)
def __init__(self): Frontend.__init__(self) self.description="Test for regressions directly from Apertium wiki." self.add_argument("-d", "--dict", dest="dictdir", nargs='?', const=['.'], default=['.'], help="Directory of dictionary (Default: current directory)") self.add_argument("mode", nargs=1, help="Mode of operation (eg. br-fr)") self.add_argument("wikiurl", nargs=1, help="URL to regression tests") self.args = self.parse_args() RegressionTest.__init__(self, self.args.wikiurl[0], self.args.mode[0], self.args.dictdir[0])
def __init__(self): Frontend.__init__(self) self.description = "Test coverage." self.add_argument("-H", "--hfst", dest="hfst", action="store_true", help="HFST mode") self.add_argument("corpus", nargs=1, help="Corpus text file") self.add_argument("dictionary", nargs=1, help="Binary dictionary (.bin, .fst, etc)") self.args = self.parse_args() CoverageTest.__init__(self, self.args.corpus[0], self.args.dictionary[0])
def __init__(self): Frontend.__init__(self) self.description = "Test generation." self.add_argument("-d", "--dict", dest="directory", nargs='?', const=['.'], default=['.'], help="Directory of dictionary (Default: current directory)") self.add_argument("mode", nargs=1, help="Language mode (eg, br-fr)") self.add_argument("corpus", nargs=1, help="Corpus text file") self.args = self.parse_args() GenerationTest.__init__(self, self.args.directory[0], self.args.mode[0], self.args.corpus[0])
def __init__(self): Frontend.__init__(self) self.description = "Get general dictionary statistics." self.add_argument("-d", "--dict", dest="dictdir", nargs='?', const=['.'], default=['.'], help="Directory of dictionary (Default: current directory)") # TODO add direction # TODO add trules option # should allow LR, RL and both at same time with multiple flags self.add_argument("langpair", nargs=1, help="Language pair (eg aa-ab)") self.args = self.parse_args() DictionaryTest.__init__(self, self.args.langpair[0], self.args.dictdir[0])
def __init__(self): Frontend.__init__(self, colour=True) self.description="""Test morphological transducers for consistency. `hfst-lookup` (or Xerox' `lookup` with argument -x) must be available on the PATH.""" self.epilog="Will run all tests in the test_file by default." self.add_argument("-C", "--compact", dest="compact", action="store_true", help="Makes output more compact") self.add_argument("-i", "--ignore-extra-analyses", dest="ignore_analyses", action="store_true", help="""Ignore extra analyses when there are more than expected, will PASS if the expected one is found.""") self.add_argument("-s", "--surface", dest="surface", action="store_true", help="Surface input/analysis tests only") self.add_argument("-l", "--lexical", dest="lexical", action="store_true", help="Lexical input/generation tests only") self.add_argument("-f", "--hide-fails", dest="hide_fail", action="store_true", help="Suppresses passes to make finding failures easier") self.add_argument("-p", "--hide-passes", dest="hide_pass", action="store_true", help="Suppresses failures to make finding passes easier") self.add_argument("-S", "--section", default=["hfst"], dest="section", nargs=1, required=False, help="The section to be used for testing (default is `hfst`)") self.add_argument("-t", "--test", dest="test", nargs=1, required=False, help="""Which test to run (Default: all). TEST = test ID, e.g. 'Noun - g\u00E5etie' (remember quotes if the ID contains spaces)""") self.add_argument("-v", "--verbose", dest="verbose", action="store_true", help="More verbose output.") self.add_argument("--app", dest="app", nargs=1, required=False, help="Override application used for test") self.add_argument("--gen", dest="gen", nargs=1, required=False, help="Override generation transducer used for test") self.add_argument("--morph", dest="morph", nargs=1, required=False, help="Override morph transducer used for test") self.add_argument("test_file", nargs=1, help="YAML file with test rules") self.args = dict(self.parse_args()._get_kwargs()) for k, v in self.args.copy().items(): if isinstance(v, list) and len(v) == 1: self.args[k] = v[0] MorphTest.__init__(self, **self.args)
def __init__(self): Frontend.__init__(self) self.description = "Test vocabulary for generation errors." self.add_argument( "-a", "--anadix", dest="anadix", nargs='?', const=None, default=None, help="Analysis .dix file (Default: apertium-aa-ab.aa-ab.dix)") self.add_argument( "-g", "--genbin", dest="genbin", nargs='?', const=None, default=None, help="Generation .bin file (Default: apertium-aa-ab.autogen.bin)") self.add_argument( "-d", "--dict", dest="dictdir", nargs='?', const='.', default='.', help="Directory of dictionary (Default: current directory)") self.add_argument("-D", "--direction", dest="direction", nargs='?', const='lr', default='lr', help="Dictionary direction (lr, rl)") self.add_argument( "-o", "--output", dest="output", nargs='?', const='voctest.txt', default='voctest.txt', help="Output file for arrows output (Default: voctest.txt)") self.add_argument("langpair", nargs=1, help="Language pair (eg, br-fr)") self.args = self.parse_args() lang1, lang2 = self.args.langpair[0].split('-') VocabularyTest.__init__(self, self.args.direction, lang1, lang2, self.args.output, self.args.dictdir, self.args.anadix, self.args.genbin)
def __init__(self): Frontend.__init__(self, stats=False, colour=True) self.description="Attempt all tests with default settings." self.add_argument("-v", "--verbose", dest="verbose", action="store_true", help="Verbose test output") self.add_argument("-X", "--statistics", dest="stats", nargs='?', const='quality-stats.xml', default=None, help="XML file that statistics are to be stored in") self.add_argument("-o", "--html", dest="outdir", nargs='?', const='htmlout', default=None, help="Output directory for HTML content") self.add_argument("aqx", nargs=1, help="Apertium Quality XML configuration file") self.args = args = self.parse_args() AutoTest.__init__(self, self.args.stats, self.args.outdir, self.args.aqx[0], self.args.verbose)
def __init__(self): Frontend.__init__(self) self.description = "Test for regressions directly from Apertium wiki." self.add_argument( "-d", "--dict", dest="dictdir", nargs='?', const=['.'], default=['.'], help="Directory of dictionary (Default: current directory)") self.add_argument("mode", nargs=1, help="Mode of operation (eg. br-fr)") self.add_argument("wikiurl", nargs=1, help="URL to regression tests") self.args = self.parse_args() RegressionTest.__init__(self, self.args.wikiurl[0], self.args.mode[0], self.args.dictdir[0])
def __init__(self): Frontend.__init__(self) self.description = "Get general dictionary statistics." self.add_argument( "-d", "--dict", dest="dictdir", nargs='?', const=['.'], default=['.'], help="Directory of dictionary (Default: current directory)") # TODO add direction # TODO add trules option # should allow LR, RL and both at same time with multiple flags self.add_argument("langpair", nargs=1, help="Language pair (eg aa-ab)") self.args = self.parse_args() DictionaryTest.__init__(self, self.args.langpair[0], self.args.dictdir[0])
def __init__(self): Frontend.__init__(self) self.description = "Test vocabulary for generation errors." self.add_argument("-a", "--anadix", dest="anadix", nargs='?', const=None, default=None, help="Analysis .dix file (Default: apertium-aa-ab.aa-ab.dix)") self.add_argument("-g", "--genbin", dest="genbin", nargs='?', const=None, default=None, help="Generation .bin file (Default: apertium-aa-ab.autogen.bin)") self.add_argument("-d", "--dict", dest="dictdir", nargs='?', const='.', default='.', help="Directory of dictionary (Default: current directory)") self.add_argument("-D", "--direction", dest="direction", nargs='?', const='lr', default='lr', help="Dictionary direction (lr, rl)") self.add_argument("-o", "--output", dest="output", nargs='?', const='voctest.txt', default='voctest.txt', help="Output file for arrows output (Default: voctest.txt)") self.add_argument("langpair", nargs=1, help="Language pair (eg, br-fr)") self.args = self.parse_args() lang1, lang2 = self.args.langpair[0].split('-') VocabularyTest.__init__(self, self.args.direction, lang1, lang2, self.args.output, self.args.dictdir, self.args.anadix, self.args.genbin)
def __init__(self): Frontend.__init__(self) self.description="Get average ambiguity." self.add_argument("dictionary", nargs=1, help="DIX file") self.args = self.parse_args() AmbiguityTest.__init__(self, self.args.dictionary[0])
def __init__(self): Frontend.__init__(self, colour=True) self.description = """Test morphological transducers for consistency. `hfst-lookup` (or Xerox' `lookup` with argument -x) must be available on the PATH.""" self.epilog = "Will run all tests in the test_file by default." self.add_argument("-C", "--compact", dest="compact", action="store_true", help="Makes output more compact") self.add_argument( "-i", "--ignore-extra-analyses", dest="ignore_analyses", action="store_true", help="""Ignore extra analyses when there are more than expected, will PASS if the expected one is found.""") self.add_argument("-s", "--surface", dest="surface", action="store_true", help="Surface input/analysis tests only") self.add_argument("-l", "--lexical", dest="lexical", action="store_true", help="Lexical input/generation tests only") self.add_argument( "-f", "--hide-fails", dest="hide_fail", action="store_true", help="Suppresses failures to make finding passes easier") self.add_argument( "-p", "--hide-passes", dest="hide_pass", action="store_true", help="Suppresses passes to make finding failures easier") self.add_argument( "-S", "--section", default=["hfst"], dest="section", nargs=1, required=False, help="The section to be used for testing (default is `hfst`)") self.add_argument( "-t", "--test", dest="test", nargs=1, required=False, help="""Which test to run (Default: all). TEST = test ID, e.g. 'Noun - g\u00E5etie' (remember quotes if the ID contains spaces)""") self.add_argument("-v", "--verbose", dest="verbose", action="store_true", help="More verbose output.") self.add_argument("--app", dest="app", nargs=1, required=False, help="Override application used for test") self.add_argument("--gen", dest="gen", nargs=1, required=False, help="Override generation transducer used for test") self.add_argument("--morph", dest="morph", nargs=1, required=False, help="Override morph transducer used for test") self.add_argument("test_file", nargs=1, help="YAML file with test rules") self.args = dict(self.parse_args()._get_kwargs()) for k, v in self.args.copy().items(): if isinstance(v, list) and len(v) == 1: self.args[k] = v[0] MorphTest.__init__(self, **self.args)
def __init__(self): Frontend.__init__(self) self.description = "Get average ambiguity." self.add_argument("dictionary", nargs=1, help="DIX file") self.args = self.parse_args() AmbiguityTest.__init__(self, self.args.dictionary[0])