Commit Graph

221 Commits

Author SHA1 Message Date
Tetsuo Kiso
fa43a88d46 Fix a memory leak. 2012-02-20 11:04:21 +09:00
Tetsuo Kiso
e749924706 Add 'virtual' to destructors. 2012-02-20 10:23:59 +09:00
Tetsuo Kiso
8c3b82e596 Change the naming conventions for the guard macros; Rename TER directory.
This change might be useful to avoid duplicating the names.
The reason is that although MERT programs are standalone
applications, some header files such as data.h and
point.h have common guard macro names like "DATA_H" and
"POINT_H", and this is not good naming conventions
when you want to include external headers.
Some files actually include headers in Moses and KenLM's util.
2012-02-20 09:46:08 +09:00
Tetsuo Kiso
94888b258d Fix typo. 2012-02-20 08:29:53 +09:00
Tetsuo Kiso
232e514774 Add comments; remove unused macros. 2012-02-20 08:20:44 +09:00
Tetsuo Kiso
faab4b214d Put global variables in mert/util.cpp in anonymous space.
We do not allow clients to access the following variables.
Instead, use the APIs which we provide for that.

Also, remove the unused function, and fix smoke tests.
2012-02-20 08:02:23 +09:00
Tetsuo Kiso
8c7dfe04e7 Bug fix: tokenizer used in mert; add unit tests for that.
When tokenizing a string delimited by spaces (say, "9 9 8 7 ")
with Tokenize(), resulting a sequence of strings are
{"9", "9", "8", "7", "" }, which is different
from we have expected. We are not interested in empty strings.

This commit fix this issue, and add unit tests for
the tokenize functions.
2012-02-20 07:39:24 +09:00
Tetsuo Kiso
4b6232b757 Add error checking to setup 'to_optimize'.
mert will check whether the dimension and the number of
fetures are equal.
2012-02-17 09:16:10 +09:00
Tetsuo Kiso
c5e7e4cea7 Bug fix mert: when you want to optimize fewer features.
This commit is a temporary bug fix.
2012-02-17 08:25:18 +09:00
Tetsuo Kiso
47b535ee0a Add a utility function to FeatureData for debugging. 2012-02-17 07:27:07 +09:00
Tetsuo Kiso
91645503e8 Delete mert/sample/README; Add smoke tests.
Replace README with a bunch of shell script
for smoke testing of MERT.

The README file was not a typical README file.
It was like a sample script to run mert and
extractor, so I renamed it as smoke tests stuff.
2012-02-17 03:53:52 +09:00
Barry Haddow
69afc63fb0 Merge branch 'master' of github.com:moses-smt/mosesdecoder 2012-02-08 17:48:19 +00:00
Barry Haddow
757f08a141 Really simple sharding test 2012-02-08 17:47:54 +00:00
Barry Haddow
752724594e Fix sharding bug 2012-02-08 17:11:56 +00:00
Tetsuo Kiso
270809fa97 Move funcions defined in a header into .cpp file. 2012-02-01 21:44:37 +09:00
Tetsuo Kiso
4e3dd11f53 Remove virtual keyword from whoami() function.
The funtion is neither inherited from Scorer nor
StatisticsBasedScorer.
2012-02-01 21:36:25 +09:00
Tetsuo Kiso
4051f723f7 Move funcionts used in StatisticsBasedScorer into anonymous namespace.
And add 'inline' keyword to the functions.
2012-02-01 21:30:50 +09:00
Tetsuo Kiso
ae5a58da89 Create a initialize function. 2012-02-01 21:26:47 +09:00
Tetsuo Kiso
92434a2293 Create private class to encapssulate encoding process.
Instead of using typedefs inside a class only,
it might be better to create a private class to do same things.
2012-02-01 21:19:25 +09:00
Tetsuo Kiso
c5f8c7d33a Move regularizaion type into StatisticsBasedScorer.
The type is used as internal purpose.
2012-02-01 20:58:49 +09:00
Tetsuo Kiso
cb729ad3a5 Add prefix 'm_' to private and protected members in Scorer classes. 2012-02-01 20:54:20 +09:00
Tetsuo Kiso
947e30ac3b Delete unused enums. 2012-02-01 20:26:25 +09:00
Tetsuo Kiso
3ac41ff2d7 Move reference length type into a private member of BleuScorer.
The reason is that the type is used as internal purpose.
2012-02-01 20:24:48 +09:00
Tetsuo Kiso
671a2f8c33 Bug fix: memory leak issues when using MergeScorer. 2012-02-01 18:13:32 +09:00
Tetsuo Kiso
4373c07cf0 Change casts to C++ style casts. 2012-02-01 18:13:00 +09:00
Tetsuo Kiso
194e24115a Change casts to C++ style casts, and delete unnecessary casts. 2012-02-01 17:17:58 +09:00
Tetsuo Kiso
380f550cf3 Create a function to save final weights to a file. 2012-02-01 16:59:48 +09:00
Tetsuo Kiso
2a7d2a395f Use a constant instead of hard-coding. 2012-02-01 16:51:25 +09:00
Tetsuo Kiso
79fd25d0c4 Pass std::string objects by const reference instead of by value. 2012-02-01 16:46:36 +09:00
Tetsuo Kiso
12ccef6d50 Rename too short variables.
'D' and 'O' is hard to find when you might want to
search by command line tools such as grep.
2012-02-01 16:39:38 +09:00
Tetsuo Kiso
b7507a84b2 Add constans to prevent avoid hard coding many times.
Default filenames in usage() were differen from the actual ones.
2012-02-01 16:33:23 +09:00
Tetsuo Kiso
5b30f52fbe Add whitespaces. 2012-02-01 16:15:22 +09:00
Tetsuo Kiso
cac1e14d50 Add 'virtual' keyword for functions in OptimizationTask.
Adding 'virtual' keyword for an inherited virtual function is good
practice because it will let the users know where the function
comes from.
2012-02-01 15:49:33 +09:00
Tetsuo Kiso
7c843dbe3f Create a struct for command line options in mert. 2012-02-01 15:21:49 +09:00
Tetsuo Kiso
3c9f44494e Delete unused variables. 2012-02-01 12:37:41 +09:00
Tetsuo Kiso
d4b9536d43 Introduce anonymous namespace. 2012-02-01 12:35:50 +09:00
Tetsuo Kiso
345448f950 Add whitespaces. 2012-02-01 12:29:45 +09:00
Tetsuo Kiso
99f4158d44 Create a struct for command line options in extractor. 2012-02-01 12:23:15 +09:00
Tetsuo Kiso
4fb90867b0 Create a wrapper function to init seed.
Move g_bootstrap from a global variable to
a member of struct ProgramOption.
2012-02-01 11:49:26 +09:00
Tetsuo Kiso
ad24930547 Create a struct for command line options.
Add a wrapper function to parse the options, too.
2012-02-01 11:27:17 +09:00
Tetsuo Kiso
8d5e0cbe02 Create a utility class for mert/evaluator.cpp to avoid name collisions, just in case.
And introduce anonymous namespace for the class and global variables
as well.
2012-01-27 04:06:36 +09:00
Tetsuo Kiso
0bf69e840a Add whitespaces. 2012-01-27 03:39:13 +09:00
Tetsuo Kiso
cd292a2449 Add prefixe 'g_' to global variables in mert/evaluator.cpp
While the size of mert/evaluator.cpp is still relatively small,
adding the marker to the variables allows us to easily distinguish
them from local variables.
2012-01-27 03:24:51 +09:00
Matous Machacek
b3096acdec mert/evaluator should now compute confidence interval correctly 2012-01-24 21:25:15 +01:00
Matous Machacek
40f720aee6 fixed bugs in mert/evaluator, nicer printing of results 2012-01-24 19:18:44 +01:00
Matous Machacek
05aa103d5f mert/evaluator can compute more metrics at once 2012-01-22 01:01:08 +01:00
cservan
9ad507d19e Fix the memory overflow 2011-12-23 11:14:34 +01:00
Hieu Hoang
ca0a3ea870 uint -> size_t 2011-12-12 23:27:27 +07:00
Hieu Hoang
21009b5d1e revert 2011-12-12 20:48:42 +07:00
Tetsuo Kiso
95653828f9 Pass by reference. 2011-12-08 14:18:37 +09:00