From fbb0dfcfb6ff76ab4a8991f8afe57562574a83e4 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sun, 9 Jan 2022 16:05:53 +0100 Subject: [PATCH] =?UTF-8?q?WIP:=20Extraction=20des=20r=C3=A8gles:=20facile?= =?UTF-8?q?=20!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/show_tree.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/show_tree.py b/src/show_tree.py index f17d5d7..5967f33 100644 --- a/src/show_tree.py +++ b/src/show_tree.py @@ -8,7 +8,7 @@ for pre, fill, node in RenderTree(tree): treestr = u"%s%s" % (pre, node.id) print(treestr.ljust(0)) -print('\ntype: ', type(tree)) +print('\ntype: ', type(tree)) print('path: ', tree.path) print('children: ', tree.children) print('descendants[0]: ', tree.descendants[0]) @@ -26,7 +26,11 @@ print(len(tree.path), ' < len(tree.path)\n') for pre, fill, node in RenderTree(tree): if node.path[len(node.path) - 1].is_leaf: print('at depth', len(node.path), - 'is rule', node.path[len(node.path) - 1].parent_id) + 'is rule', node.path[len(node.path) - 1].parent_id, + 'whose path (tracked by conditions weights) is:', end=' ') + for i in range(0, len(node.path) - 1): + print(node.path[i].weight, ',', end='') + print(' transition', node.path[len(node.path) - 1].id) print('\nNext step: single rule extraction from tree.', ' 😃️\nand learn how to use the Newick format.')