BleuScorer Class Reference

#include <BleuScorer.h>

Inheritance diagram for BleuScorer:

Inheritance graph
[legend]
Collaboration diagram for BleuScorer:

Collaboration graph
[legend]

List of all members.

Public Types

enum  ReferenceLengthType { AVERAGE, CLOSEST, SHORTEST }

Public Member Functions

 BleuScorer (const std::string &config="")
 ~BleuScorer ()
virtual void setReferenceFiles (const std::vector< std::string > &referenceFiles)
virtual void prepareStats (std::size_t sid, const std::string &text, ScoreStats &entry)
virtual statscore_t calculateScore (const std::vector< int > &comps) const
virtual std::size_t NumberOfScores () const
int CalcReferenceLength (std::size_t sentence_id, std::size_t length)
ReferenceLengthType GetReferenceLengthType () const
void SetReferenceLengthType (ReferenceLengthType type)
const std::vector< Reference * > & GetReferences () const
std::size_t CountNgrams (const std::string &line, NgramCounts &counts, unsigned int n)
void DumpCounts (std::ostream *os, const NgramCounts &counts) const
bool OpenReference (const char *filename, std::size_t file_id)
bool OpenReferenceStream (std::istream *is, std::size_t file_id)


Detailed Description

Bleu scoring

Definition at line 21 of file BleuScorer.h.


Member Enumeration Documentation

Enumerator:
AVERAGE 
CLOSEST 
SHORTEST 

Definition at line 24 of file BleuScorer.h.


Constructor & Destructor Documentation

BleuScorer::BleuScorer ( const std::string &  config = ""  )  [explicit]

BleuScorer::~BleuScorer (  ) 

Definition at line 44 of file BleuScorer.cpp.


Member Function Documentation

int BleuScorer::CalcReferenceLength ( std::size_t  sentence_id,
std::size_t  length 
)

virtual statscore_t BleuScorer::calculateScore ( const std::vector< int > &  totals  )  const [virtual]

Calculate the actual score.

Implements StatisticsBasedScorer.

Referenced by BOOST_AUTO_TEST_CASE(), and MergeScorer::calculateScore().

Here is the caller graph for this function:

std::size_t BleuScorer::CountNgrams ( const std::string &  line,
NgramCounts counts,
unsigned int  n 
)

Count the ngrams of each type, up to the given length in the input line.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

void BleuScorer::DumpCounts ( std::ostream *  os,
const NgramCounts counts 
) const

ReferenceLengthType BleuScorer::GetReferenceLengthType (  )  const [inline]

Definition at line 40 of file BleuScorer.h.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

const std::vector<Reference*>& BleuScorer::GetReferences (  )  const [inline]

Definition at line 43 of file BleuScorer.h.

References ScopedVector< T >::get().

Here is the call graph for this function:

virtual std::size_t BleuScorer::NumberOfScores (  )  const [inline, virtual]

Return the number of statistics needed for the computation of the score.

Implements Scorer.

Definition at line 36 of file BleuScorer.h.

References kBleuNgramOrder.

Referenced by MergeScorer::calculateScore().

Here is the caller graph for this function:

bool BleuScorer::OpenReference ( const char *  filename,
std::size_t  file_id 
)

bool BleuScorer::OpenReferenceStream ( std::istream *  is,
std::size_t  file_id 
)

virtual void BleuScorer::prepareStats ( std::size_t  sindex,
const std::string &  text,
ScoreStats entry 
) [virtual]

Process the given guessed text, corresponding to the given reference sindex and add the appropriate statistics to the entry.

Reimplemented from Scorer.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

virtual void BleuScorer::setReferenceFiles ( const std::vector< std::string > &  referenceFiles  )  [virtual]

Set the reference files. This must be called before prepareStats().

Reimplemented from Scorer.

void BleuScorer::SetReferenceLengthType ( ReferenceLengthType  type  )  [inline]

Definition at line 41 of file BleuScorer.h.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:

Generated on Sat Jun 30 00:30:11 2012 for Moses by  doxygen 1.5.9