Esempio n. 1
0
 def test_generic_terms_equal(self):
     generic = Statement(predicate="something happened", generic=True)
     generic_false = Statement(predicate=Predicate(
         content="something happened", truth=False),
                               generic=True)
     assert generic.means(generic_false)
     assert generic_false.means(generic)
Esempio n. 2
0
 def test_means_despite_plural(self):
     directory = Entity(name="Rural's telephone directory", plural=False)
     listings = Entity(name="Rural's telephone listings", plural=True)
     directory_original = Statement(
         predicate=Predicate(content="$thing was original"),
         terms=directory)
     listings_original = Statement(
         predicate=Predicate(content="$thing were original"),
         terms=listings)
     assert directory_original.means(listings_original)
Esempio n. 3
0
 def test_unequal_because_one_factor_is_absent(self, make_predicate):
     left = Statement(
         predicate=make_predicate["shooting"],
         terms=[Entity(name="Al"), Entity(name="Bo")],
     )
     right = Statement(
         predicate=make_predicate["shooting"],
         terms=[Entity(name="Al"), Entity(name="Bob")],
         absent=True,
     )
     assert not left.means(right)
Esempio n. 4
0
    def test_interchangeable_concrete_terms(self):
        """Detect that placeholders differing only by a final digit are interchangeable."""
        ann = Entity(name="Ann", generic=False)
        bob = Entity(name="Bob", generic=False)

        ann_and_bob_were_family = Statement(
            predicate=Predicate(
                content=
                "$relative1 and $relative2 both were members of the same family"
            ),
            terms=(ann, bob),
        )
        bob_and_ann_were_family = Statement(
            predicate=Predicate(
                content=
                "$relative1 and $relative2 both were members of the same family"
            ),
            terms=(bob, ann),
        )

        assert ann_and_bob_were_family.means(bob_and_ann_were_family)
Esempio n. 5
0
 def test_generic_and_specific_factors_unequal(self):
     generic = Statement(predicate="something happened", generic=True)
     specific = Statement(predicate="something happened", generic=False)
     assert not generic.means(specific)
Esempio n. 6
0
 def test_entity_does_not_mean_statement(self):
     entity = Entity(name="Bob")
     statement = Statement(predicate="$person loves ice cream", terms=entity)
     assert not entity.means(statement)
     assert not statement.means(entity)