Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Tools.cpp « src « reranking « contrib - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8312c3370927a75534a29a76dbdbacd0f198d106 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 *  nbest: tool to process moses n-best lists
 *
 *  File: Tools.cpp
 *        basic utility functions
 *
 *  Created by Holger Schwenk, University of Le Mans, 05/16/2008
 *
 */

#include "Tools.h"

int Weights::Read(const char *fname)
{
  ifstream inpf;

  inpf.open(fname);
  if (inpf.fail()) {
    perror ("ERROR");
    exit(1);
  }

  float f;
  while (inpf >> f) val.push_back(f);

  inpf.close();
  return val.size();
}