MosesTuning::NgramCounts Class Reference

#include <Ngram.h>

List of all members.

Classes

struct  NgramComparator

Public Types

typedef std::vector< int > Key
typedef int Value
typedef boost::unordered_map
< Key, Value >::iterator 
iterator
typedef boost::unordered_map
< Key, Value >::const_iterator 
const_iterator

Public Member Functions

 NgramCounts ()
virtual ~NgramCounts ()
void Add (const Key &ngram)
bool Lookup (const Key &ngram, Value *v) const
void clear ()
bool empty () const
std::size_t size () const
std::size_t max_size () const
int get_default_count () const
iterator find (const Key &ngram)
const_iterator find (const Key &ngram) const
Valueoperator[] (const Key &ngram)
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const


Detailed Description

A simple STL-stdmap based n-gram counts. Basically, we provide typical accessors and mutaors, but we intentionally does not allow erasing elements.

Definition at line 15 of file Ngram.h.


Member Typedef Documentation

Definition at line 40 of file Ngram.h.

typedef boost::unordered_map<Key, Value>::iterator MosesTuning::NgramCounts::iterator

Definition at line 39 of file Ngram.h.

typedef std::vector<int> MosesTuning::NgramCounts::Key

Definition at line 37 of file Ngram.h.

Definition at line 38 of file Ngram.h.


Constructor & Destructor Documentation

MosesTuning::NgramCounts::NgramCounts (  )  [inline]

Definition at line 42 of file Ngram.h.

virtual MosesTuning::NgramCounts::~NgramCounts (  )  [inline, virtual]

Definition at line 43 of file Ngram.h.


Member Function Documentation

void MosesTuning::NgramCounts::Add ( const Key ngram  )  [inline]

If the specified "ngram" is found, we add counts. If not, we insert the default count in the container.

Definition at line 48 of file Ngram.h.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

const_iterator MosesTuning::NgramCounts::begin (  )  const [inline]

Definition at line 106 of file Ngram.h.

iterator MosesTuning::NgramCounts::begin (  )  [inline]

Definition at line 103 of file Ngram.h.

Referenced by MosesTuning::BleuScorer::CalcBleuStats(), and MosesTuning::BleuScorer::ProcessReferenceLine().

Here is the caller graph for this function:

void MosesTuning::NgramCounts::clear (  )  [inline]

Clear all elments in the container.

Definition at line 65 of file Ngram.h.

Referenced by BOOST_AUTO_TEST_CASE(), and MosesTuning::Reference::clear().

Here is the caller graph for this function:

bool MosesTuning::NgramCounts::empty (  )  const [inline]

Return true iff the container is empty.

Definition at line 72 of file Ngram.h.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

const_iterator MosesTuning::NgramCounts::end (  )  const [inline]

Definition at line 112 of file Ngram.h.

iterator MosesTuning::NgramCounts::end (  )  [inline]

Definition at line 109 of file Ngram.h.

Referenced by BOOST_AUTO_TEST_CASE(), MosesTuning::BleuScorer::CalcBleuStats(), and MosesTuning::BleuScorer::ProcessReferenceLine().

Here is the caller graph for this function:

const_iterator MosesTuning::NgramCounts::find ( const Key ngram  )  const [inline]

Definition at line 95 of file Ngram.h.

iterator MosesTuning::NgramCounts::find ( const Key ngram  )  [inline]

Definition at line 92 of file Ngram.h.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

int MosesTuning::NgramCounts::get_default_count (  )  const [inline]

Definition at line 88 of file Ngram.h.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

bool MosesTuning::NgramCounts::Lookup ( const Key ngram,
Value v 
) const [inline]

Return true iff the specified "ngram" is found in the container.

Definition at line 55 of file Ngram.h.

Referenced by BOOST_AUTO_TEST_CASE(), MosesTuning::BleuScorer::CalcBleuStats(), and MosesTuning::BleuScorer::ProcessReferenceLine().

Here is the caller graph for this function:

std::size_t MosesTuning::NgramCounts::max_size (  )  const [inline]

Definition at line 83 of file Ngram.h.

Value& MosesTuning::NgramCounts::operator[] ( const Key ngram  )  [inline]

Definition at line 99 of file Ngram.h.

std::size_t MosesTuning::NgramCounts::size (  )  const [inline]

Return the the number of elements in the container.

Definition at line 79 of file Ngram.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 file:

Generated on Thu Jul 6 00:34:18 2017 for Moses by  doxygen 1.5.9