mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-17 16:59:34 -06:00
complete details for the "ai" command in the C shell
This commit is contained in:
@@ -1467,6 +1467,30 @@ pgf_print_expr_tuple(size_t n_exprs, PgfExpr exprs[], PgfPrintContext* ctxt,
|
||||
gu_putc('>', out, err);
|
||||
}
|
||||
|
||||
PGF_API_DECL void
|
||||
pgf_print_category(PgfPGF *gr, PgfCId catname,
|
||||
GuOut* out, GuExn *err)
|
||||
{
|
||||
PgfAbsCat* abscat =
|
||||
gu_seq_binsearch(gr->abstract.cats, pgf_abscat_order, PgfAbsCat, catname);
|
||||
if (abscat == NULL) {
|
||||
GuExnData* exn = gu_raise(err, PgfExn);
|
||||
exn->data = "Unknown category";
|
||||
return;
|
||||
}
|
||||
|
||||
gu_puts(abscat->name, out, err);
|
||||
|
||||
PgfPrintContext* ctxt = NULL;
|
||||
size_t n_hypos = gu_seq_length(abscat->context);
|
||||
for (size_t i = 0; i < n_hypos; i++) {
|
||||
PgfHypo *hypo = gu_seq_index(abscat->context, PgfHypo, i);
|
||||
|
||||
gu_putc(' ', out, err);
|
||||
ctxt = pgf_print_hypo(hypo, ctxt, 4, out, err);
|
||||
}
|
||||
}
|
||||
|
||||
PGF_API bool
|
||||
pgf_type_eq(PgfType* t1, PgfType* t2)
|
||||
{
|
||||
|
||||
@@ -226,6 +226,10 @@ PGF_API_DECL void
|
||||
pgf_print_expr_tuple(size_t n_exprs, PgfExpr exprs[], PgfPrintContext* ctxt,
|
||||
GuOut* out, GuExn* err);
|
||||
|
||||
PGF_API_DECL void
|
||||
pgf_print_category(PgfPGF *gr, PgfCId catname,
|
||||
GuOut* out, GuExn *err);
|
||||
|
||||
PGF_API prob_t
|
||||
pgf_compute_tree_probability(PgfPGF *gr, PgfExpr expr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user