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 @@ ...@@ -47,20 +47,19 @@
#define EBTAG (STEP_END + BTAG) #define EBTAG (STEP_END + BTAG)
//extern "C" { //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 #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
int loadModel( int loadModel(
//
const char *modelPath,// -
// const char *modelPath,
filterObject ***filters,// -
int *kFilters, //- filterObject ***filters,
int *kComponents, //- int *kFilters,
int **kPartFilters, //- , int *kComponents,
float **b, //- int **kPartFilters,
float *scoreThreshold); //- score) float **b,
float *scoreThreshold);
//}; //};
#endif #endif
\ No newline at end of file
...@@ -718,7 +718,7 @@ void parserModel(FILE * xmlf, filterObject *** model, int *last, int *max, int * ...@@ -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 st = 0;
int tag; int tag;
char ch; char ch;
...@@ -732,7 +732,11 @@ void LSVMparser(const char * filename, filterObject *** model, int *last, int *m ...@@ -732,7 +732,11 @@ void LSVMparser(const char * filename, filterObject *** model, int *last, int *m
(*model) = (filterObject ** )malloc((sizeof(filterObject * )) * (*max)); (*model) = (filterObject ** )malloc((sizeof(filterObject * )) * (*max));
//printf("parse : %s\n", filename); //printf("parse : %s\n", filename);
xmlf = fopen(filename, "rb"); xmlf = fopen(filename, "rb");
if(xmlf == NULL){
return -1;
}
i = 0; i = 0;
j = 0; j = 0;
...@@ -762,28 +766,31 @@ void LSVMparser(const char * filename, filterObject *** model, int *last, int *m ...@@ -762,28 +766,31 @@ void LSVMparser(const char * filename, filterObject *** model, int *last, int *m
} }
} }
} }
return 0;
} }
int loadModel( int loadModel(
// const char *modelPath,
const char *modelPath,// -
filterObject ***filters,
// int *kFilters,
filterObject ***filters,// - int *kComponents,
int *kFilters, //- int **kPartFilters,
int *kComponents, //- float **b,
int **kPartFilters, //- , float *scoreThreshold){
float **b, //-
float *scoreThreshold){ //- score)
int last; int last;
int max; int max;
int *comp; int *comp;
int count; int count;
int i; int i;
int err;
float score; float score;
//printf("start_parse\n\n"); //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; (*kFilters) = last + 1;
(*kComponents) = count; (*kComponents) = count;
(*scoreThreshold) = (float) score; (*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