commit dc7eb9f6c370f9ed969e46dd300914f85d7db008 Author: vaydheesh Date: Wed Jun 26 12:40:17 2019 +0530 Moved the function definition inside class diff --git a/python/lex_tools.i b/python/lex_tools.i index 2645171..9bc71ff 100644 --- a/python/lex_tools.i +++ b/python/lex_tools.i @@ -11,38 +11,34 @@ public: /** * Imitates functionality of lrx_proc using file path */ - void lrx_proc(char arg, char *dictionary_path, char *input_path, char *output_path); -}; - - -void -LRX::lrx_proc(char arg, char *dictionary_path, char *input_path, char *output_path) -{ - bool useMaxEnt = false; - FILE *dictionary = fopen(dictionary_path, "rb"); - load(dictionary); - FILE *input = fopen(input_path, "r"), *output = fopen(output_path, "w"); - switch(arg) + void lrx_proc(char arg, char *dictionary_path, char *input_path, char *output_path) { - case 'm': - useMaxEnt = true; - break; - default: - useMaxEnt = false; + bool useMaxEnt = false; + FILE *dictionary = fopen(dictionary_path, "rb"); + load(dictionary); + FILE *input = fopen(input_path, "r"), *output = fopen(output_path, "w"); + switch(arg) + { + case 'm': + useMaxEnt = true; + break; + default: + useMaxEnt = false; + } + init(); + if(useMaxEnt) + { + processME(input, output); + } + else + { + process(input, output); + } + fclose(dictionary); + fclose(input); + fclose(output); } - init(); - if(useMaxEnt) - { - processME(input, output); - } - else - { - process(input, output); - } - fclose(dictionary); - fclose(input); - fclose(output); -} +}; %}