ugdiss::mmTSA< TOKEN > Class Template Reference

#include <ug_mm_tsa.h>

Inheritance diagram for ugdiss::mmTSA< TOKEN >:

Inheritance graph
[legend]
Collaboration diagram for ugdiss::mmTSA< TOKEN >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef TSA< TOKEN >::tree_iterator tree_iterator

Public Member Functions

 mmTSA ()
 mmTSA (std::string fname, Ttrack< TOKEN > const *c)
void open (std::string fname, typename boost::shared_ptr< Ttrack< TOKEN > const > c)
count_type sntCnt (char const *p, char const *const q) const
count_type rawCnt (char const *p, char const *const q) const
void getCounts (char const *p, char const *const q, count_type &sids, count_type &raw) const
char const * readSid (char const *p, char const *q, id_type &sid) const
char const * readSid (char const *p, char const *q,::uint64_t &sid) const
char const * readOffset (char const *p, char const *q, uint16_t &offset) const
char const * readOffset (char const *p, char const *q,::uint64_t &offset) const
void sanityCheck () const

Public Attributes

filepos_type const * index

Friends

class TSA_tree_iterator< TOKEN >


Detailed Description

template<typename TOKEN>
class ugdiss::mmTSA< TOKEN >

Definition at line 26 of file ug_mm_tsa.h.


Member Typedef Documentation

template<typename TOKEN>
typedef TSA<TOKEN>::tree_iterator ugdiss::mmTSA< TOKEN >::tree_iterator

Reimplemented from ugdiss::TSA< TOKEN >.

Definition at line 29 of file ug_mm_tsa.h.


Constructor & Destructor Documentation

template<typename TOKEN >
ugdiss::mmTSA< TOKEN >::mmTSA (  )  [inline]

template<typename TOKEN>
ugdiss::mmTSA< TOKEN >::mmTSA ( std::string  fname,
Ttrack< TOKEN > const *  c 
) [inline]

Definition at line 112 of file ug_mm_tsa.h.

References ugdiss::mmTSA< TOKEN >::open().

Here is the call graph for this function:


Member Function Documentation

template<typename TOKEN >
void ugdiss::mmTSA< TOKEN >::getCounts ( char const *  p,
char const *const   q,
count_type sids,
count_type raw 
) const [inline, virtual]

get both sentence and word counts.

Avoids having to go over the byte range representing the range of suffixes in question twice when dealing with memory-mapped suffix arrays.

Implements ugdiss::TSA< TOKEN >.

Definition at line 241 of file ug_mm_tsa.h.

References MosesServer::check(), ugdiss::TSA< TOKEN >::corpus, sid, and ugdiss::tightread().

Here is the call graph for this function:

template<typename TOKEN>
void ugdiss::mmTSA< TOKEN >::open ( std::string  fname,
typename boost::shared_ptr< Ttrack< TOKEN > const >  c 
) [inline]

template<typename TOKEN >
count_type ugdiss::mmTSA< TOKEN >::rawCnt ( char const *  p,
char const *const   q 
) const [inline, virtual]

Returns:
raw occurrence count
depending on the subclass, this is constant time (imTSA) or linear in in the number of occurrences (mmTSA).

Implements ugdiss::TSA< TOKEN >.

Definition at line 223 of file ug_mm_tsa.h.

References sid, and ugdiss::tightread().

Here is the call graph for this function:

template<typename TOKEN >
char const * ugdiss::mmTSA< TOKEN >::readOffset ( char const *  p,
char const *  q,
::uint64_t &  offset 
) const [inline, virtual]

Implements ugdiss::TSA< TOKEN >.

Definition at line 213 of file ug_mm_tsa.h.

References ugdiss::tightread().

Here is the call graph for this function:

template<typename TOKEN >
char const * ugdiss::mmTSA< TOKEN >::readOffset ( char const *  p,
char const *  q,
uint16_t &  offset 
) const [inline, virtual]

read the offset part of the index entry into /offset/

Returns:
position of the next entry in the index.
The function provides an abstraction that uses the right interpretation of the position based on the subclass (memory-mapped or in-memory).

Implements ugdiss::TSA< TOKEN >.

Definition at line 202 of file ug_mm_tsa.h.

References ugdiss::tightread().

Here is the call graph for this function:

template<typename TOKEN >
char const * ugdiss::mmTSA< TOKEN >::readSid ( char const *  p,
char const *  q,
::uint64_t &  sid 
) const [inline, virtual]

Implements ugdiss::TSA< TOKEN >.

Definition at line 191 of file ug_mm_tsa.h.

References ugdiss::tightread().

Here is the call graph for this function:

template<typename TOKEN >
char const * ugdiss::mmTSA< TOKEN >::readSid ( char const *  p,
char const *  q,
id_type sid 
) const [inline, virtual]

read the sentence ID into /sid/

Returns:
position of associated offset.
The function provides an abstraction that uses the right interpretation of the position based on the subclass (memory-mapped or in-memory).

Implements ugdiss::TSA< TOKEN >.

Definition at line 181 of file ug_mm_tsa.h.

References ugdiss::tightread().

Here is the call graph for this function:

template<typename TOKEN>
void ugdiss::mmTSA< TOKEN >::sanityCheck (  )  const

template<typename TOKEN>
count_type ugdiss::mmTSA< TOKEN >::sntCnt ( char const *  p,
char const *const   q 
) const

Returns:
sentence count

Reimplemented from ugdiss::TSA< TOKEN >.


Friends And Related Function Documentation

template<typename TOKEN>
friend class TSA_tree_iterator< TOKEN > [friend]

Definition at line 30 of file ug_mm_tsa.h.


Member Data Documentation

template<typename TOKEN>
filepos_type const* ugdiss::mmTSA< TOKEN >::index

Definition at line 36 of file ug_mm_tsa.h.

Referenced by ugdiss::mmTSA< TOKEN >::open().


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

Generated on Sun Aug 9 00:34:29 2015 for Moses by  doxygen 1.5.9