lm::Comparator< Child > Class Template Reference

#include <compare.hh>

Inheritance diagram for lm::Comparator< Child >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 Comparator (std::size_t order)
bool operator() (const void *lhs, const void *rhs) const
std::size_t Order () const

Protected Attributes

std::size_t order_


Detailed Description

template<class Child>
class lm::Comparator< Child >

Abstract parent class for defining custom n-gram comparators.

Definition at line 14 of file compare.hh.


Constructor & Destructor Documentation

template<class Child>
lm::Comparator< Child >::Comparator ( std::size_t  order  )  [inline, explicit]

Constructs a comparator capable of comparing two n-grams.

Parameters:
order Number of words in each n-gram

Definition at line 22 of file compare.hh.


Member Function Documentation

template<class Child>
bool lm::Comparator< Child >::operator() ( const void *  lhs,
const void *  rhs 
) const [inline]

Applies the comparator using the Compare method that must be defined in any class that inherits from this class.

Parameters:
lhs A pointer to the n-gram on the left-hand side of the comparison
rhs A pointer to the n-gram on the right-hand side of the comparison
See also:
ContextOrder::Compare

PrefixOrder::Compare

SuffixOrder::Compare

Definition at line 34 of file compare.hh.

template<class Child>
std::size_t lm::Comparator< Child >::Order (  )  const [inline]

Gets the n-gram order defined for this comparator.

Definition at line 39 of file compare.hh.

Referenced by lm::builder::CombineCounts::operator()().

Here is the caller graph for this function:


Member Data Documentation

template<class Child>
std::size_t lm::Comparator< Child >::order_ [protected]

Definition at line 42 of file compare.hh.

Referenced by lm::Comparator< SuffixOrder >::Order().


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

Generated on Thu Jul 6 00:32:39 2017 for Moses by  doxygen 1.5.9