Example #1
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()
    # "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

    # noun - "the dog chases the cat"
    assert len(list(dmrs_exact_matching(examples.noun(), examples.the_dog_chases_the_cat()))) == 2
Example #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()
Example #4
0
            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(),