

def test_read_treebank():
    list = ['(', '(S', '(NP1', '(NE', '---', 'A', '500-PAGE', 'REPORT', '~NE', '(VP1', '(VBN', 'RELEASED', '~VBN', '(NE', '---', 'TUESDAY', '~NE', '(PP', '(IN', 'IN', '~IN', '(NE', '---', 'THE', 'RWANDAN', 'CAPITAL', '~NE', '~PP', '~VP1', '~NP1', '(VP2', '(VP3', '(VBD', 'ALLEGED', '~VBD', '(SBAR', '(SBAR', '(IN', 'THAT', '~IN', '(S', '(NE', '---', 'FRANCE', '~NE', '(VP4', '(VBD', 'WAS', '~VBD', '(ADJP', '(JJ', 'AWARE', '~JJ', '(PP', '(IN', 'OF', '~IN', '(NE', '---', 'PREPARATIONS', 'FOR', 'THE', 'GENOCIDE', '~NE', '~PP', '~ADJP', '~VP4', '~S', '~SBAR', '(,', ',', '~,', '(CCP', 'AND', '~CCP', '(SBAR', '(IN', 'THAT', '~IN', '(S', '(NE', '---', 'THE', 'FRENCH', 'MILITARY', 'IN', 'RWANDA', '~NE', '(VP5', '(VBD', 'CONTRIBUTED', '~VBD', '(PP', '(TO', 'TO', '~TO', '(S', '(VP6', '(VBG', 'PLANNING', '~VBG', '(NE', '---', 'THE', 'MASSACRES', '~NE', '~VP6', '~S', '~PP', '~VP5', '~S', '~SBAR', '~SBAR', '~VP3', '(CCP', 'AND', '~CCP', '(VP7', '(ADVP', '(RB', 'ACTIVELY', '~RB', '~ADVP', '(VBD', 'TOOK', '~VBD', '(NE', '---', 'PART', 'IN', 'THE', 'KILLING', '~NE', '~VP7', '~VP2', '(.', '.', '~.', '~S', '~']
    sent = '( (S\n            (NP (NP (DT A) (JJ 500-page) (NN report))\n            (VP (VBN released)\n            (NP (NNP Tuesday))\n            (PP (IN in)\n            (NP (DT the) (NNP Rwandan) (NN capital)))))\n            (VP\n            (VP (VBD alleged) (SBAR (SBAR (IN that) (S\n            (NP (NNP France))\n            (VP (VBD was) (ADJP (JJ aware)\n            (PP (IN of)\n            (NP (NP (NNS preparations))\n            (PP (IN for)\n            (NP (DT the) (NN genocide))))))))) (, ,) (CC and) (SBAR (IN that) (S\n            (NP (NP (DT the) (JJ French) (NN military))\n            (PP (IN in)\n            (NP (NNP Rwanda))))\n            (VP (VBD contributed)\n            (PP (TO to) (S\n            (VP (VBG planning)\n            (NP (DT the) (NNS massacres)))))))))) (CC and)\n            (VP (ADVP (RB actively)) (VBD took)\n            (NP (NP (NN part))\n            (PP (IN in)\n            (NP (DT the) (NN killing)))))) (. .)))'
    sent = utilities._format_parsed_str(sent)
    (plist, pstart) = petrarch.read_TreeBank(sent)
    assert ((plist == list) and (pstart == 2))

dataset/ETHPy150Open openeventdata/petrarch/petrarch/tests/test_petrarch.py test_read_treebank/original