Commit 66d1e477 authored by Franck Dary's avatar Franck Dary
Browse files

Removing TSV lines from Config constructor when in txt mode

parent d536a34e
......@@ -100,7 +100,7 @@ int MacaonDecode::main()
if (!inputTXT.empty())
rawInputs = util::readFileAsUtf8(inputTXT, lineByLine);
std::vector<std::vector<std::string>> tsv;
std::vector<std::vector<std::string>> tsv, noTsv;
if (!inputTSV.empty())
tsv = util::readTSV(inputTSV);
......@@ -109,7 +109,7 @@ int MacaonDecode::main()
{
if (rawInputs.size())
for (unsigned int i = 0; i < rawInputs.size(); i++)
configs.emplace_back(mcd, tsv, rawInputs[i], std::vector<int>{(int)i});
configs.emplace_back(mcd, noTsv, rawInputs[i], std::vector<int>{(int)i});
else
for (unsigned int i = 0; i < tsv.size(); i++)
configs.emplace_back(mcd, tsv, util::utf8string(), std::vector<int>{(int)i});
......@@ -117,7 +117,7 @@ int MacaonDecode::main()
else
{
if (rawInputs.size())
configs.emplace_back(mcd, tsv, rawInputs[0], std::vector<int>());
configs.emplace_back(mcd, noTsv, rawInputs[0], std::vector<int>());
else
configs.emplace_back(mcd, tsv, util::utf8string(), std::vector<int>());
}
......
......@@ -165,7 +165,7 @@ int MacaonTrain::main()
try
{
std::vector<std::vector<std::string>> trainTsv, devTsv;
std::vector<std::vector<std::string>> trainTsv, devTsv, noTsv;
if (!trainTsvFile.empty())
trainTsv = util::readTSV(trainTsvFile);
if (!devTsvFile.empty())
......@@ -304,7 +304,7 @@ int MacaonTrain::main()
{
if (devRawInputs.size())
for (unsigned int i = 0; i < devRawInputs.size(); i++)
devConfigs.emplace_back(mcd, devTsv, devRawInputs[i], std::vector<int>{(int)i});
devConfigs.emplace_back(mcd, noTsv, devRawInputs[i], std::vector<int>{(int)i});
else
for (unsigned int i = 0; i < devTsv.size(); i++)
devConfigs.emplace_back(mcd, devTsv, util::utf8string(), std::vector<int>{(int)i});
......@@ -312,7 +312,7 @@ int MacaonTrain::main()
else
{
if (devRawInputs.size())
devConfigs.emplace_back(mcd, devTsv, devRawInputs[0], std::vector<int>());
devConfigs.emplace_back(mcd, noTsv, devRawInputs[0], std::vector<int>());
else
devConfigs.emplace_back(mcd, devTsv, util::utf8string(), std::vector<int>());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment