|
void | SetUp () override |
|
void | LoadWordlist (const std::string &filename, std::set< std::string > *words) const |
|
std::string | TessBinaryPath (const std::string &name) const |
|
std::string | OutputNameToPath (const std::string &name) const |
|
int | RunCommand (const std::string &program, const std::string &arg1, const std::string &arg2, const std::string &arg3) const |
|
void | TestDawgRoundTrip (const std::string &unicharset_filename, const std::string &wordlist_filename) const |
|
| Test () |
|
virtual void | SetUp () |
|
virtual void | TearDown () |
|
Definition at line 34 of file dawg_test.cc.
◆ LoadWordlist()
void tesseract::DawgTest::LoadWordlist |
( |
const std::string & |
filename, |
|
|
std::set< std::string > * |
words |
|
) |
| const |
|
inlineprotected |
Definition at line 41 of file dawg_test.cc.
41 {
42 std::ifstream
file(filename);
44 std::string line;
45 while (getline(
file, line)) {
46
47 while (!line.empty() && (line.back() == '\n' || line.back() == '\r')) {
48 line.resize(line.size() - 1);
49 }
50
51 words->insert(line.c_str());
52 }
54 }
55 }
◆ OutputNameToPath()
std::string tesseract::DawgTest::OutputNameToPath |
( |
const std::string & |
name | ) |
const |
|
inlineprotected |
Definition at line 59 of file dawg_test.cc.
59 {
61 }
static std::string JoinPath(const std::string &s1, const std::string &s2)
◆ RunCommand()
int tesseract::DawgTest::RunCommand |
( |
const std::string & |
program, |
|
|
const std::string & |
arg1, |
|
|
const std::string & |
arg2, |
|
|
const std::string & |
arg3 |
|
) |
| const |
|
inlineprotected |
Definition at line 62 of file dawg_test.cc.
63 {
64 std::string cmdline =
TessBinaryPath(program) +
" " + arg1 +
" " + arg2 +
" " + arg3;
65 return system(cmdline.c_str());
66 }
std::string TessBinaryPath(const std::string &name) const
◆ SetUp()
void tesseract::DawgTest::SetUp |
( |
| ) |
|
|
inlineoverrideprotectedvirtual |
◆ TessBinaryPath()
std::string tesseract::DawgTest::TessBinaryPath |
( |
const std::string & |
name | ) |
const |
|
inlineprotected |
◆ TestDawgRoundTrip()
void tesseract::DawgTest::TestDawgRoundTrip |
( |
const std::string & |
unicharset_filename, |
|
|
const std::string & |
wordlist_filename |
|
) |
| const |
|
inlineprotected |
Definition at line 70 of file dawg_test.cc.
71 {
72 std::set<std::string> orig_words, roundtrip_words;
73 std::string unicharset =
file::JoinPath(TESTING_DIR, unicharset_filename);
74 std::string orig_wordlist =
file::JoinPath(TESTING_DIR, wordlist_filename);
82 }
#define EXPECT_EQ(val1, val2)
#define dawg2wordlist_prog
#define wordlist2dawg_prog
int RunCommand(const std::string &program, const std::string &arg1, const std::string &arg2, const std::string &arg3) const
void LoadWordlist(const std::string &filename, std::set< std::string > *words) const
std::string OutputNameToPath(const std::string &name) const
The documentation for this class was generated from the following file:
- /media/home/debian/src/github/tesseract-ocr/tesseract/unittest/dawg_test.cc