Moses::PhraseDictionaryDynamicCacheBased Class Reference

#include <PhraseDictionaryDynamicCacheBased.h>

Inheritance diagram for Moses::PhraseDictionaryDynamicCacheBased:

Inheritance graph
[legend]
Collaboration diagram for Moses::PhraseDictionaryDynamicCacheBased:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 PhraseDictionaryDynamicCacheBased (const std::string &line)
 contructor
 ~PhraseDictionaryDynamicCacheBased ()
const std::string GetName ()
void SetName (const std::string name)
void Load (AllOptions::ptr const &opts)
 override to load model files
void Load (const std::string files)
TargetPhraseCollection::shared_ptr GetTargetPhraseCollection (const Phrase &src) const
TargetPhraseCollection::shared_ptr GetTargetPhraseCollectionLEGACY (Phrase const &src) const
 find list of translations that can translates src. Only for phrase input
TargetPhraseCollection::shared_ptr GetTargetPhraseCollectionNonCacheLEGACY (Phrase const &src) const
ChartRuleLookupManagerCreateRuleLookupManager (const ChartParser &, const ChartCellCollectionBase &, std::size_t)
 Create a sentence-specific manager for SCFG rule lookup.
void SetParameter (const std::string &key, const std::string &value)
void InitializeForInput (ttasksptr const &ttask)
 Create entry for translation of source to targetPhrase.
void Print () const
void Clear ()
void ClearEntries (std::string &entries)
void ClearSource (std::string &entries)
void Insert (std::string &entries)
void Execute (std::string command)
void ExecuteDlt (std::map< std::string, std::string > dlt_meta)
void SetScoreType (size_t type)
void SetMaxAge (unsigned int age)

Static Public Member Functions

static const
PhraseDictionaryDynamicCacheBased
Instance (const std::string &name)
static
PhraseDictionaryDynamicCacheBased
InstanceNonConst (const std::string &name)
static const
PhraseDictionaryDynamicCacheBased
Instance ()
static
PhraseDictionaryDynamicCacheBased
InstanceNonConst ()

Protected Member Functions

float decaying_score (const int age)
void Insert (std::vector< std::string > entries)
void Decay ()
void Decay (Phrase p)
void Update (std::vector< std::string > entries, std::string ageString)
void Update (std::string sourceString, std::string targetString, std::string ageString, std::string waString="")
void Update (Phrase p, TargetPhrase tp, int age, std::string waString="")
void ClearEntries (std::vector< std::string > entries)
void ClearEntries (std::string sourceString, std::string targetString)
void ClearEntries (Phrase p, Phrase tp)
void ClearSource (std::vector< std::string > entries)
void ClearSource (Phrase sp)
void Execute (std::vector< std::string > commands)
void Execute_Single_Command (std::string command)
void SetPreComputedScores (const unsigned int numScoreComponent)
Scores GetPreComputedScores (const unsigned int age)
void Load_Multiple_Files (std::vector< std::string > files)
void Load_Single_File (const std::string file)
TargetPhraseCreateTargetPhrase (const Phrase &sourcePhrase) const

Static Protected Attributes

static
PhraseDictionaryDynamicCacheBased
s_instance = NULL
static std::map< const
std::string,
PhraseDictionaryDynamicCacheBased * > 
s_instance_map

Friends

std::ostream & operator<< (std::ostream &, const PhraseDictionaryDynamicCacheBased &)


Detailed Description

Implementation of a Cache-based phrase table.

Definition at line 52 of file PhraseDictionaryDynamicCacheBased.h.


Constructor & Destructor Documentation

Moses::PhraseDictionaryDynamicCacheBased::PhraseDictionaryDynamicCacheBased ( const std::string &  line  ) 

Moses::PhraseDictionaryDynamicCacheBased::~PhraseDictionaryDynamicCacheBased (  ) 

Definition at line 58 of file PhraseDictionaryDynamicCacheBased.cpp.

References Clear().

Here is the call graph for this function:


Member Function Documentation

void Moses::PhraseDictionaryDynamicCacheBased::Clear (  ) 

Definition at line 703 of file PhraseDictionaryDynamicCacheBased.cpp.

Referenced by Execute_Single_Command(), ExecuteDlt(), and ~PhraseDictionaryDynamicCacheBased().

Here is the caller graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::ClearEntries ( Phrase  p,
Phrase  tp 
) [protected]

Definition at line 354 of file PhraseDictionaryDynamicCacheBased.cpp.

References NULL, and VERBOSE.

void Moses::PhraseDictionaryDynamicCacheBased::ClearEntries ( std::string  sourceString,
std::string  targetString 
) [protected]

void Moses::PhraseDictionaryDynamicCacheBased::ClearEntries ( std::vector< std::string >  entries  )  [protected]

Definition at line 313 of file PhraseDictionaryDynamicCacheBased.cpp.

References ClearEntries(), Moses::TokenizeMultiCharSeparator(), and VERBOSE.

Here is the call graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::ClearEntries ( std::string &  entries  ) 

Definition at line 303 of file PhraseDictionaryDynamicCacheBased.cpp.

References Moses::TokenizeMultiCharSeparator(), and VERBOSE.

Referenced by ClearEntries(), ClearSource(), and ExecuteDlt().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::ClearSource ( Phrase  sp  )  [protected]

Definition at line 447 of file PhraseDictionaryDynamicCacheBased.cpp.

References VERBOSE.

void Moses::PhraseDictionaryDynamicCacheBased::ClearSource ( std::vector< std::string >  entries  )  [protected]

Definition at line 426 of file PhraseDictionaryDynamicCacheBased.cpp.

References Moses::Phrase::Clear(), ClearSource(), Moses::Phrase::CreateFromString(), IFVERBOSE, Moses::Input, Instance(), NULL, Print(), and VERBOSE.

Here is the call graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::ClearSource ( std::string &  entries  ) 

Definition at line 416 of file PhraseDictionaryDynamicCacheBased.cpp.

References ClearEntries(), Moses::TokenizeMultiCharSeparator(), and VERBOSE.

Referenced by ClearSource(), and ExecuteDlt().

Here is the call graph for this function:

Here is the caller graph for this function:

ChartRuleLookupManager * Moses::PhraseDictionaryDynamicCacheBased::CreateRuleLookupManager ( const ChartParser ,
const ChartCellCollectionBase ,
std::size_t   
) [virtual]

Create a sentence-specific manager for SCFG rule lookup.

Implements Moses::PhraseDictionary.

Definition at line 190 of file PhraseDictionaryDynamicCacheBased.cpp.

References UTIL_THROW.

TargetPhrase* Moses::PhraseDictionaryDynamicCacheBased::CreateTargetPhrase ( const Phrase sourcePhrase  )  const [protected]

void Moses::PhraseDictionaryDynamicCacheBased::Decay ( Phrase  p  )  [protected]

void Moses::PhraseDictionaryDynamicCacheBased::Decay (  )  [protected]

Definition at line 620 of file PhraseDictionaryDynamicCacheBased.cpp.

Referenced by Insert().

Here is the caller graph for this function:

float Moses::PhraseDictionaryDynamicCacheBased::decaying_score ( const int  age  )  [protected]

void Moses::PhraseDictionaryDynamicCacheBased::Execute ( std::vector< std::string >  commands  )  [protected]

Definition at line 684 of file PhraseDictionaryDynamicCacheBased.cpp.

References Execute_Single_Command(), IFVERBOSE, and Print().

Here is the call graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::Execute ( std::string  command  ) 

Definition at line 677 of file PhraseDictionaryDynamicCacheBased.cpp.

References Moses::Tokenize(), and VERBOSE.

Referenced by ExecuteDlt().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::Execute_Single_Command ( std::string  command  )  [protected]

Definition at line 692 of file PhraseDictionaryDynamicCacheBased.cpp.

References Clear(), and VERBOSE.

Referenced by Execute().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::ExecuteDlt ( std::map< std::string, std::string >  dlt_meta  ) 

Definition at line 719 of file PhraseDictionaryDynamicCacheBased.cpp.

References Clear(), ClearEntries(), ClearSource(), Execute(), Insert(), and Load().

Here is the call graph for this function:

const std::string Moses::PhraseDictionaryDynamicCacheBased::GetName (  )  [inline]

Definition at line 81 of file PhraseDictionaryDynamicCacheBased.h.

Scores Moses::PhraseDictionaryDynamicCacheBased::GetPreComputedScores ( const unsigned int  age  )  [protected]

Definition at line 294 of file PhraseDictionaryDynamicCacheBased.cpp.

Referenced by Decay(), and Update().

Here is the caller graph for this function:

TargetPhraseCollection::shared_ptr Moses::PhraseDictionaryDynamicCacheBased::GetTargetPhraseCollection ( const Phrase src  )  const

Definition at line 154 of file PhraseDictionaryDynamicCacheBased.cpp.

References Moses::PhraseDictionary::GetFeaturesToApply(), and Moses::PhraseDictionary::m_tableLimit.

Referenced by GetTargetPhraseCollectionLEGACY(), and GetTargetPhraseCollectionNonCacheLEGACY().

Here is the call graph for this function:

Here is the caller graph for this function:

TargetPhraseCollection::shared_ptr Moses::PhraseDictionaryDynamicCacheBased::GetTargetPhraseCollectionLEGACY ( Phrase const &  src  )  const [virtual]

find list of translations that can translates src. Only for phrase input

Reimplemented from Moses::PhraseDictionary.

Definition at line 178 of file PhraseDictionaryDynamicCacheBased.cpp.

References GetTargetPhraseCollection().

Here is the call graph for this function:

TargetPhraseCollection::shared_ptr Moses::PhraseDictionaryDynamicCacheBased::GetTargetPhraseCollectionNonCacheLEGACY ( Phrase const &  src  )  const [virtual]

Reimplemented from Moses::PhraseDictionary.

Definition at line 184 of file PhraseDictionaryDynamicCacheBased.cpp.

References GetTargetPhraseCollection().

Here is the call graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::InitializeForInput ( ttasksptr const &  ttask  )  [virtual]

Create entry for translation of source to targetPhrase.

Reimplemented from Moses::PhraseDictionary.

Definition at line 149 of file PhraseDictionaryDynamicCacheBased.cpp.

References Moses::PhraseDictionary::ReduceCache().

Here is the call graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::Insert ( std::vector< std::string >  entries  )  [protected]

Definition at line 481 of file PhraseDictionaryDynamicCacheBased.cpp.

References Decay(), IFVERBOSE, Print(), Update(), and VERBOSE.

Here is the call graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::Insert ( std::string &  entries  ) 

Definition at line 471 of file PhraseDictionaryDynamicCacheBased.cpp.

References Moses::TokenizeMultiCharSeparator(), and VERBOSE.

Referenced by ExecuteDlt().

Here is the call graph for this function:

Here is the caller graph for this function:

static const PhraseDictionaryDynamicCacheBased& Moses::PhraseDictionaryDynamicCacheBased::Instance (  )  [inline, static]

Definition at line 103 of file PhraseDictionaryDynamicCacheBased.h.

References s_instance.

Referenced by ClearEntries(), ClearSource(), Load(), and Update().

Here is the caller graph for this function:

static const PhraseDictionaryDynamicCacheBased* Moses::PhraseDictionaryDynamicCacheBased::Instance ( const std::string &  name  )  [inline, static]

Definition at line 88 of file PhraseDictionaryDynamicCacheBased.h.

References NULL, and s_instance_map.

static PhraseDictionaryDynamicCacheBased& Moses::PhraseDictionaryDynamicCacheBased::InstanceNonConst (  )  [inline, static]

Definition at line 107 of file PhraseDictionaryDynamicCacheBased.h.

References s_instance.

static PhraseDictionaryDynamicCacheBased* Moses::PhraseDictionaryDynamicCacheBased::InstanceNonConst ( const std::string &  name  )  [inline, static]

Definition at line 95 of file PhraseDictionaryDynamicCacheBased.h.

References NULL, and s_instance_map.

void Moses::PhraseDictionaryDynamicCacheBased::Load ( const std::string  files  ) 

Definition at line 75 of file PhraseDictionaryDynamicCacheBased.cpp.

References Load_Multiple_Files(), Moses::Tokenize(), and VERBOSE.

Here is the call graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::Load ( AllOptions::ptr const &  opts  )  [virtual]

override to load model files

Reimplemented from Moses::FeatureFunction.

Definition at line 63 of file PhraseDictionaryDynamicCacheBased.cpp.

References Instance(), Moses::FeatureFunction::m_options, Moses::PhraseDictionary::SetFeaturesToApply(), SetPreComputedScores(), and VERBOSE.

Referenced by ExecuteDlt().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::Load_Multiple_Files ( std::vector< std::string >  files  )  [protected]

Definition at line 83 of file PhraseDictionaryDynamicCacheBased.cpp.

References Load_Single_File(), and VERBOSE.

Referenced by Load().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::Load_Single_File ( const std::string  file  )  [protected]

Definition at line 91 of file PhraseDictionaryDynamicCacheBased.cpp.

References IFVERBOSE, Print(), Moses::TokenizeMultiCharSeparator(), Update(), UTIL_THROW_IF2, and VERBOSE.

Referenced by Load_Multiple_Files().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::Print (  )  const

Definition at line 742 of file PhraseDictionaryDynamicCacheBased.cpp.

References util::ToString(), and VERBOSE.

Referenced by ClearSource(), Execute(), Insert(), and Load_Single_File().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::SetMaxAge ( unsigned int  age  ) 

Definition at line 217 of file PhraseDictionaryDynamicCacheBased.cpp.

References VERBOSE.

Referenced by SetParameter().

Here is the caller graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::SetName ( const std::string  name  )  [inline]

Definition at line 84 of file PhraseDictionaryDynamicCacheBased.h.

void Moses::PhraseDictionaryDynamicCacheBased::SetParameter ( const std::string &  key,
const std::string &  value 
) [virtual]

Reimplemented from Moses::PhraseDictionary.

Definition at line 130 of file PhraseDictionaryDynamicCacheBased.cpp.

References Moses::Scan< bool >(), SetMaxAge(), SetScoreType(), and VERBOSE.

Here is the call graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::SetPreComputedScores ( const unsigned int  numScoreComponent  )  [protected]

Definition at line 264 of file PhraseDictionaryDynamicCacheBased.cpp.

References CBTM_SCORE_TYPE_COSINE, CBTM_SCORE_TYPE_EXPONENTIAL, CBTM_SCORE_TYPE_HYPERBOLA, CBTM_SCORE_TYPE_POWER, decaying_score(), and VERBOSE.

Referenced by Load().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::PhraseDictionaryDynamicCacheBased::SetScoreType ( size_t  type  ) 

void Moses::PhraseDictionaryDynamicCacheBased::Update ( Phrase  p,
TargetPhrase  tp,
int  age,
std::string  waString = "" 
) [protected]

void Moses::PhraseDictionaryDynamicCacheBased::Update ( std::string  sourceString,
std::string  targetString,
std::string  ageString,
std::string  waString = "" 
) [protected]

void Moses::PhraseDictionaryDynamicCacheBased::Update ( std::vector< std::string >  entries,
std::string  ageString 
) [protected]

Definition at line 492 of file PhraseDictionaryDynamicCacheBased.cpp.

References Moses::TokenizeMultiCharSeparator(), and VERBOSE.

Referenced by Insert(), Load_Single_File(), and Update().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const PhraseDictionaryDynamicCacheBased  
) [friend]


Member Data Documentation


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

Generated on Thu Jul 6 00:33:49 2017 for Moses by  doxygen 1.5.9