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:
authorRico Sennrich <rico.sennrich@gmx.ch>2014-09-01 21:07:30 +0400
committerRico Sennrich <rico.sennrich@gmx.ch>2014-09-01 21:16:22 +0400
commit2a46e8cceaa352b323b67b121eda979a81d3c27b (patch)
tree84e8072470df70f21b1e771c77a3218c314f35c8 /moses/ChartCellLabelSet.h
parent2d73f6f803ae99b0cbc549b651c8e83cedefa98e (diff)
parse chart compression for faster CYK+ parsing with syntax systems.
Diffstat (limited to 'moses/ChartCellLabelSet.h')
-rw-r--r--moses/ChartCellLabelSet.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/moses/ChartCellLabelSet.h b/moses/ChartCellLabelSet.h
index 45d281d35..d946058ba 100644
--- a/moses/ChartCellLabelSet.h
+++ b/moses/ChartCellLabelSet.h
@@ -124,6 +124,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)) {