commit 165741c4ca4501d26f991c077ee83d515d12b866 Author: vaydheesh Date: Sun Aug 25 16:07:02 2019 +0530 separate methods for init calls diff --git a/python/lttoolbox.i b/python/lttoolbox.i index 27b6309..34ee55d 100644 --- a/python/lttoolbox.i +++ b/python/lttoolbox.i @@ -57,81 +57,24 @@ public: { FILE* input = fopen(input_path, "r"); FILE* output = fopen(output_path, "w"); - int maxAnalyses; - int maxWeightClasses; int cmd = 0; int c = 0; optind = 1; while (true) { - c = getopt(argc, argv, "abcegi:r:lmndopxstzwvCIWN:L:h"); + c = getopt(argc, argv, "gw"); if (c == -1) { break; } switch(c) { - case 'c': - setCaseSensitiveMode(true); - break; - - case 'i': - setIgnoredChars(true); - parseICX(optarg); - break; - - case 'r': - setRestoreChars(true); - parseRCX(optarg); - - case 'I': - setUseDefaultIgnoredChars(false); - break; - - case 'W': - setDisplayWeightsMode(true); - break; - - case 'N': - maxAnalyses = atoi(optarg); - if (maxAnalyses > 1) - { - setMaxAnalysesValue(maxAnalyses); - } - break; - - case 'L': - maxWeightClasses = atoi(optarg); - if (maxWeightClasses > 1) - { - setMaxWeightClassesValue(maxWeightClasses); - } - break; - - case 'e': - case 'a': - case 'b': - case 'o': - case 'l': - case 'm': case 'g': - case 'n': - case 'd': - case 'p': - case 'x': - case 't': - case 's': - case 'C': if(cmd == 0) { cmd = c; } break; - - case 'z': - setNullFlush(true); - break; - case 'w': setDictionaryCaseMode(true); break; @@ -142,78 +85,14 @@ public: switch(cmd) { - case 'n': - initGeneration(); - generation(input, output, gm_clean); - break; - case 'g': - initGeneration(); generation(input, output); break; - case 'd': - initGeneration(); - generation(input, output, gm_all); - break; - - case 'l': - initGeneration(); - generation(input, output, gm_tagged); - break; - - case 'm': - initGeneration(); - generation(input, output, gm_tagged_nm); - break; - - case 'C': - initGeneration(); - generation(input, output, gm_carefulcase); - break; - - case 'p': - initPostgeneration(); - postgeneration(input, output); - break; - - case 'x': - initPostgeneration(); - intergeneration(input, output); - break; - - case 's': - initAnalysis(); - SAO(input, output); - break; - - case 't': - initPostgeneration(); - transliteration(input, output); - break; - - case 'o': - initBiltrans(); - setBiltransSurfaceForms(true); - bilingual(input, output); - break; - - case 'b': - initBiltrans(); - bilingual(input, output); - break; - - case 'e': - initDecomposition(); - analysis(input, output); - break; - - case 'a': default: - initAnalysis(); analysis(input, output); break; - } + } fclose(input); fclose(output);