mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-04 01:39:16 +08:00
Replace GenericVector by std::vector in reject.cpp
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
d62f27dd8f
commit
2257028052
@ -43,12 +43,13 @@ int16_t Tesseract::safe_dict_word(const WERD_RES *werd_res) {
|
|||||||
#include "docqual.h"
|
#include "docqual.h"
|
||||||
#include "tesseractclass.h"
|
#include "tesseractclass.h"
|
||||||
|
|
||||||
#include "genericvector.h"
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
|
#include <algorithm> // for std::sort
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <vector> // for std::vector
|
||||||
|
|
||||||
namespace tesseract {
|
namespace tesseract {
|
||||||
|
|
||||||
@ -230,12 +231,12 @@ float compute_reject_threshold(WERD_CHOICE* word) {
|
|||||||
float gapstart; // bottom of gap
|
float gapstart; // bottom of gap
|
||||||
|
|
||||||
int blob_count = word->length();
|
int blob_count = word->length();
|
||||||
GenericVector<float> ratings;
|
std::vector<float> ratings;
|
||||||
ratings.resize_no_init(blob_count);
|
ratings.reserve(blob_count);
|
||||||
for (int i = 0; i < blob_count; ++i) {
|
for (int i = 0; i < blob_count; ++i) {
|
||||||
ratings[i] = word->certainty(i);
|
ratings.push_back(word->certainty(i));
|
||||||
}
|
}
|
||||||
ratings.sort();
|
std::sort(ratings.begin(), ratings.end());
|
||||||
gapstart = ratings[0] - 1; // all reject if none better
|
gapstart = ratings[0] - 1; // all reject if none better
|
||||||
if (blob_count >= 3) {
|
if (blob_count >= 3) {
|
||||||
for (int index = 0; index < blob_count - 1; index++) {
|
for (int index = 0; index < blob_count - 1; index++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user