void ReportWordFormHeader(Rpt *rpt, Discourse *dc) { RptStartLine(rpt); RptAddConcept(rpt, N("quantity"), dc); RptAddConcept(rpt, N("suffix"), dc); RptAdd(rpt, "", RPT_JUST_LEFT); RptAdd(rpt, "", RPT_JUST_LEFT); RptAddConcept(rpt, N("suffix"), dc); RptAdd(rpt, "", RPT_JUST_LEFT); RptAdd(rpt, "", RPT_JUST_LEFT); RptAddConcept(rpt, N("example"), dc); RptAddConcept(rpt, N("example"), dc); }
void RptAddFeaturesAbbrev(Rpt *rpt, char *features, int force, char *except, Discourse *dc) { char buf[PHRASELEN]; GenFeaturesAbbrevString(features, 0, force, except, dc, PHRASELEN, buf); RptAdd(rpt, buf, RPT_JUST_LEFT); }
void RptAddConcept(Rpt *rpt, Obj *obj, Discourse *dc) { char buf[PHRASELEN]; GenConceptString(obj, N("empty-article"), F_NOUN, F_NULL, DC(dc).lang, F_NULL, F_NULL, F_NULL, PHRASELEN, 0, 1, dc, buf); RptAdd(rpt, buf, RPT_JUST_LEFT); }
void ReportWordFormLine1(char *index, WordFormRule *wfr) { if (wfr->count <= WORDFORM_COUNT_THRESH) return; RptStartLine(ReportWordFormRpt); RptAddInt(ReportWordFormRpt, wfr->count, ReportWordFormDc); RptAdd(ReportWordFormRpt, wfr->suffix1, RPT_JUST_LEFT); RptAddFeaturesAbbrev(ReportWordFormRpt, wfr->lefeat1, 1, "", ReportWordFormDc); RptAddFeaturesAbbrev(ReportWordFormRpt, wfr->linkfeat1, 1, "", ReportWordFormDc); RptAdd(ReportWordFormRpt, wfr->suffix2, RPT_JUST_LEFT); RptAddFeaturesAbbrev(ReportWordFormRpt, wfr->lefeat2, 1, "", ReportWordFormDc); RptAddFeaturesAbbrev(ReportWordFormRpt, wfr->linkfeat2, 1, "", ReportWordFormDc); RptAdd(ReportWordFormRpt, wfr->example1->srcphrase, RPT_JUST_LEFT); RptAdd(ReportWordFormRpt, wfr->example2->srcphrase, RPT_JUST_LEFT); }
void RptAddList(Rpt *rpt, ObjList *objs, int justif, Discourse *dc) { char buf[PHRASELEN]; ObjList *p; for (p = objs; p; p = p->next) { GenConceptString(p->obj, N("empty-article"), F_NOUN, F_NULL, DC(dc).lang, F_NULL, F_NULL, F_NULL, PHRASELEN, 1, 1, dc, buf); RptAdd(rpt, buf, justif); } }
void RptAddFloat(Rpt *rpt, Float x, Discourse *dc) { char buf[PHRASELEN]; sprintf(buf, "%g", x); RptAdd(rpt, buf, RPT_JUST_RIGHT); }
void RptAddLong(Rpt *rpt, long i, Discourse *dc) { char buf[PHRASELEN]; sprintf(buf, "%ld", i); RptAdd(rpt, buf, RPT_JUST_RIGHT); }
void RptAddInt(Rpt *rpt, int i, Discourse *dc) { char buf[PHRASELEN]; sprintf(buf, "%d", i); RptAdd(rpt, buf, RPT_JUST_RIGHT); }
void RptAddFeatAbbrev(Rpt *rpt, int feature, int force, Discourse *dc) { char *s; s = GenFeatAbbrevString(feature, force, dc); RptAdd(rpt, s, RPT_JUST_LEFT); }
void RptAddTs(Rpt *rpt, Ts *ts, Discourse *dc) { char buf[PHRASELEN]; TsToString(ts, 0, PHRASELEN, buf); RptAdd(rpt, buf, RPT_JUST_LEFT); }