lm::PrefixOrder Class Reference

#include <compare.hh>

Inheritance diagram for lm::PrefixOrder:

Inheritance graph
[legend]
Collaboration diagram for lm::PrefixOrder:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 PrefixOrder (std::size_t order)
bool Compare (const WordIndex *lhs, const WordIndex *rhs) const

Static Public Attributes

static const unsigned kMatchOffset = 0


Detailed Description

N-gram comparator that compares n-grams according to their natural (prefix) order.

This comparator compares n-grams lexicographically, one word at a time, beginning with the first word of each n-gram and ending with the last word of each n-gram.

Some examples of n-gram comparisons as defined by this comparator:

Definition at line 144 of file compare.hh.


Constructor & Destructor Documentation

lm::PrefixOrder::PrefixOrder ( 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 152 of file compare.hh.


Member Function Documentation

bool lm::PrefixOrder::Compare ( const WordIndex lhs,
const WordIndex rhs 
) const [inline]

Compares two n-grams lexicographically, one word at a time, beginning with the first word of each n-gram and ending with the last word of each n-gram.

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

Definition at line 161 of file compare.hh.

References lm::Comparator< PrefixOrder >::order_.


Member Data Documentation

const unsigned lm::PrefixOrder::kMatchOffset = 0 [static]

Definition at line 169 of file compare.hh.


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

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