#include <Ngram.h>
Classes | |
struct | NgramComparator |
Public Types | |
typedef std::vector< int > | Key |
typedef int | Value |
typedef std::map< Key, Value, NgramComparator >::iterator | iterator |
typedef std::map< Key, Value, NgramComparator > ::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 12 of file Ngram.h.
typedef std::map<Key, Value, NgramComparator>::const_iterator NgramCounts::const_iterator |
typedef std::map<Key, Value, NgramComparator>::iterator NgramCounts::iterator |
typedef std::vector<int> NgramCounts::Key |
typedef int NgramCounts::Value |
void 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 44 of file Ngram.h.
Referenced by BOOST_AUTO_TEST_CASE().
const_iterator NgramCounts::begin | ( | ) | const [inline] |
void NgramCounts::clear | ( | ) | [inline] |
Clear all elments in the container.
Definition at line 66 of file Ngram.h.
Referenced by BOOST_AUTO_TEST_CASE().
bool NgramCounts::empty | ( | ) | const [inline] |
Return true iff the container is empty.
Definition at line 71 of file Ngram.h.
Referenced by BOOST_AUTO_TEST_CASE().
const_iterator NgramCounts::end | ( | ) | const [inline] |
iterator NgramCounts::end | ( | ) | [inline] |
Definition at line 90 of file Ngram.h.
Referenced by Add(), and BOOST_AUTO_TEST_CASE().
const_iterator NgramCounts::find | ( | const Key & | ngram | ) | const [inline] |
Definition at line 83 of file Ngram.h.
Referenced by Add(), and BOOST_AUTO_TEST_CASE().
int NgramCounts::get_default_count | ( | ) | const [inline] |
Definition at line 81 of file Ngram.h.
Referenced by BOOST_AUTO_TEST_CASE().
Return true iff the specified "ngram" is found in the container.
Definition at line 56 of file Ngram.h.
Referenced by BOOST_AUTO_TEST_CASE().
std::size_t NgramCounts::size | ( | ) | const [inline] |
Return the the number of elements in the container.
Definition at line 76 of file Ngram.h.
Referenced by BOOST_AUTO_TEST_CASE().