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

TargetCorpus.h « biconcor « ems « scripts - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 557b1fc4eae5282d81df621125715e33ca1a5696 (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
#include "Vocabulary.h"

#pragma once

#define LINE_MAX_LENGTH 10000

class TargetCorpus
{
public:
  typedef unsigned int INDEX;

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

public:
  ~TargetCorpus();

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