Ejemplo n.º 1
0
def test_markov_tables():
  markov_features = ['markov_N', 'markov_R', 'markov_NR', 'markov_RN', 'markov_NN', 'markov_RR']
  assert(t.get(markov_features, f.markov_tables(markovtesttree), str(0.0)) == 
    ('0.809523809524', '0.190476190476', '0.285714285714', '0.285714285714', '0.428571428571', '0.0'))
  assert(t.get(markov_features, f.markov_tables(smalltree), str(0.0)) == 
    ('1.0', '0.0', '0.0', '0.0', '1.0', '0.0'))
  assert(t.get(markov_features, f.markov_tables(f.compress(smalltree)), str(0.0)) == 
    ('1.0', '0.0', '0.0', '0.0', '0.0', '0.0'))
Ejemplo n.º 2
0
def test_length():
  assert(f.length(smalltree) == 2)
  assert(f.length(mediumtree) == 21)

  assert(f.length(smalltree) == f.length(f.compress(smalltree)))
  assert(f.length(mediumtree) == f.length(f.compress(mediumtree)))