#include <Ngram.h>
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 |
Value & | operator[] (const Key &ngram) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
Definition at line 15 of file Ngram.h.
typedef boost::unordered_map<Key, Value>::const_iterator MosesTuning::NgramCounts::const_iterator |
typedef boost::unordered_map<Key, Value>::iterator MosesTuning::NgramCounts::iterator |
typedef std::vector<int> MosesTuning::NgramCounts::Key |
typedef int MosesTuning::NgramCounts::Value |
virtual MosesTuning::NgramCounts::~NgramCounts | ( | ) | [inline, virtual] |
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().
const_iterator MosesTuning::NgramCounts::begin | ( | ) | const [inline] |
iterator MosesTuning::NgramCounts::begin | ( | ) | [inline] |
Definition at line 103 of file Ngram.h.
Referenced by MosesTuning::BleuScorer::CalcBleuStats(), and MosesTuning::BleuScorer::ProcessReferenceLine().
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().
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().
const_iterator MosesTuning::NgramCounts::end | ( | ) | const [inline] |
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().
const_iterator MosesTuning::NgramCounts::find | ( | const Key & | ngram | ) | const [inline] |
Definition at line 92 of file Ngram.h.
Referenced by BOOST_AUTO_TEST_CASE().
int MosesTuning::NgramCounts::get_default_count | ( | ) | const [inline] |
Definition at line 88 of file Ngram.h.
Referenced by BOOST_AUTO_TEST_CASE().
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().
std::size_t MosesTuning::NgramCounts::max_size | ( | ) | const [inline] |
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().