Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Bertoldi <bertoldi@fbk.eu>2014-12-13 14:52:47 +0300
committerNicola Bertoldi <bertoldi@fbk.eu>2014-12-13 14:52:47 +0300
commite4eb201c52be74fee74399a6f35fcbe8eb85d834 (patch)
tree7792ef96d63262f6e28f1857741e1162c7dccbc4 /moses/ChartCellLabelSet.h
parentcea2d9d8bb34a81660974cae20d66aefec4e0468 (diff)
parenta0b6b6a341e74b47bbef4652ad7fd928cf91e17c (diff)
merged master into dynamic-models and solved conflicts
Diffstat (limited to 'moses/ChartCellLabelSet.h')
-rw-r--r--moses/ChartCellLabelSet.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/moses/ChartCellLabelSet.h b/moses/ChartCellLabelSet.h
index 2c1e8b50f..591aa17a6 100644
--- a/moses/ChartCellLabelSet.h
+++ b/moses/ChartCellLabelSet.h
@@ -72,6 +72,8 @@ public:
size_t idx = w[0]->GetId();
if (! ChartCellExists(idx)) {
m_size++;
+
+
m_map[idx] = new ChartCellLabel(m_coverage, w);
}
}
@@ -119,6 +121,15 @@ public:
}
}
+ const ChartCellLabel *Find(size_t idx) const {
+ try {
+ return m_map.at(idx);
+ }
+ catch (const std::out_of_range& oor) {
+ return NULL;
+ }
+ }
+
ChartCellLabel::Stack &FindOrInsert(const Word &w) {
size_t idx = w[0]->GetId();
if (! ChartCellExists(idx)) {