提交 c7e9ec8f 编写于 作者: T theraysmith

Misc improvements

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@55 d0cd1f9f-072b-0410-8dd7-cf729c803f20
上级 974bfda1
......@@ -67,17 +67,17 @@ CHOICES append_choice(CHOICES ratings,
* Copy a list of choices. This means that there will be two copies
* in memory.
**********************************************************************/
CHOICES copy_choices(CHOICES choices) {
CHOICES copy_choices(CHOICES choices) {
CHOICES l;
CHOICES result = NIL;
iterate_list(l, choices) {
iterate_list(l, choices) {
result = push (result,
(LIST) new_choice (class_string (first (l)),
class_probability (first (l)),
class_certainty (first (l)),
class_config (first (l)),
class_permuter (first (l))));
(LIST) new_choice (class_string (first_node (l)),
class_probability (first_node (l)),
class_certainty (first_node (l)),
class_config (first_node (l)),
class_permuter (first_node (l))));
}
return (reverse_d (result));
}
......@@ -96,7 +96,7 @@ void free_choice(void *arg) { //LIST choice)
if (this_choice) {
if (this_choice->string)
strfree (this_choice->string);
oldchoice(this_choice);
oldchoice(this_choice);
}
}
......@@ -139,12 +139,12 @@ void print_choices( /* List of (A_CHOICE*) */
if (rating == NIL)
cprintf (" No rating ");
iterate(rating) {
iterate(rating) {
if (first_one && show_bold) {
cprintf ("|");
len = sprintf (str, " %s ", best_string (rating));
print_bold(str);
print_bold(str);
while (len++ < 8)
cprintf (" ");
}
......
......@@ -79,7 +79,7 @@ typedef struct choicestruct
* Return the string corresponding to the best choice.
**********************************************************************/
#define best_string(choices) \
(first (choices) ? ((A_CHOICE*) (first (choices)))->string : NULL)
(first_node (choices) ? ((A_CHOICE*) (first_node (choices)))->string : NULL)
/**********************************************************************
* best_probability
......@@ -87,7 +87,7 @@ typedef struct choicestruct
* Return the probability of the best choice.
**********************************************************************/
#define best_probability(choices) \
(((A_CHOICE*) (first (choices)))->rating)
(((A_CHOICE*) (first_node (choices)))->rating)
/**********************************************************************
* best_certainty
......@@ -95,7 +95,7 @@ typedef struct choicestruct
* Return the certainty of the best choice.
**********************************************************************/
#define best_certainty(choices) \
(((A_CHOICE*) (first (choices)))->certainty)
(((A_CHOICE*) (first_node (choices)))->certainty)
/**********************************************************************
* class_probability
......@@ -177,7 +177,7 @@ CHOICES append_choice(CHOICES ratings,
float certainty,
INT8 config);
CHOICES copy_choices(CHOICES choices);
CHOICES copy_choices(CHOICES choices);
void free_choice(void *arg); //LIST choice);
......@@ -187,5 +187,5 @@ A_CHOICE *new_choice(const char *string,
INT8 config,
char permuter);
void print_choices(const char *label, CHOICES rating);
void print_choices(const char *label, CHOICES rating);
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册