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 | 5116d987802eac66ef2d5dbbc9a3546665c9e8e3 (patch) | |
tree | 6f45fbdd80611512f0acb5e9cbc7d8da9c317cdb /extractor/fast_intersector.cc | |
parent | ab5367aa2c42126a04034cd7d3cec125bca399ca (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))); |