From f6cd72d39cdc7a034b36ad73d613f6f268826e48 Mon Sep 17 00:00:00 2001 From: graehl Date: Tue, 20 Jul 2010 23:57:46 +0000 Subject: fabulous string tokenization tested git-svn-id: https://ws10smt.googlecode.com/svn/trunk@350 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/stringlib.h | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'decoder/stringlib.h') diff --git a/decoder/stringlib.h b/decoder/stringlib.h index a7c6c3c4..a0e03624 100644 --- a/decoder/stringlib.h +++ b/decoder/stringlib.h @@ -1,6 +1,13 @@ #ifndef CDEC_STRINGLIB_H_ #define CDEC_STRINGLIB_H_ +#ifdef STRINGLIB_DEBUG +#include +#define SLIBDBG(x) do { std::cerr<<"DBG(stringlib): "< #include #include @@ -112,20 +119,26 @@ inline bool IsWordSep(char c) { template // *end must be 0 (i.e. [p,end] is valid storage, which will be written to with 0 to separate c string tokens void VisitTokens(char *p,char *const end,F f) { + SLIBDBG("VisitTokens. p="<