(ch)
| 1484 | return '(PNP %s)' % s |
| 1485 | |
| 1486 | def do_chunk(ch): |
| 1487 | # Returns the Chunk in NLTK bracket format. Recurse attached PNP's. |
| 1488 | s = ' '.join(['(%s %s)' % (w.pos, w.string) for w in ch.words]) |
| 1489 | s+= ' '.join([do_pnp(pnp) for pnp in ch.attachments]) |
| 1490 | return '(%s %s)' % (ch.type, s) |
| 1491 | |
| 1492 | T = ['(S'] |
| 1493 | v = [] # PNP's already visited. |