From 3d105a525ccac6b68d3e205d435b735ef5769cd4 Mon Sep 17 00:00:00 2001 From: Kia <kia@special-circumstanc.es> Date: Fri, 21 Aug 2020 19:04:31 -0600 Subject: [PATCH] continue work on creating the derivation tree --- CFGBoltzmann.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CFGBoltzmann.py b/CFGBoltzmann.py index abe35e2..8821033 100644 --- a/CFGBoltzmann.py +++ b/CFGBoltzmann.py @@ -361,7 +361,7 @@ class CFGBoltzmann: def Gzero_shimmed(self, nonterminal, requested_length): nonterminal_index = self.nonterminals_ordered.index(nonterminal) root_of_tree = TreeNode("START",[]) - operation_site = [0] + operation_site = [] return (self.Gzero(nonterminal_index, requested_length, 0, root_of_tree, operation_site), root_of_tree) @@ -369,7 +369,7 @@ class CFGBoltzmann: possibilities = self.Fzero(nonterminal_index, requested_length) chosen_production = self.normalized_choice(possibilities) print(" "* depth +"Gzero entering, with nonterminal", nonterminal_index, "and production rule number", chosen_production) - generated_string = self.Gprim(nonterminal_index, chosen_production, 0, requested_length, depth) + generated_string = self.Gprim(nonterminal_index, chosen_production, depth, requested_length, depth) return generated_string -- GitLab