diff options
| author | peter.ljunglof <peter.ljunglof@gu.se> | 2013-01-08 10:20:46 +0000 |
|---|---|---|
| committer | peter.ljunglof <peter.ljunglof@gu.se> | 2013-01-08 10:20:46 +0000 |
| commit | 49022f584991d7f26daa559d10eaebc4bbc2aed2 (patch) | |
| tree | a533c28b48fdd90d5d3f02051ab11a0960f03782 /src/runtime/c/utils/pgf-translate.c | |
| parent | 599b51830fc2ef49b6b55f311a7df84bdfee6090 (diff) | |
Made meta probs an optional argument instead of hard-coded in pgf-translate
Diffstat (limited to 'src/runtime/c/utils/pgf-translate.c')
| -rw-r--r-- | src/runtime/c/utils/pgf-translate.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/runtime/c/utils/pgf-translate.c b/src/runtime/c/utils/pgf-translate.c index 2a5539050..ea3cca5af 100644 --- a/src/runtime/c/utils/pgf-translate.c +++ b/src/runtime/c/utils/pgf-translate.c @@ -49,8 +49,8 @@ int main(int argc, char* argv[]) { // Create the pool that is used to allocate everything GuPool* pool = gu_new_pool(); int status = EXIT_SUCCESS; - if (argc != 5) { - fprintf(stderr, "usage: %s pgf cat from_lang to_lang\n", argv[0]); + if (argc < 5 || argc > 6) { + fprintf(stderr, "usage: %s pgf cat from-lang to-lang [probs-file]\n", argv[0]); status = EXIT_FAILURE; goto fail; } @@ -74,11 +74,14 @@ int main(int argc, char* argv[]) { goto fail; } - pgf_load_meta_child_probs(pgf, "../../../treebanks/PennTreebank/ParseEngAbs3.probs", pool, err); - if (!gu_ok(err)) { - fprintf(stderr, "Loading meta child probs failed\n"); - status = EXIT_FAILURE; - goto fail; + if (argc == 6) { + char* meta_probs_filename = argv[5]; + pgf_load_meta_child_probs(pgf, meta_probs_filename, pool, err); + if (!gu_ok(err)) { + fprintf(stderr, "Loading meta child probs failed\n"); + status = EXIT_FAILURE; + goto fail; + } } // Look up the source and destination concrete categories |
