https://github.com/vsiivola/variKN
Revision fc6cd7a70463888ec0d3cc010b7a9ffcaf099193 authored by Sami Virpioja on 28 January 2023, 11:50:28 UTC, committed by Sami Virpioja on 28 January 2023, 11:53:05 UTC
1 parent 24385dc
Raw File
Tip revision: fc6cd7a70463888ec0d3cc010b7a9ffcaf099193 authored by Sami Virpioja on 28 January 2023, 11:50:28 UTC
test macos-12 wheels and test more python versions
Tip revision: fc6cd7a
bin2arpa.cc
// Copyright (C) 2007  Vesa Siivola.
// See licence.txt for the terms of distribution.

// This program converts arpa firmat language models to binary format.
#include "TreeGram.hh"
#include "conf.hh"
#include "io.hh"

int main(int argc, char **argv) {
  conf::Config config;
  config("Usage: bin2arpa bin_in arpa_out\nConverts binary LMs to arpa.\n");
  config.parse(argc, argv, 2, true);

  io::Stream in(config.arguments.at(0), "r");
  io::Stream out(config.arguments.at(1), "w");

  TreeGram ng;

  fprintf(stderr, "Reading\n");
  ng.read(in.file, true);
  in.close();

  fprintf(stderr, "Writing\n");
  ng.write(out.file);
  out.close();
}
back to top