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

Function WriteCharDescription

deps/tesseract/classify/featdefs.cpp:197–215  ·  view source on GitHub ↗

---------------------------------------------------------------------------*/ * Appends a textual representation of CharDesc to str. * The format used is to write out the number of feature * sets which will be written followed by a representation of * each feature set. * * Each set starts with the short name for that feature followed * by a description of the feature set. Feature sets which

Source from the content-addressed store, hash-verified

195 * @note History: Wed May 23 17:21:18 1990, DSJ, Created.
196 */
197void WriteCharDescription(const FEATURE_DEFS_STRUCT& FeatureDefs,
198 CHAR_DESC CharDesc, STRING* str) {
199 int Type;
200 int NumSetsToWrite = 0;
201
202 for (Type = 0; Type < CharDesc->NumFeatureSets; Type++)
203 if (CharDesc->FeatureSets[Type])
204 NumSetsToWrite++;
205
206 str->add_str_int(" ", NumSetsToWrite);
207 *str += "\n";
208 for (Type = 0; Type < CharDesc->NumFeatureSets; Type++) {
209 if (CharDesc->FeatureSets[Type]) {
210 *str += FeatureDefs.FeatureDesc[Type]->ShortName;
211 *str += " ";
212 WriteFeatureSet(CharDesc->FeatureSets[Type], str);
213 }
214 }
215} /* WriteCharDescription */
216
217// Return whether all of the fields of the given feature set
218// are well defined (not inf or nan).

Callers 1

LearnBlobMethod · 0.85

Calls 2

WriteFeatureSetFunction · 0.85
add_str_intMethod · 0.80

Tested by

no test coverage detected