From bfccb21989a1910201f5575c0e7ccd5377f40a9d Mon Sep 17 00:00:00 2001
From: Franck Dary <franck.dary@lis-lab.fr>
Date: Mon, 14 Oct 2019 15:27:29 +0200
Subject: [PATCH] Fixed bug where GOV was requested even when we had no GOV
 tape

---
 transition_machine/src/Config.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/transition_machine/src/Config.cpp b/transition_machine/src/Config.cpp
index 2188326..b33755b 100644
--- a/transition_machine/src/Config.cpp
+++ b/transition_machine/src/Config.cpp
@@ -129,7 +129,8 @@ void Config::fillTapesWithInput()
   std::vector<std::string> cols;
   unsigned int usualColsSize = 0;
   auto & ids = getTape("ID");
-  auto & govs = getTape("GOV");
+  bool hasGov = hasTape("GOV");
+  auto & govs = hasGov ? getTape("GOV") : ids;
 
   for (auto & sentence : inputContent)
   {
@@ -183,7 +184,7 @@ void Config::fillTapesWithInput()
       getTape(ProgramParameters::sequenceDelimiterTape).addToHyp("");
     }
 
-    for (int word = sentenceStartIndex; word < ids.refSize(); word++)
+    for (int word = sentenceStartIndex; hasGov && word < ids.refSize(); word++)
     {
       if (split(ids.getRef(word), '-').size() > 1)
         continue;
-- 
GitLab