Skip to content

Commit 6155ab0

Browse files
committed
Update evaluator to c++17
1 parent 6560ccc commit 6155ab0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/Evaluator.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <fstream>
1+
#include <fstream>
22
#include <iostream>
33

44
#include <kiwi/Utils.h>
@@ -171,10 +171,10 @@ auto MorphEvaluator::loadTestset(const string& testSetFile) const -> vector<Test
171171
vector<u16string> tokens;
172172
for (size_t i = 1; i < fd.size(); ++i)
173173
{
174-
for (auto s : split(fd[i], u' ')) tokens.emplace_back(s.to_string());
174+
for (auto s : split(fd[i], u' ')) tokens.emplace_back(s);
175175
}
176176
TestResult tr;
177-
tr.q = fd[0].to_string();
177+
tr.q = u16string{ fd[0] };
178178
for (auto& t : tokens) tr.a.emplace_back(parseWordPOS(t));
179179
ret.emplace_back(std::move(tr));
180180
}
@@ -329,8 +329,8 @@ auto DisambEvaluator::loadTestset(const string& testSetFile) const -> vector<Tes
329329
auto fd = split(wstr, u'\t');
330330
if (fd.size() < 2) continue;
331331
TestResult tr;
332-
tr.target = parseWordPOS(fd[0].to_string());
333-
tr.text = fd[1].to_string();
332+
tr.target = parseWordPOS(u16string{ fd[0] });
333+
tr.text = u16string{ fd[1] };
334334
ret.emplace_back(move(tr));
335335
}
336336
return ret;

0 commit comments

Comments
 (0)