From cc7ee5e3f6ac08750b80e468b77e8ad732e48b77 Mon Sep 17 00:00:00 2001 From: graehl Date: Tue, 27 Jul 2010 04:59:37 +0000 Subject: fsa feature templated Accum interface, phrase interface allows exceeding markov order e.g. unigram state, 3gram lm. use Accum,set_value rather than clear,add_value. warning: 3gram fsa lm disagrees with bottom-up in 4th decimal place git-svn-id: https://ws10smt.googlecode.com/svn/trunk@431 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/sentences.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'decoder/sentences.h') diff --git a/decoder/sentences.h b/decoder/sentences.h index 452fb21e..4c71f8f1 100755 --- a/decoder/sentences.h +++ b/decoder/sentences.h @@ -29,7 +29,10 @@ inline void wordcpy(WordID *dest,WordID const* src,int n) { inline void wordcpy(WordID *dest,WordID const* src,WordID const* src_end) { wordcpy(dest,src,src_end-src); } - +inline void wordcpy_reverse(WordID *dest,WordID const* src,WordID const* src_end) { + for(WordID const* i=src_end;i>src;) + *dest++=*--i; +} inline Sentence singleton_sentence(WordID t) { return Sentence(1,t); } -- cgit v1.2.3