sapt::mmTSA< TOKEN > Class Template Reference

#include <ug_mm_tsa.h>

Inheritance diagram for sapt::mmTSA< TOKEN >:

Inheritance graph
[legend]
Collaboration diagram for sapt::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 sapt::mmTSA< TOKEN >

Definition at line 25 of file ug_mm_tsa.h.


Member Typedef Documentation

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

Reimplemented from sapt::TSA< TOKEN >.

Definition at line 28 of file ug_mm_tsa.h.


Constructor & Destructor Documentation

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

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

Definition at line 111 of file ug_mm_tsa.h.

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

Here is the call graph for this function:


Member Function Documentation

template<typename TOKEN >
void sapt::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 sapt::TSA< TOKEN >.

Definition at line 240 of file ug_mm_tsa.h.

References sapt::check(), sapt::TSA< TOKEN >::corpus, sid, and tpt::tightread().

Here is the call graph for this function:

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

template<typename TOKEN >
count_type sapt::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 sapt::TSA< TOKEN >.

Definition at line 222 of file ug_mm_tsa.h.

References sid, and tpt::tightread().

Here is the call graph for this function:

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

Implements sapt::TSA< TOKEN >.

Definition at line 212 of file ug_mm_tsa.h.

References tpt::tightread().

Here is the call graph for this function:

template<typename TOKEN >
char const * sapt::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 sapt::TSA< TOKEN >.

Definition at line 201 of file ug_mm_tsa.h.

References tpt::tightread().

Here is the call graph for this function:

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

Implements sapt::TSA< TOKEN >.

Definition at line 190 of file ug_mm_tsa.h.

References tpt::tightread().

Here is the call graph for this function:

template<typename TOKEN >
char const * sapt::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 sapt::TSA< TOKEN >.

Definition at line 180 of file ug_mm_tsa.h.

References tpt::tightread().

Here is the call graph for this function:

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

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

Returns:
sentence count

Reimplemented from sapt::TSA< TOKEN >.


Friends And Related Function Documentation

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

Definition at line 29 of file ug_mm_tsa.h.


Member Data Documentation

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

Definition at line 35 of file ug_mm_tsa.h.

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


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

Generated on Thu Jul 6 00:34:27 2017 for Moses by  doxygen 1.5.9