forked from GitHub/gf-core
Made meta probs an optional argument instead of hard-coded in pgf-translate
This commit is contained in:
@@ -49,8 +49,8 @@ int main(int argc, char* argv[]) {
|
|||||||
// Create the pool that is used to allocate everything
|
// Create the pool that is used to allocate everything
|
||||||
GuPool* pool = gu_new_pool();
|
GuPool* pool = gu_new_pool();
|
||||||
int status = EXIT_SUCCESS;
|
int status = EXIT_SUCCESS;
|
||||||
if (argc != 5) {
|
if (argc < 5 || argc > 6) {
|
||||||
fprintf(stderr, "usage: %s pgf cat from_lang to_lang\n", argv[0]);
|
fprintf(stderr, "usage: %s pgf cat from-lang to-lang [probs-file]\n", argv[0]);
|
||||||
status = EXIT_FAILURE;
|
status = EXIT_FAILURE;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@@ -74,11 +74,14 @@ int main(int argc, char* argv[]) {
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
pgf_load_meta_child_probs(pgf, "../../../treebanks/PennTreebank/ParseEngAbs3.probs", pool, err);
|
if (argc == 6) {
|
||||||
if (!gu_ok(err)) {
|
char* meta_probs_filename = argv[5];
|
||||||
fprintf(stderr, "Loading meta child probs failed\n");
|
pgf_load_meta_child_probs(pgf, meta_probs_filename, pool, err);
|
||||||
status = EXIT_FAILURE;
|
if (!gu_ok(err)) {
|
||||||
goto fail;
|
fprintf(stderr, "Loading meta child probs failed\n");
|
||||||
|
status = EXIT_FAILURE;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look up the source and destination concrete categories
|
// Look up the source and destination concrete categories
|
||||||
|
|||||||
Reference in New Issue
Block a user