+static DatabaseNode *findchar_unique(const FindCharArgs *fca, int *match_rx) {
+ DatabaseNode *uniquematch= 0;
+ int ctxi;
+
+ debugf("OCR lx=%d ct_state=%x ", fca->x, fca->ctxmap);
+ for (ctxi=0; ctxi<NCONTEXTS; ctxi++) {
+ if (!(fca->ctxmap & (1u << ctxi))) continue;
+ debugf(" || %s",context_names[ctxi]);
+
+ DatabaseNode *match=
+ findchar_1ctx(fca, &fca->rd->contexts[ctxi], match_rx);
+ if (!match) continue;
+
+ if (uniquematch && strcmp(match->str, uniquematch->str)) {
+ debugf( " ambiguous");
+ uniquematch= 0;
+ } else {
+ uniquematch= match;
+ }
+ }
+
+ return uniquematch;
+}
+
+const char *ocr_celltype_name(OcrCellType ct) { return ct->name; }
+