diff options
author | Paul Baltescu <pauldb89@gmail.com> | 2013-03-06 15:42:29 +0000 |
---|---|---|
committer | Paul Baltescu <pauldb89@gmail.com> | 2013-03-06 15:42:50 +0000 |
commit | 892b0820ce03268bf4c55bed8a8f697009f67f36 (patch) | |
tree | b86666272a1136d665022eefa1c31b4297cafce0 /extractor/fast_intersector.cc | |
parent | e1ffc4886b98f7ddcd2ec30d740aa2de8282cd8e (diff) |
Fixed 3 TODOs.
Diffstat (limited to 'extractor/fast_intersector.cc')
-rw-r--r-- | extractor/fast_intersector.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/extractor/fast_intersector.cc b/extractor/fast_intersector.cc index cec3d30b..1b8c32b1 100644 --- a/extractor/fast_intersector.cc +++ b/extractor/fast_intersector.cc @@ -35,12 +35,9 @@ vector<int> FastIntersector::ConvertPhrase(const vector<int>& old_phrase) { vector<int> new_phrase; new_phrase.reserve(old_phrase.size()); shared_ptr<DataArray> data_array = suffix_array->GetData(); - int num_nonterminals = 0; for (int word_id: old_phrase) { - // TODO(pauldb): Remove overhead for relabelling the nonterminals here. - if (word_id == Precomputation::NON_TERMINAL) { - ++num_nonterminals; - new_phrase.push_back(vocabulary->GetNonterminalIndex(num_nonterminals)); + if (word_id < 0) { + new_phrase.push_back(word_id); } else { new_phrase.push_back( vocabulary->GetTerminalIndex(data_array->GetWord(word_id))); |