Tree reader¶
from lambeq import BobcatParser, TreeReader, TreeReaderMode
sentence = 'John walks in the park.'
reader = TreeReader(ccg_parser=BobcatParser, mode = TreeReaderMode.NO_TYPE)
reader.sentence2diagram(sentence=sentence).draw()
reader = TreeReader(ccg_parser=BobcatParser, mode=TreeReaderMode.RULE_ONLY)
reader.sentence2diagram(sentence).draw()
reader = TreeReader(ccg_parser=BobcatParser, mode=TreeReaderMode.RULE_TYPE)
reader.sentence2diagram(sentence).draw()