mosesdecoder/scripts/ems/biconcor/TargetCorpus.h

33 lines
707 B
C
Raw Normal View History

#pragma once
2012-05-07 17:59:37 +04:00
#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, char word ) const;
WORD_ID GetWordId( INDEX sentence, char word ) const;
char GetSentenceLength( INDEX sentence ) const;
void Load(const std::string& fileName );
void Save(const std::string& fileName ) const;
};