Exemplo n.º 1
0
 def setUp(self):
     self.the_cat = examples_dmrs.the_cat().convert_to(
         abstractSortDictDmrs(node_key=span_pred_key))
     # Checks if the matching code converts to SortDictDmrs with span_pred_key
     self.the_cat_chases_the_dog = examples_dmrs.the_cat_chases_the_dog().convert_to(
         abstractSortDictDmrs(node_key=span_pred_key))
     self.the_dog_chases_the_cat = examples_dmrs.the_dog_chases_the_cat().convert_to(
         abstractSortDictDmrs(node_key=span_pred_key))
Exemplo n.º 2
0
 def setUp(self):
     self.the_cat = examples_dmrs.the_cat().convert_to(
         abstractSortDictDmrs(node_key=span_pred_key))
     # Checks if the matching code converts to SortDictDmrs with span_pred_key
     self.the_cat_chases_the_dog = examples_dmrs.the_cat_chases_the_dog(
     ).convert_to(abstractSortDictDmrs(node_key=span_pred_key))
     self.the_dog_chases_the_cat = examples_dmrs.the_dog_chases_the_cat(
     ).convert_to(abstractSortDictDmrs(node_key=span_pred_key))
     self.the_mouse = examples_dmrs.the_mouse() \
         .convert_to(abstractSortDictDmrs(node_key=span_pred_key))
     self.dog_cat = examples_dmrs.dog_cat() \
         .convert_to(abstractSortDictDmrs(node_key=span_pred_key))
Exemplo n.º 3
0
 def setUp(self):
     self.large_dmrs = examples_dmrs.the_dog_chases_the_cat_and_the_cat_chases_the_mouse(
     )
     self.small_dmrs = examples_dmrs.the_dog_chases_the_cat()
     self.cat_dmrs = examples_dmrs.the_cat()
     self.reverse_dmrs = examples_dmrs.the_cat_chases_the_dog()
Exemplo n.º 4
0
 def setUp(self):
     self.large_dmrs = examples_dmrs.the_dog_chases_the_cat_and_the_cat_chases_the_mouse()
     self.small_dmrs = examples_dmrs.the_dog_chases_the_cat()
     self.cat_dmrs = examples_dmrs.the_cat()
     self.reverse_dmrs = examples_dmrs.the_cat_chases_the_dog()
Exemplo n.º 5
0
if __name__ == '__main__':

    # "the" - "the dog chases the cat"
    assert len(list(dmrs_exact_matching(examples.the(), examples.the_dog_chases_the_cat()))) == 2

    # "the cat" - "the dog chases the cat"
    assert len(list(dmrs_exact_matching(examples.the_cat(), examples.the_dog_chases_the_cat()))) == 1

    # "dog cat" - "the dog chases the cat"
    assert len(list(dmrs_exact_matching(examples.dog_cat(), examples.the_dog_chases_the_cat()))) == 1

    # "the dog chases the cat" - "the dog chases the cat"
    assert len(list(dmrs_exact_matching(examples.the_dog_chases_the_cat(), examples.the_dog_chases_the_cat()))) == 1

    # "the cat chases the dog" - "the dog chases the cat"
    assert not len(list(dmrs_exact_matching(examples.the_cat_chases_the_dog(), examples.the_dog_chases_the_cat())))

    # "the dog chases the cat" - "the dog chases the cat and the mouse"
    assert not len(list(dmrs_exact_matching(examples.the_dog_chases_the_cat(), examples.the_dog_chases_the_cat_and_the_mouse())))

    # "the dog chases the cat" - "the dog chases the cat and the cat chases the mouse"
    assert len(list(dmrs_exact_matching(examples.the_dog_chases_the_cat(), examples.the_dog_chases_the_cat_and_the_cat_chases_the_mouse()))) == 1

    # "the cat" - "the dog chases the cat and the cat chases the mouse"
    assert len(list(dmrs_exact_matching(examples.the_cat(), examples.the_dog_chases_the_cat_and_the_cat_chases_the_mouse()))) == 2

    # "dog cat" - "the dog chases the cat and the cat chases the mouse"
    assert len(list(dmrs_exact_matching(examples.dog_cat(), examples.the_dog_chases_the_cat_and_the_cat_chases_the_mouse()))) == 2

    # predsort - "the dog chases the cat"
    assert len(list(dmrs_exact_matching(examples.predsort(), examples.the_dog_chases_the_cat()))) == 5
Exemplo n.º 6
0
    # "dog cat" - "the dog chases the cat"
    assert len(
        list(
            dmrs_exact_matching(examples.dog_cat(),
                                examples.the_dog_chases_the_cat()))) == 1

    # "the dog chases the cat" - "the dog chases the cat"
    assert len(
        list(
            dmrs_exact_matching(examples.the_dog_chases_the_cat(),
                                examples.the_dog_chases_the_cat()))) == 1

    # "the cat chases the dog" - "the dog chases the cat"
    assert not len(
        list(
            dmrs_exact_matching(examples.the_cat_chases_the_dog(),
                                examples.the_dog_chases_the_cat())))

    # "the dog chases the cat" - "the dog chases the cat and the mouse"
    assert not len(
        list(
            dmrs_exact_matching(
                examples.the_dog_chases_the_cat(),
                examples.the_dog_chases_the_cat_and_the_mouse())))

    # "the dog chases the cat" - "the dog chases the cat and the cat chases the mouse"
    assert len(
        list(
            dmrs_exact_matching(
                examples.the_dog_chases_the_cat(),
                examples.the_dog_chases_the_cat_and_the_cat_chases_the_mouse())