n-zare
n-zare
How to reverse more complicated sentences like: `[Tree('S', [Tree('VPS', [Tree('N', ['آشپزها']), Tree('VP', [Tree('PP', [Tree('PREP_EZ', ['برای']), Tree('N', ['مهمانها'])]), Tree('MV', [Tree('N', ['آشپزی']), Tree('V', ['می\u200cکنند'])])])]), Tree('PUNC', ['.'])])]`
But It doesn't solve the problem because it reversed leaves too. I need to reverse only leaves or reverse the tree without reversing leaves.
For Right to left languages, pretty_print print the tree structure from left to right but print the sentence from right to left. So you can see that words are not...
The structure is correct. For example with this tree: ``` (S (VPS (N آشپزها) (VP (PP (PREP_EZ برای) (N مهمانها)) (MV (N آشپزی) (V میکنند)))) (PUNC .)) ``` the desired...
It will be great, thanks.
@12mohaned based on this code you sent: `leaves.reverse() tree = Tree('ROOT',Tree('S',leaves)` just leaves reverse and we lose the middle nodes, how can I reverse leaves while preserving their pos values...
So yes, temporary answer is to reversing just leaves, but how? I have hundreds of tree strings that I want to print them and I should reverse their leaves to...