summaryrefslogtreecommitdiff
path: root/decoder/apply_fsa_models.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-31 01:56:56 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-31 01:56:56 +0000
commit6165a7852d01439d20ed5ee1814798863a3d5bf7 (patch)
tree79c893eea7572c70e3149db79562e61b25ffa5af /decoder/apply_fsa_models.cc
parente4175086a36fbaf752b8a2dae089b9081ac5880f (diff)
l2r bugfixes
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@635 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/apply_fsa_models.cc')
-rwxr-xr-xdecoder/apply_fsa_models.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/decoder/apply_fsa_models.cc b/decoder/apply_fsa_models.cc
index 4a928206..83083fc5 100755
--- a/decoder/apply_fsa_models.cc
+++ b/decoder/apply_fsa_models.cc
@@ -495,9 +495,8 @@ typedef Item *ItemP;
/* we use a single type of item so it can live in a single best-first queue. we hold them by pointer so they can have mutable state, e.g. priority/location, but also lists of predictions and kbest completions (i.e. completions[L,r] = L -> * (r,s), by 1best for each possible s. we may discover more s later. we could use different subtypes since we hold by pointer, but for now everything will be packed as variants of Item */
struct Item : ItemPrio,ItemKey {
- explicit Item(NodeP dot,int next=0) : ItemKey(dot),next(next),from(0) { }
- explicit Item(NodeP dot,FFState const& state,int next=0) : ItemKey(dot,state),next(next),from(0) { }
- unsigned location;
+ explicit Item(NodeP dot,int next=0) : ItemKey(dot),next(next),from(0),location(D_ARY_HEAP_NULL_INDEX) { }
+ explicit Item(NodeP dot,FFState const& state,int next=0) : ItemKey(dot,state),next(next),from(0),location(D_ARY_HEAP_NULL_INDEX) { }
typedef std::queue<ItemP> Predicted;
Predicted predicted; // this is empty, unless this is a predicted L -> .asdf item, or a to-complete L -> asdf .
int next; // index of dot->adj to complete (if dest==0), or predict (if NT), or scan (if word). note: we could store pointer inside adj since it and trie are @ fixed addrs. less pointer arith, more space.
@@ -517,6 +516,7 @@ struct Item : ItemPrio,ItemKey {
o<< ']';
}
PRINT_SELF(Item)
+ unsigned location;
};
struct GetItemKey {
@@ -645,6 +645,7 @@ void ApplyFsa<F>::ApplyEarley()
Chart<F> chart(cfg,smeta,fsa);
// don't need to uniq - option to do that already exists in cfg_options
//TODO:
+ *oh=hgcfg.ih;
}