diff options
author | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-06-05 11:23:34 +0400 |
---|---|---|
committer | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-06-05 11:23:34 +0400 |
commit | 281bf610b87a02c762cf2bece152e99c184069fa (patch) | |
tree | e11bb70d149d87574f2c04f1bbd2521afb081d85 /mert/Util.cpp | |
parent | 1b44c7c445ead80485186c1c92b18cfbd3b7992e (diff) |
added binary read/load facility for feature data
added names of features in the header
added methods to access the features by name
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1819 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert/Util.cpp')
-rw-r--r-- | mert/Util.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mert/Util.cpp b/mert/Util.cpp index 4f113ebe0..e7f263fdd 100644 --- a/mert/Util.cpp +++ b/mert/Util.cpp @@ -92,3 +92,14 @@ outputfilestream::~outputfilestream() void outputfilestream::close() { } + +int swapbytes(char *p, int sz, int n) +{ + char c, *l, *h; + + if((n<1) || (sz<2)) return 0; + for(; n--; p+=sz) for(h=(l=p)+sz; --h>l; l++) { c=*h; *h=*l; *l=c; } + return 0; + +}; + |