diff options
author | Paul Baltescu <pauldb89@gmail.com> | 2013-02-19 21:23:48 +0000 |
---|---|---|
committer | Paul Baltescu <pauldb89@gmail.com> | 2013-02-19 21:23:48 +0000 |
commit | 54a1c0e2bde259e3acc9c0a8ec8da3c7704e80ca (patch) | |
tree | 6171a6a2e904d00b86ea108b2ef1d572c2d36d87 /extractor/data_array.cc | |
parent | 63b30ed9c8510da8c8e2f6a456576424fddacc0e (diff) |
Timing every part of the extractor.
Diffstat (limited to 'extractor/data_array.cc')
-rw-r--r-- | extractor/data_array.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extractor/data_array.cc b/extractor/data_array.cc index 1097caf3..cd430c69 100644 --- a/extractor/data_array.cc +++ b/extractor/data_array.cc @@ -147,7 +147,8 @@ bool DataArray::HasWord(const string& word) const { } int DataArray::GetWordId(const string& word) const { - return word2id.find(word)->second; + auto result = word2id.find(word); + return result == word2id.end() ? -1 : result->second; } string DataArray::GetWord(int word_id) const { |