Esempio n. 1
0
    def test_xps_gop_can_not_be_enabled_together(self):
        """ Tests Spacy's Grammar Operators and Extended Patter Syntax can not be enabled both """
        config = Config()
        config.use_grammar_operators = True
        config.use_extended_pattern_syntax = True
        super().assertNotEqual(config.use_grammar_operators,
                               config.use_extended_pattern_syntax)

        config.use_grammar_operators = False
        config.use_extended_pattern_syntax = True
        super().assertEqual(True, config.use_extended_pattern_syntax)

        config.use_grammar_operators = True
        super().assertEqual(False, config.use_extended_pattern_syntax)
Esempio n. 2
0
    def test_setting_config_attribute_with_wrong_type_has_no_effect(self):
        config = Config()

        config.max_runs = 0.5
        config.use_extended_pattern_syntax = None
        config.fitness_function_type = RecombinationType.RANDOM_ONE_POINT_CROSSOVER
        config.report_path = 0

        super().assertNotEqual(config.max_runs, 0.5)
        super().assertNotEqual(config.use_extended_pattern_syntax, None)
        super().assertNotEqual(config.fitness_function_type,
                               RecombinationType.RANDOM_ONE_POINT_CROSSOVER)
        super().assertNotEqual(config.report_path, 0)