Exemplo n.º 1
0
def test_srtheovoc8(tempvoc6, tempvoc7, role):
    v = tempvoc6
    v2 = tempvoc7
    m = v.get_random_known_m(option=None)
    assert abs(
        srtheo_voc(v, v2, role=role, m=m) -
        srtheo_voc(v, v2, force_ngmeth=True, role=role, m=m)) < epsilon
Exemplo n.º 2
0
def test_srtheovoc_m4(tempvoc):
    v = tempvoc
    v.discover_meanings(['a', 'b', 'c'])
    v.discover_words(range(4))
    v.add(m='a', w=0, content_type='w')
    v.add(m='a', w=1, content_type='w')
    v.add(m='a', w=2, content_type='w')
    v.add(m='b', w=0, content_type='w')
    v.add(m='a', w=1, content_type='m')
    v.add(m='b', w=1, content_type='m')
    assert srtheo_voc(v, v, m='a') == 1. and srtheo_voc(v, v, m='b') == 0.
Exemplo n.º 3
0
def test_srtheovoc_m4(tempvoc):
	v = tempvoc
	v.discover_meanings(['a','b','c'])
	v.discover_words(list(range(4)))
	v.add(m='a',w=0,content_type='w')
	v.add(m='a',w=1,content_type='w')
	v.add(m='a',w=2,content_type='w')
	v.add(m='b',w=0,content_type='w')
	v.add(m='a',w=1,content_type='m')
	v.add(m='b',w=1,content_type='m')
	assert srtheo_voc(v,v,m='a') == 1. and srtheo_voc(v,v,m='b') == 0.
Exemplo n.º 4
0
def test_srtheovoc_basic7(tempvoc):
	v = tempvoc
	v.discover_meanings(['a','b','c'])
	v.discover_words(list(range(4)))
	for m in ['a','b','c']:
		for w in range(4):
			v.add(m=m,w=w,content_type='both')
	assert abs(srtheo_voc(v,v) - 1/3.) < epsilon
Exemplo n.º 5
0
def test_srtheovoc_basic5_2(tempvoc):
    v = tempvoc
    v.discover_meanings(['a', 'b', 'c'])
    v.discover_words(range(4))
    v.add(m='a', w=0, content_type='w')
    v.add(m='a', w=1, content_type='w')
    v.add(m='a', w=1, content_type='m')
    assert srtheo_voc(v, v) == 1 / 3.
Exemplo n.º 6
0
def test_srtheovoc_basic7(tempvoc):
    v = tempvoc
    v.discover_meanings(['a', 'b', 'c'])
    v.discover_words(range(4))
    for m in ['a', 'b', 'c']:
        for w in range(4):
            v.add(m=m, w=w, content_type='both')
    assert abs(srtheo_voc(v, v) - 1 / 3.) < epsilon
Exemplo n.º 7
0
def test_srtheovoc_basic5_2(tempvoc):
	v = tempvoc
	v.discover_meanings(['a','b','c'])
	v.discover_words(list(range(4)))
	v.add(m='a',w=0,content_type='w')
	v.add(m='a',w=1,content_type='w')
	v.add(m='a',w=1,content_type='m')
	assert srtheo_voc(v,v) == 1/3.
Exemplo n.º 8
0
def test_srtheovoc_basic6_2(tempvoc):
    v = tempvoc
    v.discover_meanings(['a', 'b', 'c'])
    v.discover_words(range(4))
    v.add(m='a', w=0, content_type='w')
    v.add(m='a', w=1, content_type='w')
    v.add(m='b', w=0, content_type='w')
    v.add(m='a', w=0, content_type='m')
    v.add(m='b', w=0, content_type='m')
    assert abs(srtheo_voc(v, v) - 4 / 12.) < epsilon
Exemplo n.º 9
0
def test_srtheovoc_basic6_2(tempvoc):
	v = tempvoc
	v.discover_meanings(['a','b','c'])
	v.discover_words(list(range(4)))
	v.add(m='a',w=0,content_type='w')
	v.add(m='a',w=1,content_type='w')
	v.add(m='b',w=0,content_type='w')
	v.add(m='a',w=0,content_type='m')
	v.add(m='b',w=0,content_type='m')
	assert abs(srtheo_voc(v,v) - 4/12.) < epsilon
Exemplo n.º 10
0
def test_srtheovoc_basic6_3bis(tempvoc):
	v = tempvoc
	v.discover_meanings(['a','b','c'])
	v.discover_words(list(range(4)))
	v2 = copy.deepcopy(v)
	v.add(m='a',w=0,content_type='both')
	v.add(m='a',w=1,content_type='both')
	v.add(m='b',w=0,content_type='both')
	v2.add(m='a',w=0,content_type='both')
	v2.add(m='b',w=1,content_type='both')
	v2.add(m='c',w=2,content_type='both')
	v2.add(m='b',w=2,content_type='both')
	assert abs(srtheo_voc(v,v2,role='hearer') - 1/6.) < epsilon
Exemplo n.º 11
0
def test_srtheovoc_basic6_3bis(tempvoc):
    v = tempvoc
    v.discover_meanings(['a', 'b', 'c'])
    v.discover_words(range(4))
    v2 = copy.deepcopy(v)
    v.add(m='a', w=0, content_type='both')
    v.add(m='a', w=1, content_type='both')
    v.add(m='b', w=0, content_type='both')
    v2.add(m='a', w=0, content_type='both')
    v2.add(m='b', w=1, content_type='both')
    v2.add(m='c', w=2, content_type='both')
    v2.add(m='b', w=2, content_type='both')
    assert abs(srtheo_voc(v, v2, role='hearer') - 1 / 6.) < epsilon
Exemplo n.º 12
0
def test_srtheovoc7(tempvoc6, tempvoc7, role):
    v = tempvoc6
    v2 = tempvoc7
    assert abs(
        srtheo_voc(v, v2, role=role) -
        srtheo_voc(v, v2, force_ngmeth=True, role=role)) < epsilon
Exemplo n.º 13
0
def test_srtheovoc6(tempvoc5, tempvoc4, role):
    v = tempvoc5
    v2 = tempvoc4
    assert abs(
        srtheo_voc(v, v2, role=role) -
        srtheo_voc(v, v2, force_ngmeth=True, role=role)) < epsilon
Exemplo n.º 14
0
def test_srtheovoc3(tempvoc2, tempvoc3, role):
    v = tempvoc2
    v2 = tempvoc3
    assert abs(
        srtheo_voc(v, v2, role=role) -
        srtheo_voc(v, v2, force_ngmeth=True, role=role)) < epsilon
Exemplo n.º 15
0
def test_srtheovoc9(tempvoc6,tempvoc7,role):
	v = tempvoc6
	v2 = tempvoc7
	m = v.get_random_known_m(option=None)
	w = v.get_random_known_w(m=m,option=None)
	assert abs(srtheo_voc(v,v2,role=role,m=m,w=w) - srtheo_voc(v,v2,force_ngmeth=True,role=role,m=m,w=w)) < epsilon
Exemplo n.º 16
0
def test_srtheovoc3(tempvoc2,tempvoc3,role):
	v = tempvoc2
	v2 = tempvoc3
	assert abs(srtheo_voc(v,v2,role=role) - srtheo_voc(v,v2,force_ngmeth=True,role=role)) < epsilon
Exemplo n.º 17
0
def test_srtheovoc7(tempvoc6,tempvoc7,role):
	v = tempvoc6
	v2 = tempvoc7
	assert abs(srtheo_voc(v,v2,role=role) - srtheo_voc(v,v2,force_ngmeth=True,role=role)) < epsilon
Exemplo n.º 18
0
def test_srtheovoc6(tempvoc5,tempvoc4,role):
	v = tempvoc5
	v2 = tempvoc4
	assert abs(srtheo_voc(v,v2,role=role) - srtheo_voc(v,v2,force_ngmeth=True,role=role)) < epsilon