tesseract
3.03
|
#include <assert.h>
#include "clst.h"
#include "elst.h"
#include "genericvector.h"
#include "matrix.h"
#include "unichar.h"
#include "unicharset.h"
#include "werd.h"
Go to the source code of this file.
typedef GenericVector<BLOB_CHOICE_LIST *> BLOB_CHOICE_LIST_VECTOR |
enum BlobChoiceClassifier |
Definition at line 39 of file ratngs.h.
{ BCC_STATIC_CLASSIFIER, // From the char_norm classifier. BCC_ADAPTED_CLASSIFIER, // From the adaptive classifier. BCC_SPECKLE_CLASSIFIER, // Backup for failed classification. BCC_AMBIG, // Generated by ambiguity detection. BCC_FAKE, // From some other process. };
enum PermuterType |
Definition at line 225 of file ratngs.h.
{ NO_PERM, // 0 PUNC_PERM, // 1 TOP_CHOICE_PERM, // 2 LOWER_CASE_PERM, // 3 UPPER_CASE_PERM, // 4 NGRAM_PERM, // 5 NUMBER_PERM, // 6 USER_PATTERN_PERM, // 7 SYSTEM_DAWG_PERM, // 8 DOC_DAWG_PERM, // 9 USER_DAWG_PERM, // 10 FREQ_DAWG_PERM, // 11 COMPOUND_PERM, // 12 NUM_PERMUTER_TYPES };
bool EqualIgnoringCaseAndTerminalPunct | ( | const WERD_CHOICE & | word1, |
const WERD_CHOICE & | word2 | ||
) |
Definition at line 792 of file ratngs.cpp.
{ const UNICHARSET *uchset = word1.unicharset(); if (word2.unicharset() != uchset) return false; int w1start, w1end; word1.punct_stripped(&w1start, &w1end); int w2start, w2end; word2.punct_stripped(&w2start, &w2end); if (w1end - w1start != w2end - w2start) return false; for (int i = 0; i < w1end - w1start; i++) { if (uchset->to_lower(word1.unichar_id(w1start + i)) != uchset->to_lower(word2.unichar_id(w2start + i))) { return false; } } return true; }
BLOB_CHOICE* FindMatchingChoice | ( | UNICHAR_ID | char_id, |
BLOB_CHOICE_LIST * | bc_list | ||
) |
Definition at line 161 of file ratngs.cpp.
{ // Find the corresponding best BLOB_CHOICE. BLOB_CHOICE_IT choice_it(bc_list); for (choice_it.mark_cycle_pt(); !choice_it.cycled_list(); choice_it.forward()) { BLOB_CHOICE* choice = choice_it.data(); if (choice->unichar_id() == char_id) { return choice; } } return NULL; }
void print_ratings_list | ( | const char * | msg, |
BLOB_CHOICE_LIST * | ratings, | ||
const UNICHARSET & | current_unicharset | ||
) |
print_ratings_list
Send all the ratings out to the logfile.
msg | intro message |
ratings | list of ratings |
current_unicharset | unicharset that can be used for id-to-unichar conversion |
Definition at line 820 of file ratngs.cpp.
{ if (ratings->length() == 0) { tprintf("%s:<none>\n", msg); return; } if (*msg != '\0') { tprintf("%s\n", msg); } BLOB_CHOICE_IT c_it; c_it.set_to_list(ratings); for (c_it.mark_cycle_pt(); !c_it.cycled_list(); c_it.forward()) { c_it.data()->print(¤t_unicharset); if (!c_it.at_last()) tprintf("\n"); } tprintf("\n"); fflush(stdout); }