Beispiel #1
0
def testPaths(self):
    acls = map(path.paths, acltree["A"])
    test(acls,
         [["A-[-B-p", "A-]-B-q", "A-B-[-r", "]-A-B-s"],
          ["A-[-B-p", "A-B-q", "A-B-r", "]-A-B-s"]])
    ps = map(path.paths, palmtree["A"])
    test(ps, [['S-[-Ns-the',
               'S-Ns-closest',
               'S-Ns-thing',
               'S-Ns-P-[-to',
               'S-Ns-P-Ns-[-a',
               'S-]-Ns-P-Ns-home',
               'S-Vsb-was',
               'S-N-[-a',
               'S-N-string',
               'S-N-hammock',
               'S-N-S+-[-and',
               'S-N-S+-+,',
               'S-N-S+-Fa-[-Rq-when',
               'S-N-S+-Fa-Ni-it',
               'S-N-S+-]-Fa-Vd-rained',
               'S-N-S+-+,',
               'S-N-S+-Np-[-some',
               'S-N-S+-Np-palm',
               'S-N-S+-]-Np-fronds',
               'S-N-S+-Vd-draped',
               'S-N-S+-P-[-over',
               ']-S-N-S+-P-sticks']])
    test({'hi-[-child-grandchild0':1,
          ']-hi-child3': 1,
          'hi-child2':1,
          'hi-]-child-grandchild1':1},
         dct.count(path.paths(iceread.sentences('''[<sent> <#1:1:A>]
hi
 child
  grandchild0
  grandchild1
 child2
 child3'''.split('\n'))['A'][0])))
Beispiel #2
0
tree = iceread.sentences('''[<sent> <#X9987:1:A>]
root
 A
  1
  2
  3
 B
  i
  ii
   x
   y
 C
  1
  2
   in
   out
[<sent> <#X9987:1:?>]
A
 1
  i
  ii
 2
  x
  y
[<sent> totally missing!??]
root
 A
  arf
  quad
  quam
  quim
 B
  neighbourhood'''.split('\n'))