Esempio n. 1
0
def test_not_():
    cases = [
        (
            ['al'],
            '',
            'indra agni vAyu jAne agnO Bagavat Atman lih dfS',
        ),
        (
            ['ac'],
            'Bagavat Atman lih dfS',
            'indra agni vAyu jAne agnO',
        ),
        (
            ['hal'],
            'indra agni vAyu jAne agnO',
            'Bagavat Atman lih dfS',
        ),
        (
            ['ec'],
            'indra agni vAyu Bagavat Atman lih dfS',
            'jAne agnO',
        ),
        (
            ['Sar'],
            'indra agni vAyu jAne agnO Bagavat Atman lih',
            'dfS',
        ),
    ]
    verify(cases, lambda x: ~F.al(x), term_tester)
Esempio n. 2
0
def test_and_():
    cases = [(
        ['Yam'],
        'banD granT stamB',
        'car pAna granTa nara nayati',
    )]
    verify(cases, lambda names: F.upadha(names) & F.al('hal'), term_tester)
Esempio n. 3
0
def test_or_():
    cases = [(
        ['Yam'],
        'banD granT stamB pAna car',
        'granTa nara nayati',
    )]
    verify(cases, lambda names: F.upadha(names) | F.al('hal'), term_tester)
Esempio n. 4
0
def test_or_():
    cases = [
        (['Yam'],
            'banD granT stamB pAna car',
            'granTa nara nayati',
        )
    ]
    verify(cases, lambda names: F.upadha(names) | F.al('hal'),
           term_tester)
Esempio n. 5
0
def test_and_():
    cases = [
        (['Yam'],
            'banD granT stamB',
            'car pAna granTa nara nayati',
        )
    ]
    verify(cases, lambda names: F.upadha(names) & F.al('hal'),
           term_tester)
Esempio n. 6
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)
Esempio n. 7
0
def test_subset_of_combined():
    """Combined subset (ordinary, inferential, domain)"""
    f = F.auto

    # Examples from 6.4.77 and 6.4.88
    snu_dhatu_bhru = f('Snu', 'dhatu', 'BrU')
    bhu = f('BU')
    assert bhu.subset_of(snu_dhatu_bhru)
    assert not snu_dhatu_bhru.subset_of(bhu)

    snu_dhatu_bhru_yv = snu_dhatu_bhru & F.al('i u')
    assert bhu.subset_of(snu_dhatu_bhru_yv)
    assert not snu_dhatu_bhru_yv.subset_of(bhu)
Esempio n. 8
0
def test_subset_of_combined():
    """Combined subset (ordinary, inferential, domain)"""
    f = F.auto

    # Examples from 6.4.77 and 6.4.88
    snu_dhatu_bhru = f('Snu', 'dhatu', 'BrU')
    bhu = f('BU')
    assert bhu.subset_of(snu_dhatu_bhru)
    assert not snu_dhatu_bhru.subset_of(bhu)

    snu_dhatu_bhru_yv = snu_dhatu_bhru & F.al('i u')
    assert bhu.subset_of(snu_dhatu_bhru_yv)
    assert not snu_dhatu_bhru_yv.subset_of(bhu)
Esempio n. 9
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)
Esempio n. 10
0
def test_not_():
    cases = [
        (['al'],
            '',
            'indra agni vAyu jAne agnO Bagavat Atman lih dfS',
        ),
        (['ac'],
            'Bagavat Atman lih dfS',
            'indra agni vAyu jAne agnO',
        ),
        (['hal'],
            'indra agni vAyu jAne agnO',
            'Bagavat Atman lih dfS',
        ),
        (['ec'],
            'indra agni vAyu Bagavat Atman lih dfS',
            'jAne agnO',
        ),
        (['Sar'],
            'indra agni vAyu jAne agnO Bagavat Atman lih',
            'dfS',
        ),
    ]
    verify(cases, lambda x: ~F.al(x), term_tester)