commit 1e7d3e70d5271e1593fc6cec959681889e7154fd Author: vaydheesh Date: Fri Jun 14 20:35:21 2019 +0000 Added: Wrapper for generation diff --git a/python/lttoolbox.i b/python/lttoolbox.i index 7d2d31d..5dd9373 100644 --- a/python/lttoolbox.i +++ b/python/lttoolbox.i @@ -14,14 +14,17 @@ public: * Reads from input_path and stores result at output_path */ void analyze(char *automorf_path, char *input_path, char *output_path); + + /** + * Reads from input_path and stores result at output_path + */ + void generate(char *autogen_path, char *input_path, char *output_path); }; void FST::analyze(char *automorf_path, char *input_path, char *output_path) { - setDictionaryCaseMode(true); - LtLocale::tryToSetLocale(); FILE *in = fopen(automorf_path, "rb"); load(in); initAnalysis(); @@ -32,6 +35,19 @@ FST::analyze(char *automorf_path, char *input_path, char *output_path) fclose(output); } +void +FST::generate(char *autogen_path, char *input_path, char *output_path) +{ + FILE *in = fopen(autogen_path, "rb"); + load(in); + initGeneration(); + FILE *input = fopen(input_path, "r"), *output = fopen(output_path, "w"); + generation(input, output); + fclose(in); + fclose(input); + fclose(output); +} + %} @@ -47,4 +63,9 @@ public: * Reads from input_path and stores result at output_path */ void analyze(char *automorf_path, char *input_path, char *output_path); + + /** + * Reads from input_path and stores result at output_path + */ + void generate(char *autogen_path, char *input_path, char *output_path); };