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

WordLattice.h « src « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 63dcb4596e9582a2a2f498d65eb7a0695b871e03 (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
#ifndef WORDLATTICE_H_
#define WORDLATTICE_H_

#include <vector>
#include "ConfusionNet.h"

/** General word lattice */
class WordLattice: public ConfusionNet {
private:
	std::vector<std::vector<size_t> > next_nodes;
	std::vector<std::vector<int> > distances;
		 
public:
	WordLattice();
	size_t GetColumnIncrement(size_t ic, size_t j) const;
	void Print(std::ostream&) const;
	/** Get shortest path between two nodes
	 */
	virtual int ComputeDistortionDistance(const WordsRange& prev, const WordsRange& current) const;
	// is it possible to get from the edge of the previous word range to the current word range
	virtual bool CanIGetFromAToB(size_t start, size_t end) const;
	
	int Read(std::istream& in,const std::vector<FactorType>& factorOrder);

	/** Convert internal representation into an edge matrix
	 * @note edges[1][2] means there is an edge from 1 to 2
	 */
	void GetAsEdgeMatrix(std::vector<std::vector<bool> >& edges) const;
};

#endif