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

Method WordDirection

deps/tesseract/ccmain/ltrresultiterator.cpp:202–213  ·  view source on GitHub ↗

Return the overall directionality of this word.

Source from the content-addressed store, hash-verified

200
201// Return the overall directionality of this word.
202StrongScriptDirection LTRResultIterator::WordDirection() const {
203 if (it_->word() == NULL) return DIR_NEUTRAL;
204 bool has_rtl = it_->word()->AnyRtlCharsInWord();
205 bool has_ltr = it_->word()->AnyLtrCharsInWord();
206 if (has_rtl && !has_ltr)
207 return DIR_RIGHT_TO_LEFT;
208 if (has_ltr && !has_rtl)
209 return DIR_LEFT_TO_RIGHT;
210 if (!has_ltr && !has_rtl)
211 return DIR_NEUTRAL;
212 return DIR_MIX;
213}
214
215// Returns true if the current word was found in a dictionary.
216bool LTRResultIterator::WordIsFromDictionary() const {

Callers 4

CurrentParagraphIsLtrMethod · 0.80
GetHOCRTextMethod · 0.80
GetPDFTextObjectsMethod · 0.80

Calls 3

AnyRtlCharsInWordMethod · 0.80
AnyLtrCharsInWordMethod · 0.80
wordMethod · 0.45

Tested by

no test coverage detected