Example #1
0
def test_subset_of_and_or():
    """Ordinary subset ("and", "or")"""
    cases = [[F.al('ac'), F.samjna('dhatu'), F.upadha('Yam')]]
    for filters in cases:
        intersection = F.Filter._and(*filters)
        for f in filters:
            assert intersection.subset_of(f)

        union = F.Filter._or(*filters)
        for f in filters:
            assert f.subset_of(union)
Example #2
0
def test_samjna():
    cases = [(
        ['anga'],
        'nara grAma vIra',
        'nara grAma vIra',
    )]

    for pattern, yes, no in cases:
        f = F.samjna(*pattern)
        for y in yes.split():
            assert f.allows([Upadesha.as_anga(y)], 0)
        for n in no.split():
            assert not f.allows([Pratyaya(n)], 0)
Example #3
0
def test_subset_of_and_or():
    """Ordinary subset ("and", "or")"""
    cases = [
        [F.al('ac'), F.samjna('dhatu'), F.upadha('Yam')]
    ]
    for filters in cases:
        intersection = F.Filter._and(*filters)
        for f in filters:
            assert intersection.subset_of(f)

        union = F.Filter._or(*filters)
        for f in filters:
            assert f.subset_of(union)
Example #4
0
def test_samjna():
    cases = [
        (['anga'],
            'nara grAma vIra',
            'nara grAma vIra',
        )
    ]

    for pattern, yes, no in cases:
        f = F.samjna(*pattern)
        for y in yes.split():
            assert f.allows([Upadesha.as_anga(y)], 0)
        for n in no.split():
            assert not f.allows([Pratyaya(n)], 0)
Example #5
0
def test_subset_of_inference():
    """Inferential subset"""
    bhu = F.dhatu('BU')
    dhatu = F.samjna('dhatu')
    assert bhu.subset_of(dhatu)
Example #6
0
def test_subset_of_inference():
    """Inferential subset"""
    bhu = F.dhatu('BU')
    dhatu = F.samjna('dhatu')
    assert bhu.subset_of(dhatu)