diff --git a/src/ccmain/paragraphs_internal.h b/src/ccmain/paragraphs_internal.h index 435fcd104e..ccf5334ed0 100644 --- a/src/ccmain/paragraphs_internal.h +++ b/src/ccmain/paragraphs_internal.h @@ -88,7 +88,7 @@ struct LineHypothesis { class ParagraphTheory; // Forward Declaration -typedef GenericVectorEqEq SetOfModels; +using SetOfModels = GenericVectorEqEq; // Row Scratch Registers are data generated by the paragraph detection // algorithm based on a RowInfo input. diff --git a/src/ccstruct/blobs.h b/src/ccstruct/blobs.h index f9237adc93..26101f339b 100644 --- a/src/ccstruct/blobs.h +++ b/src/ccstruct/blobs.h @@ -71,7 +71,7 @@ struct TPOINT { int16_t x; // absolute x coord. int16_t y; // absolute y coord. }; -typedef TPOINT VECTOR; // structure for coordinates. +using VECTOR = TPOINT; // structure for coordinates. struct EDGEPT { EDGEPT() diff --git a/src/ccstruct/detlinefit.h b/src/ccstruct/detlinefit.h index 4dc645c67d..c67891ddb3 100644 --- a/src/ccstruct/detlinefit.h +++ b/src/ccstruct/detlinefit.h @@ -120,7 +120,7 @@ class DetLineFit { // Type holds the distance of each point from the fitted line and the point // itself. Use of double allows integer distances from ICOORDs to be stored // exactly, and also the floating point results from ConstrainedFit. - typedef KDPairInc DistPointPair; + using DistPointPair = KDPairInc; // Computes and returns the squared evaluation metric for a line fit. double EvaluateLineFit(); diff --git a/src/ccstruct/matrix.h b/src/ccstruct/matrix.h index 7da9fcb66c..bf7df079b6 100644 --- a/src/ccstruct/matrix.h +++ b/src/ccstruct/matrix.h @@ -628,6 +628,6 @@ struct MATRIX_COORD { }; // The MatrixCoordPair contains a MATRIX_COORD and its priority. -typedef tesseract::KDPairInc MatrixCoordPair; +using MatrixCoordPair = tesseract::KDPairInc; #endif // TESSERACT_CCSTRUCT_MATRIX_H_ diff --git a/src/ccstruct/params_training_featdef.h b/src/ccstruct/params_training_featdef.h index 6e021f0b30..fc7af70ada 100644 --- a/src/ccstruct/params_training_featdef.h +++ b/src/ccstruct/params_training_featdef.h @@ -119,7 +119,7 @@ struct ParamsTrainingHypothesis { }; // A list of hypotheses explored during one run of segmentation search. -typedef GenericVector ParamsTrainingHypothesisList; +using ParamsTrainingHypothesisList = GenericVector; // A bundle that accumulates all of the hypothesis lists explored during all // of the runs of segmentation search on a word (e.g. a list of hypotheses diff --git a/src/ccstruct/ratngs.h b/src/ccstruct/ratngs.h index 9576255548..381db7e911 100644 --- a/src/ccstruct/ratngs.h +++ b/src/ccstruct/ratngs.h @@ -637,7 +637,7 @@ class WERD_CHOICE : public ELIST_LINK { // Make WERD_CHOICE listable. ELISTIZEH(WERD_CHOICE) -typedef GenericVector BLOB_CHOICE_LIST_VECTOR; +using BLOB_CHOICE_LIST_VECTOR = GenericVector; // Utilities for comparing WERD_CHOICEs diff --git a/src/ccstruct/seam.h b/src/ccstruct/seam.h index 596c932012..7179bd8a88 100644 --- a/src/ccstruct/seam.h +++ b/src/ccstruct/seam.h @@ -39,7 +39,7 @@ /*---------------------------------------------------------------------- T y p e s ----------------------------------------------------------------------*/ -typedef float PRIORITY; /* PRIORITY */ +using PRIORITY = float; /* PRIORITY */ class SEAM { public: diff --git a/src/ccutil/ambigs.h b/src/ccutil/ambigs.h index 1912890dcb..acfa01709f 100644 --- a/src/ccutil/ambigs.h +++ b/src/ccutil/ambigs.h @@ -31,7 +31,7 @@ namespace tesseract { -typedef GenericVector UnicharIdVector; +using UnicharIdVector = GenericVector; static const int kUnigramAmbigsBufferSize = 1000; static const char kAmbigNgramSeparator[] = { ' ', '\0' }; @@ -138,7 +138,7 @@ ELISTIZEH(AmbigSpec) // AMBIG_TABLE[i] stores a set of ambiguities whose // wrong ngram starts with unichar id i. -typedef GenericVector UnicharAmbigsVector; +using UnicharAmbigsVector = GenericVector; class UnicharAmbigs { public: diff --git a/src/ccutil/host.h b/src/ccutil/host.h index 46ce3171ec..989ccf1b55 100644 --- a/src/ccutil/host.h +++ b/src/ccutil/host.h @@ -31,9 +31,9 @@ #include // int32_t, ... // definitions of portable data types (numbers and characters) -typedef float FLOAT32; -typedef double FLOAT64; -typedef unsigned char BOOL8; +using FLOAT32 = float; +using FLOAT64 = double; +using BOOL8 = unsigned char; #if defined(_WIN32) diff --git a/src/ccutil/kdpair.h b/src/ccutil/kdpair.h index 4be1c36673..fb60f098ee 100644 --- a/src/ccutil/kdpair.h +++ b/src/ccutil/kdpair.h @@ -176,7 +176,7 @@ struct KDPtrPairDec : public KDPtrPair { }; // Specialization for a pair of ints in increasing order. -typedef KDPairInc IntKDPair; +using IntKDPair = KDPairInc; // Vector of IntKDPair. class KDVector : public GenericVector { diff --git a/src/ccutil/unichar.h b/src/ccutil/unichar.h index 1685a1076d..fe115055c0 100644 --- a/src/ccutil/unichar.h +++ b/src/ccutil/unichar.h @@ -32,7 +32,7 @@ // TODO(rays) Move these to the tesseract namespace. // A UNICHAR_ID is the unique id of a unichar. -typedef int UNICHAR_ID; +using UNICHAR_ID = int; // A variable to indicate an invalid or uninitialized unichar id. static const int INVALID_UNICHAR_ID = -1; @@ -49,7 +49,7 @@ enum StrongScriptDirection { namespace tesseract { -typedef signed int char32; +using char32 = signed int; // The UNICHAR class holds a single classification result. This may be // a single Unicode character (stored as between 1 and 4 utf8 bytes) or @@ -106,7 +106,7 @@ class UNICHAR { // tprintf("Char = %s\n", buf); // } class const_iterator { - typedef const_iterator CI; + using CI = const_iterator ; public: // Step to the next UTF8 character. diff --git a/src/ccutil/unicharcompress.cpp b/src/ccutil/unicharcompress.cpp index 9cb0a4d1c0..64b238fcee 100644 --- a/src/ccutil/unicharcompress.cpp +++ b/src/ccutil/unicharcompress.cpp @@ -44,9 +44,9 @@ static int RadicalPreHash(const std::vector& rs) { } // A hash map to convert unicodes to radical encoding. -typedef std::unordered_map>> RSMap; +using RSMap = std::unordered_map>>; // A hash map to count occurrences of each radical encoding. -typedef std::unordered_map RSCounts; +using RSCounts = std::unordered_map; static bool DecodeRadicalLine(STRING* radical_data_line, RSMap* radical_map) { if (radical_data_line->length() == 0 || (*radical_data_line)[0] == '#') diff --git a/src/classify/cluster.cpp b/src/classify/cluster.cpp index 39f9e22e21..7109b1cc2a 100644 --- a/src/classify/cluster.cpp +++ b/src/classify/cluster.cpp @@ -164,8 +164,8 @@ struct TEMPCLUSTER { CLUSTER *Neighbor; }; -typedef tesseract::KDPairInc ClusterPair; -typedef tesseract::GenericHeap ClusterHeap; +using ClusterPair = tesseract::KDPairInc; +using ClusterHeap = tesseract::GenericHeap; struct STATISTICS { FLOAT32 AvgVariance; diff --git a/src/classify/featdefs.h b/src/classify/featdefs.h index 1f41fc9ebd..e27be2e0b3 100644 --- a/src/classify/featdefs.h +++ b/src/classify/featdefs.h @@ -43,14 +43,14 @@ struct CHAR_DESC_STRUCT { uint32_t NumFeatureSets; FEATURE_SET FeatureSets[NUM_FEATURE_TYPES]; }; -typedef CHAR_DESC_STRUCT *CHAR_DESC; +using CHAR_DESC = CHAR_DESC_STRUCT *; struct FEATURE_DEFS_STRUCT { int32_t NumFeatureTypes; const FEATURE_DESC_STRUCT* FeatureDesc[NUM_FEATURE_TYPES]; int FeatureEnabled[NUM_FEATURE_TYPES]; }; -typedef FEATURE_DEFS_STRUCT *FEATURE_DEFS; +using FEATURE_DEFS = FEATURE_DEFS_STRUCT *; /*---------------------------------------------------------------------- Generic functions for manipulating character descriptions diff --git a/src/classify/fpoint.h b/src/classify/fpoint.h index b5e4d6a3fc..ee73f94ca0 100644 --- a/src/classify/fpoint.h +++ b/src/classify/fpoint.h @@ -30,7 +30,7 @@ typedef struct { FLOAT32 x, y; } FPOINT; -typedef FPOINT FVECTOR; +using FVECTOR = FPOINT; /**---------------------------------------------------------------------------- Macros diff --git a/src/classify/ocrfeatures.h b/src/classify/ocrfeatures.h index 6b14f87997..c368fb62b5 100644 --- a/src/classify/ocrfeatures.h +++ b/src/classify/ocrfeatures.h @@ -58,26 +58,26 @@ struct FEATURE_DESC_STRUCT { const char *ShortName; // short name for feature const PARAM_DESC *ParamDesc; // array - one per param }; -typedef FEATURE_DESC_STRUCT *FEATURE_DESC; +using FEATURE_DESC = FEATURE_DESC_STRUCT *; struct FEATURE_STRUCT { const FEATURE_DESC_STRUCT *Type; // points to description of feature type FLOAT32 Params[1]; // variable size array - params for feature }; -typedef FEATURE_STRUCT *FEATURE; +using FEATURE = FEATURE_STRUCT *; struct FEATURE_SET_STRUCT { uint16_t NumFeatures; // number of features in set uint16_t MaxNumFeatures; // maximum size of feature set FEATURE Features[1]; // variable size array of features }; -typedef FEATURE_SET_STRUCT *FEATURE_SET; +using FEATURE_SET = FEATURE_SET_STRUCT *; // A generic character description as a char pointer. In reality, it will be // a pointer to some data structure. Paired feature extractors/matchers need // to agree on the data structure to be used, however, the high level // classifier does not need to know the details of this data structure. -typedef char *CHAR_FEATURES; +using CHAR_FEATURES = char *; /*---------------------------------------------------------------------- Macros for defining the parameters of a new features diff --git a/src/classify/protos.h b/src/classify/protos.h index 3369461be9..d53fe467f4 100644 --- a/src/classify/protos.h +++ b/src/classify/protos.h @@ -37,7 +37,7 @@ /*---------------------------------------------------------------------- T y p e s ----------------------------------------------------------------------*/ -typedef BIT_VECTOR *CONFIGS; +using CONFIGS = BIT_VECTOR *; typedef struct { @@ -49,7 +49,7 @@ typedef struct FLOAT32 Angle; FLOAT32 Length; } PROTO_STRUCT; -typedef PROTO_STRUCT *PROTO; +using PROTO = PROTO_STRUCT *; struct CLASS_STRUCT { CLASS_STRUCT() @@ -64,8 +64,8 @@ struct CLASS_STRUCT { CONFIGS Configurations; UnicityTableEqEq font_set; }; -typedef CLASS_STRUCT *CLASS_TYPE; -typedef CLASS_STRUCT *CLASSES; +using CLASS_TYPE = CLASS_STRUCT *; +using CLASSES = CLASS_STRUCT *; /*---------------------------------------------------------------------- C o n s t a n t s diff --git a/src/classify/shapetable.h b/src/classify/shapetable.h index d8219e22d9..00407a0f9a 100644 --- a/src/classify/shapetable.h +++ b/src/classify/shapetable.h @@ -153,7 +153,7 @@ struct ShapeQueueEntry { // Which level in the tree did this come from? int level; }; -typedef GenericHeap ShapeQueue; +using ShapeQueue = GenericHeap; // Simple struct to hold a set of fonts associated with a single unichar-id. // A vector of UnicharAndFonts makes a shape. diff --git a/src/cutil/bitvec.h b/src/cutil/bitvec.h index 3dfc28c8e4..5068006633 100644 --- a/src/cutil/bitvec.h +++ b/src/cutil/bitvec.h @@ -25,7 +25,7 @@ -----------------------------------------------------------------------------*/ // TODO(rays) Rename BITSINLONG to BITSINuint32_t, and use sizeof. #define BITSINLONG 32 /**< no of bits in a long */ -typedef uint32_t *BIT_VECTOR; +using BIT_VECTOR = uint32_t *; /*----------------------------------------------------------------------------- Public Function Prototypes diff --git a/src/cutil/danerror.h b/src/cutil/danerror.h index 0a42ccac57..0e7abf1df8 100644 --- a/src/cutil/danerror.h +++ b/src/cutil/danerror.h @@ -24,7 +24,7 @@ #define NOERROR 0 #define DO_NOTHING 0 -typedef int TRAPERROR; +using TRAPERROR = int; typedef void (*VOID_PROC) (); /**---------------------------------------------------------------------------- diff --git a/src/cutil/oldlist.h b/src/cutil/oldlist.h index bd4fdfa16f..2aa7a7b844 100644 --- a/src/cutil/oldlist.h +++ b/src/cutil/oldlist.h @@ -129,7 +129,7 @@ struct list_rec struct list_rec *node; struct list_rec *next; }; -typedef list_rec *LIST; +using LIST = list_rec *; /*---------------------------------------------------------------------- M a c r o s diff --git a/src/dict/dawg.h b/src/dict/dawg.h index 799080ad34..80fee8142c 100644 --- a/src/dict/dawg.h +++ b/src/dict/dawg.h @@ -50,11 +50,11 @@ ----------------------------------------------------------------------*/ class UNICHARSET; -typedef uint64_t EDGE_RECORD; -typedef EDGE_RECORD *EDGE_ARRAY; -typedef int64_t EDGE_REF; -typedef int64_t NODE_REF; -typedef EDGE_REF *NODE_MAP; +using EDGE_RECORD = uint64_t; +using EDGE_ARRAY = EDGE_RECORD *; +using EDGE_REF = int64_t; +using NODE_REF = int64_t; +using NODE_MAP = EDGE_REF *; namespace tesseract { @@ -65,9 +65,9 @@ struct NodeChild { NodeChild(): unichar_id(INVALID_UNICHAR_ID), edge_ref(NO_EDGE) {} }; -typedef GenericVector NodeChildVector; -typedef GenericVector SuccessorList; -typedef GenericVector SuccessorListsVector; +using NodeChildVector = GenericVector; +using SuccessorList = GenericVector; +using SuccessorListsVector = GenericVector; enum DawgType { DAWG_TYPE_PUNCTUATION, diff --git a/src/dict/dict.h b/src/dict/dict.h index 97c8e5ccfc..35cad5bb22 100644 --- a/src/dict/dict.h +++ b/src/dict/dict.h @@ -46,7 +46,7 @@ struct CHAR_FRAGMENT_INFO { namespace tesseract { -typedef GenericVector DawgVector; +using DawgVector = GenericVector; // // Constants diff --git a/src/dict/matchdefs.h b/src/dict/matchdefs.h index 557f09e36a..719b2a59e6 100644 --- a/src/dict/matchdefs.h +++ b/src/dict/matchdefs.h @@ -32,19 +32,19 @@ #define MAX_CLASS_ID (MAX_NUM_CLASSES - 1) /** a CLASS_ID is the ascii character to be associated with a class */ -typedef UNICHAR_ID CLASS_ID; +using CLASS_ID = UNICHAR_ID; #define NO_CLASS (0) /** a PROTO_ID is the index of a prototype within it's class. Valid proto id's are 0 to N-1 where N is the number of prototypes that make up the class. */ -typedef int16_t PROTO_ID; +using PROTO_ID = int16_t; #define NO_PROTO (-1) /** FEATURE_ID is the index of a feature within a character description The feature id ranges from 0 to N-1 where N is the number of features in a character description. */ -typedef uint8_t FEATURE_ID; +using FEATURE_ID = uint8_t; #define NO_FEATURE 255 #define NOISE_FEATURE 254 #define MISSING_PROTO 254 @@ -53,13 +53,13 @@ typedef uint8_t FEATURE_ID; /** a RATING is the match rating returned by a classifier. Higher is better. */ -typedef FLOAT32 RATING; +using RATING = FLOAT32; /** a CERTAINTY is an indication of the degree of confidence of the classifier. Higher is better. 0 means the match is as good as the mean of the matches seen in training. -1 means the match was one standard deviation worse than the training matches, etc. */ -typedef FLOAT32 CERTAINTY; +using CERTAINTY = FLOAT32; /** define a data structure to hold a single match result */ typedef struct diff --git a/src/dict/stopper.h b/src/dict/stopper.h index dcf3067b71..6a4c5cd580 100644 --- a/src/dict/stopper.h +++ b/src/dict/stopper.h @@ -29,7 +29,7 @@ class WERD_CHOICE; -typedef uint8_t BLOB_WIDTH; +using BLOB_WIDTH = uint8_t; struct DANGERR_INFO { DANGERR_INFO() : @@ -44,7 +44,7 @@ struct DANGERR_INFO { UNICHAR_ID leftmost; // in the replacement, what's the leftmost character? }; -typedef GenericVector DANGERR; +using DANGERR = GenericVector; #endif diff --git a/src/dict/trie.h b/src/dict/trie.h index fff8a39ac0..6ae151fae7 100644 --- a/src/dict/trie.h +++ b/src/dict/trie.h @@ -41,15 +41,15 @@ class UNICHARSET; // It might be cleanest to change the types of most of the Trie/Dawg related // typedefs to int and restrict the casts to extracting these values from // the 64 bit EDGE_RECORD. -typedef int64_t EDGE_INDEX; // index of an edge in a given node -typedef bool *NODE_MARKER; -typedef GenericVector EDGE_VECTOR; +using EDGE_INDEX = int64_t ; // index of an edge in a given node +using NODE_MARKER = bool *; +using EDGE_VECTOR = GenericVector ; struct TRIE_NODE_RECORD { EDGE_VECTOR forward_edges; EDGE_VECTOR backward_edges; }; -typedef GenericVector TRIE_NODES; +using TRIE_NODES = GenericVector ; namespace tesseract { diff --git a/src/lstm/lstmtrainer.cpp b/src/lstm/lstmtrainer.cpp index 39d26497fc..9449d3eac8 100644 --- a/src/lstm/lstmtrainer.cpp +++ b/src/lstm/lstmtrainer.cpp @@ -1243,7 +1243,7 @@ double LSTMTrainer::ComputeCharError(const GenericVector& truth_str, // Computes word recall error rate using a very simple bag of words algorithm. // NOTE that this is destructive on both input strings. double LSTMTrainer::ComputeWordError(STRING* truth_str, STRING* ocr_str) { - typedef std::unordered_map > StrMap; + using StrMap = std::unordered_map>; GenericVector truth_words, ocr_words; truth_str->split(' ', &truth_words); if (truth_words.empty()) return 0.0; diff --git a/src/lstm/recodebeam.h b/src/lstm/recodebeam.h index 2c96b848fc..61a2490f7e 100644 --- a/src/lstm/recodebeam.h +++ b/src/lstm/recodebeam.h @@ -169,8 +169,8 @@ struct RecodeNode { uint64_t code_hash; }; -typedef KDPairInc RecodePair; -typedef GenericHeap RecodeHeap; +using RecodePair = KDPairInc; +using RecodeHeap = GenericHeap; // Class that holds the entire beam search for recognition of a text line. class RecodeBeamSearch { @@ -262,7 +262,7 @@ class RecodeBeamSearch { // all of the step. RecodeNode best_initial_dawgs_[NC_COUNT]; }; - typedef KDPairInc TopPair; + using TopPair = KDPairInc; // Generates debug output of the content of a single beam position. void DebugBeamPos(const UNICHARSET& unicharset, const RecodeHeap& heap) const; diff --git a/src/textord/blobgrid.h b/src/textord/blobgrid.h index dc52be15de..a8a944143a 100644 --- a/src/textord/blobgrid.h +++ b/src/textord/blobgrid.h @@ -28,7 +28,7 @@ CLISTIZEH(BLOBNBOX) namespace tesseract { -typedef GridSearch BlobGridSearch; +using BlobGridSearch = GridSearch; class BlobGrid : public BBGrid { public: diff --git a/src/textord/colpartition.h b/src/textord/colpartition.h index cff622c68b..315ff69361 100644 --- a/src/textord/colpartition.h +++ b/src/textord/colpartition.h @@ -925,9 +925,9 @@ class ColPartition : public ELIST2_LINK { }; // Typedef it now in case it becomes a class later. -typedef GridSearch ColPartitionGridSearch; + ColPartition_C_IT> ; } // namespace tesseract. diff --git a/src/textord/colpartitionset.h b/src/textord/colpartitionset.h index 3cd58fbd10..0486130c6b 100644 --- a/src/textord/colpartitionset.h +++ b/src/textord/colpartitionset.h @@ -31,7 +31,7 @@ namespace tesseract { class WorkingPartSet_LIST; class ColSegment_LIST; class ColPartitionSet; -typedef GenericVector PartSetVector; +using PartSetVector = GenericVector; // ColPartitionSet is a class that holds a list of ColPartitions. // Its main use is in holding a candidate partitioning of the width of the diff --git a/src/textord/tabfind.h b/src/textord/tabfind.h index e4b5b6d225..86bb04ea7a 100644 --- a/src/textord/tabfind.h +++ b/src/textord/tabfind.h @@ -33,7 +33,7 @@ struct Pix; namespace tesseract { -typedef TessResultCallback1 WidthCallback; +using WidthCallback = TessResultCallback1; struct AlignedBlobParams; class ColPartitionGrid; diff --git a/src/textord/tablefind.h b/src/textord/tablefind.h index 49590a4f06..6ae0184b14 100644 --- a/src/textord/tablefind.h +++ b/src/textord/tablefind.h @@ -113,12 +113,12 @@ class ColSegment : public ELIST_LINK { }; // Typedef BBGrid of ColSegments -typedef BBGrid ColSegmentGrid; -typedef GridSearch; +using ColSegmentGridSearch = GridSearch ColSegmentGridSearch; + ColSegment_C_IT>; // TableFinder is a utility class to find a set of tables given a set of // ColPartitions and Columns. The TableFinder will mark candidate ColPartitions diff --git a/src/textord/textord.h b/src/textord/textord.h index e44e31a957..8ce3ab7fc3 100644 --- a/src/textord/textord.h +++ b/src/textord/textord.h @@ -62,8 +62,8 @@ class WordWithBox { // Make it usable by BBGrid. CLISTIZEH(WordWithBox) -typedef BBGrid WordGrid; -typedef GridSearch WordSearch; +using WordGrid = BBGrid; +using WordSearch = GridSearch; class Textord { public: diff --git a/src/training/commontraining.h b/src/training/commontraining.h index 1e238f17b7..492ba93bbd 100644 --- a/src/training/commontraining.h +++ b/src/training/commontraining.h @@ -57,7 +57,7 @@ typedef struct int NumMerged[MAX_NUM_PROTOS]; CLASS_TYPE Class; }MERGE_CLASS_NODE; -typedef MERGE_CLASS_NODE* MERGE_CLASS; +using MERGE_CLASS = MERGE_CLASS_NODE*; ////////////////////////////////////////////////////////////////////////////// diff --git a/src/training/ligature_table.h b/src/training/ligature_table.h index 534a81ad66..725432c004 100644 --- a/src/training/ligature_table.h +++ b/src/training/ligature_table.h @@ -33,7 +33,7 @@ namespace tesseract { class PangoFontInfo; // defined in pango_font_info.h // Map to substitute strings for ligatures. -typedef std::unordered_map LigHash; +using LigHash = std::unordered_map; class LigatureTable { public: diff --git a/src/training/pango_font_info.h b/src/training/pango_font_info.h index 4c6e087ebf..5ee585cd55 100644 --- a/src/training/pango_font_info.h +++ b/src/training/pango_font_info.h @@ -35,7 +35,7 @@ DECLARE_STRING_PARAM_FLAG(fonts_dir); DECLARE_STRING_PARAM_FLAG(fontconfig_tmpdir); -typedef signed int char32; +using char32 = signed int; namespace tesseract { diff --git a/src/training/validator.h b/src/training/validator.h index 6b21daa911..890cfac5dc 100644 --- a/src/training/validator.h +++ b/src/training/validator.h @@ -130,7 +130,7 @@ class Validator { kWhitespace = ' ', kCombiner = 'c', // Combiners other than virama. }; - typedef std::pair IndicPair; + using IndicPair = std::pair; Validator(ViramaScript script, bool report_errors) : script_(script), diff --git a/src/wordrec/chop.h b/src/wordrec/chop.h index bafc99bae9..76eab99fea 100644 --- a/src/wordrec/chop.h +++ b/src/wordrec/chop.h @@ -38,7 +38,7 @@ ---------------------------------------------------------------------*/ #define MAX_NUM_POINTS 50 // The PointPair elements do NOT own the EDGEPTs. -typedef tesseract::KDPairInc PointPair; -typedef tesseract::GenericHeap PointHeap; +using PointPair = tesseract::KDPairInc; +using PointHeap = tesseract::GenericHeap; #endif diff --git a/src/wordrec/findseam.h b/src/wordrec/findseam.h index f1da0792a1..1e6f6defc4 100644 --- a/src/wordrec/findseam.h +++ b/src/wordrec/findseam.h @@ -35,10 +35,10 @@ #include "chop.h" // The SeamPair elements own their SEAMs and delete them upon destruction. -typedef tesseract::KDPtrPairInc SeamPair; -typedef tesseract::GenericHeap SeamQueue; +using SeamPair = tesseract::KDPtrPairInc; +using SeamQueue = tesseract::GenericHeap; -typedef tesseract::KDPtrPairDec SeamDecPair; -typedef tesseract::GenericHeap SeamPile; +using SeamDecPair = tesseract::KDPtrPairDec; +using SeamPile = tesseract::GenericHeap; #endif diff --git a/src/wordrec/lm_pain_points.h b/src/wordrec/lm_pain_points.h index 0f47b1ddd0..68eca59316 100644 --- a/src/wordrec/lm_pain_points.h +++ b/src/wordrec/lm_pain_points.h @@ -31,7 +31,7 @@ namespace tesseract { // Heap of pain points used for determining where to chop/join. -typedef GenericHeap PainPointHeap; +using PainPointHeap = GenericHeap; // Types of pain points (ordered in the decreasing level of importance). enum LMPainPointsType { diff --git a/src/wordrec/lm_state.h b/src/wordrec/lm_state.h index bc084f653e..da377d0745 100644 --- a/src/wordrec/lm_state.h +++ b/src/wordrec/lm_state.h @@ -34,7 +34,7 @@ namespace tesseract { /// Used for expressing various language model flags. -typedef unsigned char LanguageModelFlagsType; +using LanguageModelFlagsType = unsigned char; /// The following structs are used for storing the state of the language model /// in the segmentation search graph. In this graph the nodes are BLOB_CHOICEs