MCPcopy Create free account
hub / github.com/creatale/node-dv / ValidBodyLine

Method ValidBodyLine

deps/tesseract/ccstruct/ocrpara.cpp:63–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63bool ParagraphModel::ValidBodyLine(int lmargin, int lindent,
64 int rindent, int rmargin) const {
65 switch (justification_) {
66 case JUSTIFICATION_LEFT:
67 return NearlyEqual(lmargin + lindent, margin_ + body_indent_,
68 tolerance_);
69 case JUSTIFICATION_RIGHT:
70 return NearlyEqual(rmargin + rindent, margin_ + body_indent_,
71 tolerance_);
72 case JUSTIFICATION_CENTER:
73 return NearlyEqual(lindent, rindent, tolerance_ * 2);
74 default:
75 // shouldn't happen
76 return false;
77 }
78}
79
80bool ParagraphModel::Comparable(const ParagraphModel &other) const {
81 if (justification_ != other.justification_)

Callers 1

ValidBodyLineFunction · 0.80

Calls 1

NearlyEqualFunction · 0.85

Tested by

no test coverage detected