https://github.com/wilkeraziz/mosesdecoder
Revision 8a2a99023aef8e7e0fe9763d728b998c5bc25711 authored by Ales Tamchyna on 03 January 2013, 12:39:15 UTC, committed by Ales Tamchyna on 03 January 2013, 12:39:15 UTC
1 parent e2cac60
Tip revision: 8a2a99023aef8e7e0fe9763d728b998c5bc25711 authored by Ales Tamchyna on 03 January 2013, 12:39:15 UTC
in LocalLM, do not try to predict words without context (at least 1 word)
in LocalLM, do not try to predict words without context (at least 1 word)
Tip revision: 8a2a990
TargetCorpus.h
#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;
};
Computing file changes ...