tesseract v5.3.3.20231005
tesseract::TableFinderTest Class Reference
Inheritance diagram for tesseract::TableFinderTest:
testing::Test

Protected Member Functions

void SetUp () override
 
void TearDown () override
 
void MakePartition (int x_min, int y_min, int x_max, int y_max)
 
void MakePartition (int x_min, int y_min, int x_max, int y_max, int first_column, int last_column)
 
void InsertTextPartition (ColPartition *part)
 
void InsertLeaderPartition (int x_min, int y_min, int x_max, int y_max)
 
void InsertLeaderPartition (int x_min, int y_min, int x_max, int y_max, int first_column, int last_column)
 
void DeletePartitionListBoxes ()
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void SetUp ()
 
virtual void TearDown ()
 

Protected Attributes

std::unique_ptr< TestableTableFinderfinder_
 
std::unique_ptr< ColPartitionpartition_
 

Additional Inherited Members

- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestSuite ()
 
static void TearDownTestSuite ()
 
static void TearDownTestCase ()
 
static void SetUpTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool IsSkipped ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 

Detailed Description

Definition at line 61 of file tablefind_test.cc.

Member Function Documentation

◆ DeletePartitionListBoxes()

void tesseract::TableFinderTest::DeletePartitionListBoxes ( )
inlineprotected

Definition at line 118 of file tablefind_test.cc.

118 {
119 for (free_boxes_it_.mark_cycle_pt(); !free_boxes_it_.cycled_list(); free_boxes_it_.forward()) {
120 ColPartition *part = free_boxes_it_.data();
121 part->DeleteBoxes();
122 }
123 }

◆ InsertLeaderPartition() [1/2]

void tesseract::TableFinderTest::InsertLeaderPartition ( int  x_min,
int  y_min,
int  x_max,
int  y_max 
)
inlineprotected

Definition at line 102 of file tablefind_test.cc.

102 {
103 InsertLeaderPartition(x_min, y_min, x_max, y_max, 0, 0);
104 }
void InsertLeaderPartition(int x_min, int y_min, int x_max, int y_max)

◆ InsertLeaderPartition() [2/2]

void tesseract::TableFinderTest::InsertLeaderPartition ( int  x_min,
int  y_min,
int  x_max,
int  y_max,
int  first_column,
int  last_column 
)
inlineprotected

Definition at line 106 of file tablefind_test.cc.

107 {
108 TBOX box;
109 box.set_to_given_coords(x_min, y_min, x_max, y_max);
110 ColPartition *part =
112 part->set_first_column(first_column);
113 part->set_last_column(last_column);
114 finder_->InsertLeaderPartition(part);
115 free_boxes_it_.add_after_then_move(part);
116 }
@ TBOX
@ BRT_UNKNOWN
Definition: blobbox.h:80
@ BTFT_LEADER
Definition: blobbox.h:117
@ PT_FLOWING_TEXT
Definition: publictypes.h:53
static ColPartition * FakePartition(const TBOX &box, PolyBlockType block_type, BlobRegionType blob_type, BlobTextFlowType flow)
std::unique_ptr< TestableTableFinder > finder_

◆ InsertTextPartition()

void tesseract::TableFinderTest::InsertTextPartition ( ColPartition part)
inlineprotected

Definition at line 97 of file tablefind_test.cc.

97 {
98 finder_->InsertTextPartition(part);
99 free_boxes_it_.add_after_then_move(part);
100 }

◆ MakePartition() [1/2]

void tesseract::TableFinderTest::MakePartition ( int  x_min,
int  y_min,
int  x_max,
int  y_max 
)
inlineprotected

Definition at line 81 of file tablefind_test.cc.

81 {
82 MakePartition(x_min, y_min, x_max, y_max, 0, 0);
83 }
void MakePartition(int x_min, int y_min, int x_max, int y_max)

◆ MakePartition() [2/2]

void tesseract::TableFinderTest::MakePartition ( int  x_min,
int  y_min,
int  x_max,
int  y_max,
int  first_column,
int  last_column 
)
inlineprotected

Definition at line 85 of file tablefind_test.cc.

86 {
87 if (partition_.get() != nullptr) {
88 partition_->DeleteBoxes();
89 }
90 TBOX box;
91 box.set_to_given_coords(x_min, y_min, x_max, y_max);
93 partition_->set_first_column(first_column);
94 partition_->set_last_column(last_column);
95 }
@ BTFT_NONE
Definition: blobbox.h:111
std::unique_ptr< ColPartition > partition_

◆ SetUp()

void tesseract::TableFinderTest::SetUp ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 63 of file tablefind_test.cc.

63 {
64 std::locale::global(std::locale(""));
65 free_boxes_it_.set_to_list(&free_boxes_);
66 finder_ = std::make_unique<TestableTableFinder>();
67 finder_->Init(1, ICOORD(0, 0), ICOORD(500, 500));
68 // gap finding
69 finder_->set_global_median_xheight(5);
70 finder_->set_global_median_blob_width(5);
71 }

◆ TearDown()

void tesseract::TableFinderTest::TearDown ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 73 of file tablefind_test.cc.

73 {
74 if (partition_.get() != nullptr) {
75 partition_->DeleteBoxes();
76 }
78 finder_.reset(nullptr);
79 }

Member Data Documentation

◆ finder_

std::unique_ptr<TestableTableFinder> tesseract::TableFinderTest::finder_
protected

Definition at line 125 of file tablefind_test.cc.

◆ partition_

std::unique_ptr<ColPartition> tesseract::TableFinderTest::partition_
protected

Definition at line 126 of file tablefind_test.cc.


The documentation for this class was generated from the following file: