示例#1
0
 def test_child_1(self):
     """Test Case: padre(esp) is child of abuelo(esp)? -> Yes"""
     thread = "esp_derived_esp.cl"
     model_test = Model()
     model_test.set_cl_file(thread)
     model_test.parse_file()
     model_test.load(Dummy())
     relations = {
         'derived': True,
         'etymologically': False,
         'etymology': False,
         'etymologically_related': False,
         'has_derived_form': False,
         'etymological_origin_of': False,
         'is_derived_from': False,
         'variant': False
     }
     result = g08_logic_w_w.child(
         "padre",
         "esp",
         "abuelo",
         "esp",
         Dummy(),
         model_test.get_logic(),  # data
         relations)
     expected_result = True
     assert result == expected_result
示例#2
0
 def test_common_1(self):
     """Test Case: common eng-spa -> No"""
     model_test = Model()
     data_pool = [
         '+ etymological_origin_of(" taco",fin," burrito",fin)',
         '+ etymological_origin_of(" taco",eng," burrito",eng)',
         '+ etymological_origin_of(" taco",deu," burrito",deu)'
     ]
     model_test.append_data(data_pool)
     model_test.load(Dummy())
     relations = {
         'derived': False,
         'etymologically': False,
         'etymology': False,
         'etymologically_related': False,
         'has_derived_form': False,
         'etymological_origin_of': True,
         'is_derived_from': False,
         'variant': False
     }
     result = g08_logic_i_i.common(
         "-",
         "-",
         "eng",
         "fin",
         Dummy(),
         model_test.get_logic(),  # data
         relations)
     expected_result = True
     assert result == expected_result
示例#3
0
 def test_cousin_level_2(self):
     """Test Case: yo(esp) cousin level of tio(esp)? -> Not cousins"""
     thread = "esp_derived_esp.cl"
     model_test = Model()
     model_test.set_cl_file(thread)
     model_test.parse_file()
     model_test.load(Dummy())
     relations = {
         'derived': True,
         'etymologically': False,
         'etymology': False,
         'etymologically_related': False,
         'has_derived_form': False,
         'etymological_origin_of': False,
         'is_derived_from': False,
         'variant': False
     }
     result = g08_logic_w_w.cousin_level(
         "yo",
         "esp",
         "tio",
         "esp",
         Dummy(),
         model_test.get_logic(),  # data
         relations)
     expected_result = False
     assert result == expected_result
示例#4
0
 def test_cousin_level_3(self):
     """Test Case: hijo cousin level of primo? -> 1"""
     model_test = Model()
     data_pool = [
         '+ etymological_origin_of(" abuelo",spa," padre",spa)',
         '+ etymological_origin_of(" abuelo",spa," tio",spa)',
         '+ etymological_origin_of(" padre",spa," hijo",spa)',
         '+ etymological_origin_of(" tio",spa," primo",spa)'
     ]
     model_test.append_data(data_pool)
     model_test.load(Dummy())
     relations = {
         'derived': False,
         'etymologically': False,
         'etymology': False,
         'etymologically_related': False,
         'has_derived_form': False,
         'etymological_origin_of': True,
         'is_derived_from': False,
         'variant': False
     }
     result = g08_logic_w_w.cousin_level(
         "hijo",
         "spa",
         "primo",
         "spa",
         Dummy(),
         model_test.get_logic(),  # data
         relations)
     expected_result = True
     assert result == expected_result
示例#5
0
 def test_uncle_3(self):
     """Test Case: "tio" is uncle of "sobrino"? -> Yes"""
     model_test = Model()
     data_pool = [
         '+ etymological_origin_of(" abuelo",spa," padre",spa)',
         '+ etymological_origin_of(" abuelo",spa," tio",spa)',
         '+ etymological_origin_of(" padre",spa," sobrino",spa)'
     ]
     model_test.append_data(data_pool)
     model_test.load(Dummy())
     relations = {
         'derived': False,
         'etymologically': False,
         'etymology': False,
         'etymologically_related': False,
         'has_derived_form': False,
         'etymological_origin_of': True,
         'is_derived_from': False,
         'variant': False
     }
     result = g08_logic_w_w.uncle(
         "tio",
         "spa",
         "sobrino",
         "spa",
         Dummy(),
         model_test.get_logic(),  # data
         relations)
     expected_result = True
     assert result == expected_result
示例#6
0
 def test_uncle_1(self):
     """Test Case: tio(esp) is uncle of primo(esp)? -> No"""
     thread = "esp_derived_esp.cl"
     model_test = Model()
     model_test.set_cl_file(thread)
     model_test.parse_file()
     model_test.load(Dummy())
     relations = {
         'derived': True,
         'etymologically': False,
         'etymology': False,
         'etymologically_related': False,
         'has_derived_form': False,
         'etymological_origin_of': False,
         'is_derived_from': False,
         'variant': False
     }
     result = g08_logic_w_w.uncle(
         "tio",
         "esp",
         "primo",
         "esp",
         Dummy(),
         model_test.get_logic(),  # data
         relations)
     expected_result = False
     assert result == expected_result
示例#7
0
 def test_originated_1(self):
     """Test Case: words in spa originated from primo(rus)? -> Yes"""
     model_test = Model()
     data_pool = [
         '+ etymological_origin_of(" tio",rus," primo",rus)',
         '+ etymological_origin_of(" primo",rus," primos",spa)']
     model_test.append_data(data_pool)
     model_test.load(Dummy())
     relations = {
         'derived': False,
         'etymologically': False,
         'etymology': False,
         'etymologically_related': False,
         'has_derived_form': False,
         'etymological_origin_of': True,
         'is_derived_from': False,
         'variant': False}
     result = g08_logic_i_w.originated(
         "-",
         "spa",
         "primo",
         "rus    ",
         Dummy(),
         model_test.get_logic(),  # data
         relations)
     expected_result = True
     assert result == expected_result
示例#8
0
 def test_related_2(self):
     """Test Case: spa is related to primo? -> No"""
     model_test = Model()
     data_pool = [
         '+ etymological_origin_of(" abuelo",spa," padre",spa)',
         '+ etymological_origin_of(" abuelo",spa," tio",spa)',
         '+ etymological_origin_of(" padre",spa," hijo",spa)',
         '+ etymological_origin_of(" tio",rus," primo",rus)']
     model_test.append_data(data_pool)
     model_test.load(Dummy())
     relations = {
         'derived': False,
         'etymologically': False,
         'etymology': False,
         'etymologically_related': False,
         'has_derived_form': False,
         'etymological_origin_of': True,
         'is_derived_from': False,
         'variant': False}
     result = g08_logic_i_w.related(
         "-",
         "spa",
         "primo",
         "rus",
         Dummy(),
         model_test.get_logic(),  # data
         relations)
     expected_result = False
     assert result == expected_result
示例#9
0
 def test_listing_2(self):
     """Test Case: idioms related to tio(spa)? -> No"""
     model_test = Model()
     data_pool = [
         '+ etymological_origin_of(" tio",spa," primo",rus)',
         '+ etymological_origin_of(" trio",afr," tia",spa)']
     model_test.append_data(data_pool)
     model_test.load(Dummy())
     relations = {
         'derived': False,
         'etymologically': False,
         'etymology': False,
         'etymologically_related': False,
         'has_derived_form': False,
         'etymological_origin_of': True,
         'is_derived_from': False,
         'variant': False}
     result = g08_logic_i_w.listing(
         "-",
         "-",
         "tia",
         "rus",
         Dummy(),
         model_test.get_logic(),  # data
         relations)
     expected_result = False
     assert result == expected_result