コード例 #1
0
int main()
{
        ReadCFG();

        ReadDATfile();

        OpenOurFiles();

        Looper();

        fix_dat();

        return 0;
} // main shit ends here
コード例 #2
0
ファイル: main111209.c プロジェクト: pombredanne/qshi
int main(int argc, char *argv[])
{
  char *target_filename, *output_filename;
  char cfg_filename[] = "cfg.tmp";
  FILE *input, *output, *cfg;
  EDICT *edict;

  // analize options
    if (argc != 3) {
      printf("usage: %s target_text_file output_enc_file\n", argv[0]);
      exit(1);
  }

  target_filename = argv[1];
  output_filename = argv[2];
  
  // Run the algorithm procedure
  input  = fopen(target_filename, "r");
  cfg = fopen(cfg_filename, "wb");
  if (input == NULL || cfg == NULL) {
    puts("File open error at the beginning.");
    exit(1);
  }

  GrammarTrans_LCA(input, cfg);
  fclose(input);
  fclose(cfg);

  cfg = fopen(cfg_filename, "rb");
  output = fopen(output_filename, "wb");
  if (cfg == NULL || output == NULL) {
    puts("File open error.");
    exit(1);
  }

  edict = ReadCFG(cfg);
  remove(cfg_filename);
  EncodeCFG_Naive(edict, output);
  DestructEDict(edict);
  exit(0);
}
コード例 #3
0
ファイル: main111209.c プロジェクト: pombredanne/qshi
int main(int argc, char *argv[])
{
  FILE *input, *output;
  EDICT *dict;

  if (argc != 3) {
    printf("usage: %s target_cfg_file output_enc_file\n", argv[0]);
    exit(1);
  }
  input = fopen(argv[1], "rb");
  output = fopen(argv[2], "wb");
  if (input == NULL || output == NULL) {
    printf("File open error.\n");
    exit(1);
  }
  dict = ReadCFG(input);
  EncodeCFG(dict, output);
  DestructEDict(dict);
  fclose(input); fclose(output);
  exit(0);
}