Skip to content
Snippets Groups Projects
Commit e754eac6 authored by Franck Dary's avatar Franck Dary
Browse files

Cannot do BACK when back already happened for that word

parent 1a6a18a8
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ class Config :
self.stack = []
self.comments = []
self.history = []
self.historyHistory = set()
self.backHistory = set()
self.historyPop = []
def isPredicted(self, colname) :
......
......@@ -43,7 +43,7 @@ class Transition :
data = None
config.nbUndone = max(0, config.nbUndone-1)
elif "BACK" in self.name :
config.historyHistory.add(str([t[0].name for t in config.historyPop]))
config.backHistory.add(config.wordIndex)
applyBack(config, strategy, self.size)
else :
print("ERROR : nothing to apply for '%s'"%self.name, file=sys.stderr)
......@@ -89,7 +89,7 @@ class Transition :
if "BACK" in self.name :
if len([h[0].name for h in config.historyPop if "NOBACK" in h[0].name]) < self.size :
return False
return str([t[0].name for t in config.historyPop]) not in config.historyHistory
return config.wordIndex not in config.backHistory
print("ERROR : appliable, unknown name '%s'"%self.name, file=sys.stderr)
exit(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment