mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-21 08:43:03 +08:00
Replace STRING by std::string in ResultIterator
Signed-off-by: Stefan Weil <sw@weil.de>
This commit is contained in:
parent
a007cbeb57
commit
03884c370c
@ -31,8 +31,6 @@
|
||||
|
||||
namespace tesseract {
|
||||
|
||||
class STRING;
|
||||
|
||||
class Tesseract;
|
||||
|
||||
class TESS_API ResultIterator : public LTRResultIterator {
|
||||
@ -208,10 +206,10 @@ class TESS_API ResultIterator : public LTRResultIterator {
|
||||
* Append any extra marks that should be appended to this word when printed.
|
||||
* Mostly, these are Unicode BiDi control characters.
|
||||
*/
|
||||
void AppendSuffixMarks(STRING* text) const;
|
||||
void AppendSuffixMarks(std::string* text) const;
|
||||
|
||||
/** Appends the current word in reading order to the given buffer.*/
|
||||
void AppendUTF8WordText(STRING* text) const;
|
||||
void AppendUTF8WordText(std::string* text) const;
|
||||
|
||||
/**
|
||||
* Appends the text of the current text line, *assuming this iterator is
|
||||
@ -220,7 +218,7 @@ class TESS_API ResultIterator : public LTRResultIterator {
|
||||
* Each textline is terminated in a single newline character.
|
||||
* If the textline ends a paragraph, it gets a second terminal newline.
|
||||
*/
|
||||
void IterateAndAppendUTF8TextlineText(STRING* text);
|
||||
void IterateAndAppendUTF8TextlineText(std::string* text);
|
||||
|
||||
/**
|
||||
* Appends the text of the current paragraph in reading order
|
||||
@ -228,7 +226,7 @@ class TESS_API ResultIterator : public LTRResultIterator {
|
||||
* Each textline is terminated in a single newline character, and the
|
||||
* paragraph gets an extra newline at the end.
|
||||
*/
|
||||
void AppendUTF8ParagraphText(STRING* text) const;
|
||||
void AppendUTF8ParagraphText(std::string* text) const;
|
||||
|
||||
/** Returns whether the bidi_debug flag is set to at least min_level. */
|
||||
bool BidiDebug(int min_level) const;
|
||||
|
@ -25,8 +25,6 @@
|
||||
#include "unicharset.h"
|
||||
#include "unicodes.h"
|
||||
|
||||
#include <tesseract/strngs.h>
|
||||
|
||||
#include "allheaders.h"
|
||||
|
||||
#include <set>
|
||||
@ -385,7 +383,7 @@ bool ResultIterator::IsAtFirstSymbolOfWord() const {
|
||||
return blob_order.size() == 0 || blob_order[0] == blob_index_;
|
||||
}
|
||||
|
||||
void ResultIterator::AppendSuffixMarks(STRING* text) const {
|
||||
void ResultIterator::AppendSuffixMarks(std::string* text) const {
|
||||
if (!it_->word())
|
||||
return;
|
||||
bool reading_direction_is_ltr =
|
||||
@ -613,7 +611,7 @@ int ResultIterator::BlanksBeforeWord() const {
|
||||
char* ResultIterator::GetUTF8Text(PageIteratorLevel level) const {
|
||||
if (it_->word() == nullptr)
|
||||
return nullptr; // Already at the end!
|
||||
STRING text;
|
||||
std::string text;
|
||||
switch (level) {
|
||||
case RIL_BLOCK: {
|
||||
ResultIterator pp(*this);
|
||||
@ -666,7 +664,7 @@ ResultIterator::GetBestLSTMSymbolChoices() const {
|
||||
}
|
||||
}
|
||||
|
||||
void ResultIterator::AppendUTF8WordText(STRING* text) const {
|
||||
void ResultIterator::AppendUTF8WordText(std::string* text) const {
|
||||
if (!it_->word())
|
||||
return;
|
||||
ASSERT_HOST(it_->word()->best_choice != nullptr);
|
||||
@ -684,7 +682,7 @@ void ResultIterator::AppendUTF8WordText(STRING* text) const {
|
||||
AppendSuffixMarks(text);
|
||||
}
|
||||
|
||||
void ResultIterator::IterateAndAppendUTF8TextlineText(STRING* text) {
|
||||
void ResultIterator::IterateAndAppendUTF8TextlineText(std::string* text) {
|
||||
if (Empty(RIL_WORD)) {
|
||||
Next(RIL_WORD);
|
||||
return;
|
||||
@ -728,7 +726,7 @@ void ResultIterator::IterateAndAppendUTF8TextlineText(STRING* text) {
|
||||
}
|
||||
}
|
||||
|
||||
void ResultIterator::AppendUTF8ParagraphText(STRING* text) const {
|
||||
void ResultIterator::AppendUTF8ParagraphText(std::string* text) const {
|
||||
ResultIterator it(*this);
|
||||
it.RestartParagraph();
|
||||
it.MoveToLogicalStartOfTextline();
|
||||
|
Loading…
Reference in New Issue
Block a user