summaryrefslogtreecommitdiff
path: root/extractor/data_array.cc
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-02-19 21:23:48 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-02-19 21:23:48 +0000
commit54a1c0e2bde259e3acc9c0a8ec8da3c7704e80ca (patch)
tree6171a6a2e904d00b86ea108b2ef1d572c2d36d87 /extractor/data_array.cc
parent63b30ed9c8510da8c8e2f6a456576424fddacc0e (diff)
Timing every part of the extractor.
Diffstat (limited to 'extractor/data_array.cc')
-rw-r--r--extractor/data_array.cc3
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 {