Open leoalenc opened 1 month ago
@dominickmaia :
>>> import DepTree
>>> d='''# sent_id = Casasnovas2006:9:9:93
# text = Ape, paá, usú ã ipawa kití.
# text_eng = TODO
# text_eng_ggl = He then went to the lake.
# text_por = Foi, então, ao lago.
# text_source = p. 88, No. 9
# text_orig = Ape, paá, usuã ipawa kití.
# text_annotator = JLG
# title = Tapayuna mirĩ puranga
# title_orig = Tapayuna Mirí Puranga
# title_por_orig = A moreninha
# title_eng = The little brunette
# acknowledgement = DACILAT Project, FAPESP's Process No. 2022/09158-5
# reviewer1 = Leonel Figueiredo de Alencar
1 Ape ape ADV ADVT AdvType=Tim 5 advmod _ SpaceAfter=No|TokenRange=0:3
2 , , PUNCT PUNCT _ 3 punct _ TokenRange=3:4
3 paá paá PART RPRT Evident=Nfh|PartType=Mod 5 advmod _ SpaceAfter=No|TokenRange=5:8
4 , , PUNCT PUNCT _ 3 punct _ TokenRange=8:9
5 usú sú VERB V Mood=Ind|Person=3|VerbForm=Fin 0 root _ TokenRange=10:13
6 ã ã PART PFV Aspect=Perf 5 advmod _ TokenRange=14:15
7 ipawa ipawa NOUN N Number=Sing 5 obl _ TokenRange=16:21
8 kití kití ADP ADP AdpType=Post 7 case _ SpaceAfter=No|TokenRange=22:26
9 . . PUNCT PUNCT _ 5 punct _ SpaceAfter=No|TokenRange=26:27
'''
>>> help(DepTree.displayTree)
Help on function displayTree in module DepTree:
displayTree(conllu_text, output_base_name='dependency_tree', display=True)
# Function to generate and display the dependency tree from a CoNLL-U string
>>> DepTree.displayTree(d)
Dependency tree saved as 'dependency_tree.png' and displayed.