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

TargetCorpus.h « biconcor - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5a35356f9d007b328476dce2ebe0b9dcf0835572 (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
#pragma once

#include "Vocabulary.h"

class TargetCorpus
{
public:
  typedef unsigned int INDEX;

private:
  WORD_ID *m_array;
  INDEX *m_sentenceEnd;
  Vocabulary m_vcb;
  INDEX m_size;
  INDEX m_sentenceCount;

  // No copying allowed.
  TargetCorpus(const TargetCorpus&);
  void operator=(const TargetCorpus&);

public:
  TargetCorpus();
  ~TargetCorpus();

  void Create(const std::string& fileName );
  WORD GetWordFromId( const WORD_ID id ) const;
  WORD GetWord( INDEX sentence, int word ) const;
  WORD_ID GetWordId( INDEX sentence, int word ) const;
  char GetSentenceLength( INDEX sentence ) const;
  void Load(const std::string& fileName );
  void Save(const std::string& fileName ) const;
};