sapt::imTSA< TOKEN > Class Template Reference

#include <ug_im_tsa.h>

Inheritance diagram for sapt::imTSA< TOKEN >:

Inheritance graph
[legend]
Collaboration diagram for sapt::imTSA< TOKEN >:

Collaboration graph
[legend]

List of all members.

Classes

class  tree_iterator

Public Member Functions

 imTSA ()
 imTSA (boost::shared_ptr< Ttrack< TOKEN > const > c, bdBitset const *filt, std::ostream *log=NULL, size_t threads=0)
 imTSA (imTSA< TOKEN > const &prior, boost::shared_ptr< imTtrack< TOKEN > const > const &crp, std::vector< id_type > const &newsids, size_t const vsize)
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
void save_as_mm_tsa (std::string fname) const

Friends

class tree_iterator


Detailed Description

template<typename TOKEN>
class sapt::imTSA< TOKEN >

Definition at line 57 of file ug_im_tsa.h.


Constructor & Destructor Documentation

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

template<typename TOKEN >
sapt::imTSA< TOKEN >::imTSA ( boost::shared_ptr< Ttrack< TOKEN > const >  c,
bdBitset const *  filt,
std::ostream *  log = NULL,
size_t  threads = 0 
) [inline]

template<typename TOKEN >
sapt::imTSA< TOKEN >::imTSA ( imTSA< TOKEN > const &  prior,
boost::shared_ptr< imTtrack< TOKEN > const > const &  crp,
std::vector< id_type > const &  newsids,
size_t const   vsize 
) [inline]


Member Function Documentation

template<typename TOKEN >
void sapt::imTSA< 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 360 of file ug_im_tsa.h.

References sapt::check(), sapt::TSA< TOKEN >::corpus, sapt::ttrack::Position::sid, and sid.

Here is the call graph for this function:

template<typename TOKEN >
count_type sapt::imTSA< 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 350 of file ug_im_tsa.h.

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

Implements sapt::TSA< TOKEN >.

Definition at line 339 of file ug_im_tsa.h.

template<typename TOKEN >
char const * sapt::imTSA< 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 328 of file ug_im_tsa.h.

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

Implements sapt::TSA< TOKEN >.

Definition at line 317 of file ug_im_tsa.h.

template<typename TOKEN >
char const * sapt::imTSA< 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 306 of file ug_im_tsa.h.

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

template<typename TOKEN >
void sapt::imTSA< TOKEN >::save_as_mm_tsa ( std::string  fname  )  const [inline]

Definition at line 380 of file ug_im_tsa.h.

References index, k, tpt::numwrite(), sid, and tpt::tightwrite().

Referenced by build_mmTSA().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename TOKEN>
count_type sapt::imTSA< 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 tree_iterator [friend]

Reimplemented from sapt::TSA< TOKEN >.

Definition at line 62 of file ug_im_tsa.h.


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

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