tesseract
3.05.02
word_altlist.h
Go to the documentation of this file.
1
/**********************************************************************
2
* File: word_altlist.h
3
* Description: Declaration of the Word Alternate List Class
4
* Author: Ahmad Abdulkader
5
* Created: 2008
6
*
7
* (C) Copyright 2008, Google Inc.
8
** Licensed under the Apache License, Version 2.0 (the "License");
9
** you may not use this file except in compliance with the License.
10
** You may obtain a copy of the License at
11
** http://www.apache.org/licenses/LICENSE-2.0
12
** Unless required by applicable law or agreed to in writing, software
13
** distributed under the License is distributed on an "AS IS" BASIS,
14
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
** See the License for the specific language governing permissions and
16
** limitations under the License.
17
*
18
**********************************************************************/
19
20
// The WordAltList abstracts a alternate list of words and their corresponding
21
// costs that result from the word recognition process. The class inherits
22
// from the AltList class
23
// It provides methods to add a new word alternate, its corresponding score and
24
// a tag.
25
26
#ifndef WORD_ALT_LIST_H
27
#define WORD_ALT_LIST_H
28
29
#include "
altlist.h
"
30
31
namespace
tesseract
{
32
class
WordAltList
:
public
AltList
{
33
public
:
34
explicit
WordAltList
(
int
max_alt);
35
~WordAltList
();
36
// Sort the list of alternates based on cost
37
void
Sort
();
38
// insert an alternate word with the specified cost and tag
39
bool
Insert
(
char_32
*char_ptr,
int
cost,
void
*tag = NULL);
40
// returns the alternate string at the specified position
41
inline
char_32
*
Alt
(
int
alt_idx) {
return
word_alt_[alt_idx]; }
42
// print each entry of the altlist, both UTF8 and unichar ids, and
43
// their costs, to stderr
44
void
PrintDebug
();
45
private
:
46
char_32
**word_alt_;
47
};
48
}
// namespace tesseract
49
50
#endif // WORD_ALT_LIST_H
tesseract::WordAltList::~WordAltList
~WordAltList()
Definition:
word_altlist.cpp:28
tesseract::WordAltList::WordAltList
WordAltList(int max_alt)
Definition:
word_altlist.cpp:23
tesseract::WordAltList::Alt
char_32 * Alt(int alt_idx)
Definition:
word_altlist.h:41
tesseract
Definition:
baseapi.cpp:81
tesseract::WordAltList::PrintDebug
void PrintDebug()
Definition:
word_altlist.cpp:104
tesseract::char_32
signed int char_32
Definition:
string_32.h:40
tesseract::AltList
Definition:
altlist.h:30
altlist.h
tesseract::WordAltList::Insert
bool Insert(char_32 *char_ptr, int cost, void *tag=NULL)
Definition:
word_altlist.cpp:43
tesseract::WordAltList::Sort
void Sort()
Definition:
word_altlist.cpp:84
tesseract::WordAltList
Definition:
word_altlist.h:32
cube
word_altlist.h
Generated on Mon Oct 29 2018 11:27:49 for tesseract by
1.8.14