sapt::Bitext< TKN > Class Template Reference

#include <ug_bitext.h>

Inheritance diagram for sapt::Bitext< TKN >:

Inheritance graph
[legend]
Collaboration diagram for sapt::Bitext< TKN >:

Collaboration graph
[legend]

List of all members.

Classes

class  agenda

Public Types

typedef TKN Token
typedef TSA< Token >::tree_iterator iter
typedef std::vector
< PhrasePair< Token > > 
vec_ppair
typedef lru_cache::LRU_Cache
< uint64_t, vec_ppair
pplist_cache_t
typedef TSA< Tokentsa

Public Member Functions

bool find_trg_phr_bounds (PhraseExtractionRecord &rec) const
 given the source phrase sid[start:stop]
bool find_trg_phr_bounds (size_t const sid, size_t const start, size_t const stop, size_t &s1, size_t &s2, size_t &e1, size_t &e2, int &po_fwd, int &po_bwd, std::vector< unsigned char > *core_alignment, bitvector *full_alignment, bool const flip) const
SPTR< pstatsprep2 (iter const &phrase, int max_sample=-1) const
SPTR< pstatsprep2 (ttasksptr const &ttask, iter const &phrase, bool const track_sids, int max_sample=-1) const
virtual void open (std::string const base, std::string const L1, std::string const L2)=0
SPTR< pstatslookup (iter const &phrase, int max_sample=-1) const
void prep (iter const &phrase) const
SPTR< pstatslookup (ttasksptr const &ttask, iter const &phrase, int max_sample=-1) const
void prep (ttasksptr const &ttask, iter const &phrase, bool const track_sids) const
void setDefaultSampleSize (size_t const max_samples)
size_t getDefaultSampleSize () const
std::string toString (uint64_t pid, int isL2) const
virtual size_t revision () const
SPTR< SentenceBiasloadSentenceBias (std::string const &fname) const
SPTR< DocumentBiasSetupDocumentBias (std::string const &bserver, std::string const &text, std::ostream *log) const
SPTR< DocumentBiasSetupDocumentBias (std::map< std::string, float > context_weights, std::ostream *log) const
void mark_match (Token const *start, Token const *end, iter const &m, bitvector &check) const
void write_yawat_alignment (id_type const sid, iter const *m1, iter const *m2, std::ostream &out) const
std::string sid2docname (id_type const sid) const
std::string docid2name (id_type const sid) const
int docname2docid (std::string const &name) const
std::vector< id_type > const * sid2did () const
int sid2did (uint32_t sid) const

Public Attributes

SPTR< Ttrack< char > > Tx
SPTR< Ttrack< Token > > T1
SPTR< Ttrack< Token > > T2
SPTR< TokenIndexV1
SPTR< TokenIndexV2
SPTR< TSA< Token > > I1
SPTR< TSA< Token > > I2

Protected Member Functions

 Bitext (size_t const max_sample=1000, size_t const xnum_workers=16)
 Bitext (Ttrack< Token > *const t1, Ttrack< Token > *const t2, Ttrack< char > *const tx, TokenIndex *const v1, TokenIndex *const v2, TSA< Token > *const i1, TSA< Token > *const i2, size_t const max_sample=1000, size_t const xnum_workers=16)

Protected Attributes

boost::shared_mutex m_lock
SPTR< agendaag
size_t m_num_workers
size_t m_default_sample_size
size_t m_pstats_cache_threshold
SPTR< pstats::cache_tm_cache1
SPTR< pstats::cache_tm_cache2
std::vector< std::string > m_docname
std::map< std::string, id_typem_docname2docid
SPTR< std::vector< id_type > > m_sid2docid
pplist_cache_t m_pplist_cache1
pplist_cache_t m_pplist_cache2

Friends

class BitextSampler
class Moses::Mmsapt


Detailed Description

template<typename TKN>
class sapt::Bitext< TKN >

Definition at line 105 of file ug_bitext.h.


Member Typedef Documentation

template<typename TKN>
typedef TSA<Token>::tree_iterator sapt::Bitext< TKN >::iter

Definition at line 110 of file ug_bitext.h.

template<typename TKN>
typedef lru_cache::LRU_Cache<uint64_t, vec_ppair> sapt::Bitext< TKN >::pplist_cache_t

Definition at line 112 of file ug_bitext.h.

template<typename TKN>
typedef TKN sapt::Bitext< TKN >::Token

Definition at line 109 of file ug_bitext.h.

template<typename TKN>
typedef TSA<Token> sapt::Bitext< TKN >::tsa

Definition at line 113 of file ug_bitext.h.

template<typename TKN>
typedef std::vector<PhrasePair<Token> > sapt::Bitext< TKN >::vec_ppair

Definition at line 111 of file ug_bitext.h.


Constructor & Destructor Documentation

template<typename Token >
sapt::Bitext< Token >::Bitext ( size_t const   max_sample = 1000,
size_t const   xnum_workers = 16 
) [inline, protected]

Definition at line 876 of file ug_bitext.h.

template<typename Token >
sapt::Bitext< Token >::Bitext ( Ttrack< Token > *const   t1,
Ttrack< Token > *const   t2,
Ttrack< char > *const   tx,
TokenIndex *const   v1,
TokenIndex *const   v2,
TSA< Token > *const   i1,
TSA< Token > *const   i2,
size_t const   max_sample = 1000,
size_t const   xnum_workers = 16 
) [inline, protected]

Definition at line 886 of file ug_bitext.h.


Member Function Documentation

template<typename Token >
std::string sapt::Bitext< Token >::docid2name ( id_type const   sid  )  const [inline]

Definition at line 782 of file ug_bitext.h.

Referenced by print_evidence_list().

Here is the caller graph for this function:

template<typename Token >
int sapt::Bitext< Token >::docname2docid ( std::string const &  name  )  const [inline]

Definition at line 771 of file ug_bitext.h.

template<typename Token >
bool sapt::Bitext< Token >::find_trg_phr_bounds ( size_t const   sid,
size_t const   start,
size_t const   stop,
size_t &  s1,
size_t &  s2,
size_t &  e1,
size_t &  e2,
int &  po_fwd,
int &  po_bwd,
std::vector< unsigned char > *  core_alignment,
bitvector full_alignment,
bool const   flip 
) const [inline]

Definition at line 936 of file ug_bitext.h.

template<typename Token >
bool sapt::Bitext< Token >::find_trg_phr_bounds ( PhraseExtractionRecord rec  )  const [inline]

given the source phrase sid[start:stop]

Definition at line 924 of file ug_bitext.h.

template<typename Token >
size_t sapt::Bitext< Token >::getDefaultSampleSize (  )  const [inline]

Definition at line 856 of file ug_bitext.h.

template<typename Token >
SPTR< SentenceBias > sapt::Bitext< Token >::loadSentenceBias ( std::string const &  fname  )  const [inline]

Definition at line 823 of file ug_bitext.h.

template<typename Token >
SPTR< pstats > sapt::Bitext< Token >::lookup ( ttasksptr const &  ttask,
iter const &  phrase,
int  max_sample = -1 
) const [inline]

Definition at line 9 of file ug_bitext_moses.h.

References UTIL_THROW_IF2.

template<typename TKN>
SPTR<pstats> sapt::Bitext< TKN >::lookup ( iter const &  phrase,
int  max_sample = -1 
) const

Referenced by main().

Here is the caller graph for this function:

template<typename Token >
void sapt::Bitext< Token >::mark_match ( Token const *  start,
Token const *  end,
iter const &  m,
bitvector check 
) const [inline]

Definition at line 1193 of file ug_bitext.h.

template<typename TKN>
virtual void sapt::Bitext< TKN >::open ( std::string const   base,
std::string const   L1,
std::string const   L2 
) [pure virtual]

template<typename Token >
void sapt::Bitext< Token >::prep ( ttasksptr const &  ttask,
iter const &  phrase,
bool const   track_sids 
) const [inline]

Definition at line 33 of file ug_bitext_moses.h.

References sapt::Bitext< TKN >::m_default_sample_size, and sapt::Bitext< TKN >::prep2().

Here is the call graph for this function:

template<typename Token >
void sapt::Bitext< Token >::prep ( iter const &  phrase  )  const [inline]

Definition at line 1076 of file ug_bitext.h.

template<typename Token >
SPTR< pstats > sapt::Bitext< Token >::prep2 ( ttasksptr const &  ttask,
iter const &  phrase,
bool const   track_sids,
int  max_sample = -1 
) const [inline]

template<typename Token >
SPTR< pstats > sapt::Bitext< Token >::prep2 ( iter const &  phrase,
int  max_sample = -1 
) const [inline]

Definition at line 1091 of file ug_bitext.h.

Referenced by sapt::Bitext< TKN >::prep().

Here is the caller graph for this function:

template<typename TKN>
virtual size_t sapt::Bitext< TKN >::revision (  )  const [inline, virtual]

Reimplemented in sapt::imBitext< TKN >.

Definition at line 200 of file ug_bitext.h.

template<typename Token >
void sapt::Bitext< Token >::setDefaultSampleSize ( size_t const   max_samples  )  [inline]

Definition at line 863 of file ug_bitext.h.

template<typename Token >
SPTR< DocumentBias > sapt::Bitext< Token >::SetupDocumentBias ( std::map< std::string, float >  context_weights,
std::ostream *  log 
) const [inline]

Definition at line 1063 of file ug_bitext.h.

template<typename Token >
SPTR< DocumentBias > sapt::Bitext< Token >::SetupDocumentBias ( std::string const &  bserver,
std::string const &  text,
std::ostream *  log 
) const [inline]

Definition at line 1049 of file ug_bitext.h.

template<typename Token >
int sapt::Bitext< Token >::sid2did ( uint32_t  sid  )  const [inline]

Definition at line 812 of file ug_bitext.h.

template<typename Token >
std::vector< id_type > const * sapt::Bitext< Token >::sid2did (  )  const [inline]

Definition at line 804 of file ug_bitext.h.

Referenced by main().

Here is the caller graph for this function:

template<typename Token >
std::string sapt::Bitext< Token >::sid2docname ( id_type const   sid  )  const [inline]

Definition at line 793 of file ug_bitext.h.

Referenced by main().

Here is the caller graph for this function:

template<typename Token >
std::string sapt::Bitext< Token >::toString ( uint64_t  pid,
int  isL2 
) const [inline]

Definition at line 838 of file ug_bitext.h.

template<typename Token >
void sapt::Bitext< Token >::write_yawat_alignment ( id_type const   sid,
iter const *  m1,
iter const *  m2,
std::ostream &  out 
) const [inline]

Definition at line 1223 of file ug_bitext.h.


Friends And Related Function Documentation

template<typename TKN>
friend class BitextSampler [friend]

Definition at line 108 of file ug_bitext.h.

template<typename TKN>
friend class Moses::Mmsapt [friend]

Definition at line 114 of file ug_bitext.h.


Member Data Documentation

template<typename TKN>
SPTR<agenda> sapt::Bitext< TKN >::ag [mutable, protected]

Definition at line 118 of file ug_bitext.h.

template<typename TKN>
SPTR<TSA<Token> > sapt::Bitext< TKN >::I1

Definition at line 139 of file ug_bitext.h.

Referenced by main().

template<typename TKN>
SPTR<TSA<Token> > sapt::Bitext< TKN >::I2

Definition at line 140 of file ug_bitext.h.

Referenced by main(), and show().

template<typename TKN>
SPTR<pstats::cache_t> sapt::Bitext< TKN >::m_cache1 [protected]

Definition at line 124 of file ug_bitext.h.

template<typename TKN>
SPTR<pstats::cache_t> sapt::Bitext< TKN >::m_cache2 [protected]

Definition at line 124 of file ug_bitext.h.

template<typename TKN>
size_t sapt::Bitext< TKN >::m_default_sample_size [protected]

Definition at line 122 of file ug_bitext.h.

Referenced by sapt::Bitext< TKN >::prep().

template<typename TKN>
std::vector<std::string> sapt::Bitext< TKN >::m_docname [protected]

Definition at line 126 of file ug_bitext.h.

template<typename TKN>
std::map<std::string,id_type> sapt::Bitext< TKN >::m_docname2docid [protected]

Definition at line 127 of file ug_bitext.h.

template<typename TKN>
boost::shared_mutex sapt::Bitext< TKN >::m_lock [mutable, protected]

Definition at line 116 of file ug_bitext.h.

template<typename TKN>
size_t sapt::Bitext< TKN >::m_num_workers [protected]

Definition at line 120 of file ug_bitext.h.

template<typename TKN>
pplist_cache_t sapt::Bitext< TKN >::m_pplist_cache1 [mutable, protected]

Definition at line 130 of file ug_bitext.h.

template<typename TKN>
pplist_cache_t sapt::Bitext< TKN >::m_pplist_cache2 [mutable, protected]

Definition at line 130 of file ug_bitext.h.

template<typename TKN>
size_t sapt::Bitext< TKN >::m_pstats_cache_threshold [protected]

Definition at line 123 of file ug_bitext.h.

template<typename TKN>
SPTR<std::vector<id_type> > sapt::Bitext< TKN >::m_sid2docid [protected]

Definition at line 128 of file ug_bitext.h.

Referenced by sapt::Bitext< TKN >::agenda::job::done().

template<typename TKN>
SPTR<Ttrack<Token> > sapt::Bitext< TKN >::T1

template<typename TKN>
SPTR<Ttrack<Token> > sapt::Bitext< TKN >::T2

template<typename TKN>
SPTR<Ttrack<char> > sapt::Bitext< TKN >::Tx

Definition at line 134 of file ug_bitext.h.

template<typename TKN>
SPTR<TokenIndex> sapt::Bitext< TKN >::V1

Definition at line 137 of file ug_bitext.h.

Referenced by main(), sapt::PScoreLex1< Token >::operator()(), show(), and show_pair().

template<typename TKN>
SPTR<TokenIndex> sapt::Bitext< TKN >::V2

Definition at line 138 of file ug_bitext.h.

Referenced by main(), sapt::PScoreLex1< Token >::operator()(), and show_pair().


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

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