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

NBest.h « src « reranking « contrib - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9a4aa94473533223ab543e3709435e82be3a85fa (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 *  nbest: tool to process moses n-best lists
 *
 *  File: NBest.h
 *        basic functions on n-best lists
 *
 *  Created by Holger Schwenk, University of Le Mans, 05/16/2008
 *
 */


#ifndef _NBEST_H_
#define _NBEST_H_

using namespace std;

#include <iostream>
#include <fstream>
#include <string>
#include <vector>

#include "Tools.h"
#include "Hypo.h"

class NBest
{
  int 		   id;
  string           src;
  vector<Hypo> nbest;
  bool ParseLine(ifstream &inpf, const int n);
public:
  NBest(ifstream&, const int=0);
  ~NBest();
  int NbNBest() {
    return nbest.size();
  };
  float CalcGlobal(Weights&);
  void Sort(); // largest values first
  void Write(ofstream&, int=0);
};

void Error(char *msg);

#endif