adobe / NLP-Cube

Natural Language Processing Pipeline - Sentence Splitting, Tokenization, Lemmatization, Part-of-speech Tagging and Dependency Parsing
http://opensource.adobe.com/NLP-Cube/index.html
Apache License 2.0
552 stars 93 forks source link

ConllEntry should have a __repr__ function #93

Closed dumitrescustefan closed 5 years ago

dumitrescustefan commented 5 years ago

Right now, output looks like:

text="This is the text I want segmented, tokenized, lemmatized and annotated with POS and dependencies." sentences=cube(text) print(sentences) [[<cube.io_utils.conll.ConllEntry object at 0x7f5ae924b358>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252080>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae92520f0>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252160>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae92521d0>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252240>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae92522b0>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252320>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252390>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252400>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252470>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae92524e0>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252550>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae92525c0>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252630>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae92526a0>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252710>, <cube.io_utils.conll.ConllEntry object at 0x7f5ae9252780>]]

when we print a sentence object. We should have a repr function implemented to look pretty .. er.

KoichiYasuoka commented 5 years ago

Thank you for merging my repr for ConllEntry. I'm looking forward to next release.