summaryrefslogtreecommitdiff
path: root/decoder/stringlib_test.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-20 23:57:46 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-20 23:57:46 +0000
commitf6cd72d39cdc7a034b36ad73d613f6f268826e48 (patch)
tree6ca964655dc8e2989087d1b32c26f60f7ea6aece /decoder/stringlib_test.cc
parent232cf4e95235bc29bf04e4ea2bf1483d1baf2b7d (diff)
fabulous string tokenization tested
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@350 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/stringlib_test.cc')
-rwxr-xr-xdecoder/stringlib_test.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/decoder/stringlib_test.cc b/decoder/stringlib_test.cc
new file mode 100755
index 00000000..ea39f30f
--- /dev/null
+++ b/decoder/stringlib_test.cc
@@ -0,0 +1,17 @@
+#define STRINGLIB_DEBUG
+#include "stringlib.h"
+
+using namespace std;
+struct print {
+ template <class S>
+ void operator()(S const& s) const {
+ cout<<s<<endl;
+ }
+};
+
+int main(int argc, char *argv[]) {
+ char *p=" 1 are u 2 serious?";
+ std::string const& w="verylongword";
+ VisitTokens(p,print());
+ VisitTokens(w,print());
+}