summaryrefslogtreecommitdiff
path: root/decoder/ff_fsa.h
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-25 20:33:06 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-25 20:33:06 +0000
commit65a47d21082deb41aceb6516212568408bddaeac (patch)
tree17a36f2dc477374aa8eabd4e12fac9a704388c86 /decoder/ff_fsa.h
parentfe91371a77ec43cc08d284ac49f00af8baa1a298 (diff)
being ensuring edge debug info is copied when apply_models - new hg.AddEdge methods
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@409 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/ff_fsa.h')
-rwxr-xr-xdecoder/ff_fsa.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/decoder/ff_fsa.h b/decoder/ff_fsa.h
index f48fac60..93e3bd5e 100755
--- a/decoder/ff_fsa.h
+++ b/decoder/ff_fsa.h
@@ -6,6 +6,7 @@
state is some fixed width byte array. could actually be a void *, WordID sequence, whatever.
+ TODO: fsa feature aggregator that presents itself as a single fsa; benefit: when wrapped in ff_from_fsa, only one set of left words is stored.
*/
//SEE ALSO: ff_fsa_dynamic.h, ff_from_fsa.h
@@ -13,12 +14,14 @@
//TODO: decide whether to use init_features / add_value vs. summing elsewhere + set_value once (or inefficient for from_fsa: sum distinct feature_vectors. but L->R if we only scan 1 word at a time, that's fine
//#define FSA_DEBUG
-
-# define FSADBGae(e,x) std::cerr << x; INFO_EDGE(e,x);
+#define FSA_DEBUG_CERR 0
+#define FSA_DEBUG_DEBUG 0
+# define FSADBGif(i,e,x) do { if (i) { if (FSA_DEBUG_CERR){std::cerr<<x;} INFO_EDGE(e,x); if (FSA_DEBUG_DEBUG){std::cerr<<"FSADBGif edge.info "<<&e<<" = "<<e.info()<<std::endl;}} } while(0)
+# define FSADBGif_nl(i,e) do { if (i) { if (FSA_DEBUG_CERR) std::cerr<<std::endl; INFO_EDGE(e,"; "); } } while(0)
#ifdef FSA_DEBUG
# include <iostream>
-# define FSADBG(e,x) do { if (d().debug()) { FSADBGae(e,x) } } while(0)
-# define FSADBGnl(e) do { if (d().debug) { std::cerr<<std::endl; INFO_EDGE(e,"; "); } } while(0)
+# define FSADBG(e,x) FSADBGif(d().debug(),e,x)
+# define FSADBGnl(e) FSADBGif_nl(d().debug(),e,x)
#else
# define FSADBG(e,x)
# define FSADBGnl(e)