diff options
author | jfouet <jfouet@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-05-15 15:06:32 +0400 |
---|---|---|
committer | jfouet <jfouet@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-05-15 15:06:32 +0400 |
commit | 94d47101cae71158754f6a9f0ef46ad9b58545cb (patch) | |
tree | 2f717e843d919deee707ee72a2f4a11bb6ca5537 /mert | |
parent | bfe36611108453efefa0ae0cba384c4f7dac4ebb (diff) |
add (almost empty) main
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1696 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert')
-rwxr-xr-x | mert/Makefile | 6 | ||||
-rwxr-xr-x | mert/mert.cpp | 42 |
2 files changed, 45 insertions, 3 deletions
diff --git a/mert/Makefile b/mert/Makefile index 4f6328622..35caf0dd4 100755 --- a/mert/Makefile +++ b/mert/Makefile @@ -17,7 +17,7 @@ LDFLAGS= LDLIBS=-lm all: \ -main \ +mert \ feature_extractor \ extractor \ test_scorer @@ -34,8 +34,8 @@ feature_extractor: $(OBJS) feature_extractor.cpp extractor: $(OBJS) extractor.cpp $(GCC) $(CFLAGS) $(OBJS) $(LDLIBS) -o $@ $@.cpp -#main: $(OBJS) main.cpp -# $(GCC) $(CFLAGS) $(OBJS) $(LDLIBS) -o $@ $@.cpp +main: $(OBJS) mert.cpp + $(GCC) $(CFLAGS) $(OBJS) $(LDLIBS) -o $@ $@.cpp test_scorer: $(OBJS) test_scorer.cpp $(GCC) $(CFLAGS) $(OBJS) $(LDLIBS) -o $@ $@.cpp diff --git a/mert/mert.cpp b/mert/mert.cpp new file mode 100755 index 000000000..275d8c9c6 --- /dev/null +++ b/mert/mert.cpp @@ -0,0 +1,42 @@ + +#include <limits> +#include "Data.h" +#include "Point.h" +#include "Scorer.h" +#include "ScoreData.h" +#include "FeatureData.h" +#include "Optimizer.h" + +int verbose = 2; + +float min_interval = 1e-3; + +void usage(void) { + fprintf(stderr, "usage: mert -d <dimensions>\n"); + exit(1); +} + +int main (int argc, char **argv) { + int i, c,dim; + + + while ((c = getopt(argc, argv, "d:n:")) != -1) { + switch (c) { + case 'd': + dim = strtol(optarg, NULL, 10); + break; + case 'n': + //TODO + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (dim < 0) + usage(); + + +} |