Commit 1cf405d8 authored by Evgeniy Kozinov's avatar Evgeniy Kozinov

Russian comments was removed. Error code was added as returned value inLatentSVM parser.

parent fbfccffb
......@@ -47,20 +47,19 @@
#define EBTAG (STEP_END + BTAG)
//extern "C" {
void LSVMparser(const char * filename, filterObject *** model, int *last, int *max, int **comp, float **b, int *count, float * score);
int LSVMparser(const char * filename, filterObject *** model, int *last, int *max, int **comp, float **b, int *count, float * score);
#ifdef __cplusplus
extern "C"
#endif
int loadModel(
//
const char *modelPath,// -
//
filterObject ***filters,// -
int *kFilters, //-
int *kComponents, //-
int **kPartFilters, //- ,
float **b, //-
float *scoreThreshold); //- score)
const char *modelPath,
filterObject ***filters,
int *kFilters,
int *kComponents,
int **kPartFilters,
float **b,
float *scoreThreshold);
//};
#endif
\ No newline at end of file
......@@ -718,7 +718,7 @@ void parserModel(FILE * xmlf, filterObject *** model, int *last, int *max, int *
}
}
void LSVMparser(const char * filename, filterObject *** model, int *last, int *max, int **comp, float **b, int *count, float * score){
int LSVMparser(const char * filename, filterObject *** model, int *last, int *max, int **comp, float **b, int *count, float * score){
int st = 0;
int tag;
char ch;
......@@ -732,7 +732,11 @@ void LSVMparser(const char * filename, filterObject *** model, int *last, int *m
(*model) = (filterObject ** )malloc((sizeof(filterObject * )) * (*max));
//printf("parse : %s\n", filename);
xmlf = fopen(filename, "rb");
if(xmlf == NULL){
return -1;
}
i = 0;
j = 0;
......@@ -762,28 +766,31 @@ void LSVMparser(const char * filename, filterObject *** model, int *last, int *m
}
}
}
return 0;
}
int loadModel(
//
const char *modelPath,// -
//
filterObject ***filters,// -
int *kFilters, //-
int *kComponents, //-
int **kPartFilters, //- ,
float **b, //-
float *scoreThreshold){ //- score)
const char *modelPath,
filterObject ***filters,
int *kFilters,
int *kComponents,
int **kPartFilters,
float **b,
float *scoreThreshold){
int last;
int max;
int *comp;
int count;
int i;
int err;
float score;
//printf("start_parse\n\n");
LSVMparser(modelPath, filters, &last, &max, &comp, b, &count, &score);
err = LSVMparser(modelPath, filters, &last, &max, &comp, b, &count, &score);
if(err != 0){
return -1;
}
(*kFilters) = last + 1;
(*kComponents) = count;
(*scoreThreshold) = (float) score;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment