minor rename

This commit is contained in:
Hieu Hoang 2017-02-20 11:03:19 +00:00
parent fc3dfcfea2
commit c8249482a7
2 changed files with 5 additions and 7 deletions

View File

@ -23,7 +23,7 @@ int main(int argc, char* argv[]) {
std::setvbuf(stdin, NULL, _IONBF, 0);
boost::timer::cpu_timer timer;
std::string in;
std::string line;
std::size_t lineNum = 0;
size_t miniSize = god.Get<size_t>("mini-batch");
@ -33,8 +33,8 @@ int main(int argc, char* argv[]) {
SentencesPtr maxiBatch(new Sentences());
while (std::getline(god.GetInputStream(), in)) {
maxiBatch->push_back(SentencePtr(new Sentence(god, lineNum++, in)));
while (std::getline(god.GetInputStream(), line)) {
maxiBatch->push_back(SentencePtr(new Sentence(god, lineNum++, line)));
if (maxiBatch->size() >= maxiSize) {

View File

@ -40,16 +40,14 @@ boost::python::list translate(boost::python::list& in)
boost::python::list output;
for(int i = 0; i < boost::python::len(in); ++i) {
std::string s = boost::python::extract<std::string>(boost::python::object(in[i]));
std::string line = boost::python::extract<std::string>(boost::python::object(in[i]));
results.emplace_back(
god_.GetThreadPool().enqueue(
[=]{ return TranslationTask(s, i); }
[=]{ return TranslationTask(line, i); }
)
);
}
size_t lineCounter = 0;
for (auto&& result : results) {
std::stringstream ss;
Printer(god_, *result.get().get(), ss);