Moses Namespace Reference


Namespaces

namespace  DistortionOrientationType
namespace  LanguageModelFactory
namespace  LexReorderType

Classes

class  AlignmentInfo
class  SAPhrase
class  PhrasePair
class  SentenceAlignment
class  ScoresComp
class  BilingualDynSuffixArray
class  HypothesisScoreOrdererNoDistortion
class  HypothesisScoreOrdererWithDistortion
class  HypothesisQueueItem
class  QueueItemOrderer
class  HypothesisScoreOrderer
class  BackwardsEdge
class  BitmapContainer
class  CellCollection
class  ChartRule
class  ChartRuleOrderer
class  ChartRuleCollection
 a list of target phrases that is trsnalated from the same source phrase More...
struct  CNStats
class  ConfusionNet
class  DecodeGraph
 list of DecodeStep s which factorizes the translation More...
class  DecodeStep
class  DecodeStepGeneration
 subclass of DecodeStep for generation step More...
class  DecodeStepTranslation
 subclass of DecodeStep for translation step More...
class  Dictionary
class  ProcessedRule
class  ProcessedRuleColl
class  SavedNode
class  ProcessedRuleStack
class  SavedNodesOderer
class  ProcessedRuleOnDisk
class  ProcessedRuleCollOnDisk
class  SavedNodeOnDisk
class  ProcessedRuleStackOnDisk
struct  DistortionState_traditional
class  DistortionScoreProducer
class  WordPenaltyProducer
class  UnknownWordPenaltyProducer
class  DynSuffixArray
class  Factor
class  FactorCollection
class  FactorMask
class  FeatureFunction
class  StatelessFeatureFunction
class  StatefulFeatureFunction
class  FFState
class  FilePtr
class  GenerationDictionary
class  GlobalLexicalModel
class  Hypothesis
struct  CompareHypothesisTotalScore
class  HypothesisRecombinationOrderer
class  HypothesisStack
class  HypothesisStackCubePruning
class  HypothesisStackNormal
class  InputFileStream
class  InputType
 base class for sentences and confusion networks More...
struct  LMState
class  LanguageModel
 Abstract base class which represent a language model on a contiguous phrase. More...
class  LanguageModelInternal
class  LanguageModelIRST
class  LanguageModelJoint
class  LanguageModelMultiFactor
 Abstract class for for multi factor LM. More...
class  LanguageModelParallelBackoff
class  LanguageModelRandLM
class  LanguageModelRemote
class  LanguageModelSingleFactor
 Abstract class for for single factor LM. More...
class  LanguageModelSkip
class  LanguageModelSRI
class  LexicalReordering
class  LexicalReorderingConfiguration
 Factory class for lexical reordering states. More...
class  LexicalReorderingState
 Abstract class for lexical reordering model states. More...
class  BidirectionalReorderingState
class  PhraseBasedReorderingState
class  HierarchicalReorderingBackwardState
class  HierarchicalReorderingForwardState
 forward state (conditioned on the next phrase) More...
struct  State
class  LexicalReorderingTable
class  LexicalReorderingTableMemory
class  LexicalReorderingTableTree
class  LMList
 List of language models. More...
struct  SearchGraphNode
class  Manager
class  NGramCollection
class  NGramNode
struct  Credit
class  Parameter
class  PartialTranslOptColl
class  PDTAimp
class  Phrase
class  PhraseDictionary
class  PhraseDictionaryFeature
class  PhraseDictionaryDynSuffixArray
class  PhraseDictionaryMemory
class  PhraseDictionaryNode
class  PhraseDictionaryNodeSCFG
class  PhraseDictionaryOnDisk
class  PhraseDictionarySCFG
class  TgtCand
class  TgtCands
struct  PDTimp
class  PhraseDictionaryTree
class  PhraseDictionaryTreeAdaptor
class  PrefixTreeSA
class  PrefixTreeF
class  GenericCandidate
struct  PPimp
class  Candidates
class  PrefixTreeMap
class  ReorderingConstraint
class  ReorderingStack
class  ScoreComponentCollection
class  ScoreIndexManager
class  ScoreProducer
class  Search
class  BitmapContainerOrderer
class  SearchCubePruning
class  SearchNormal
class  Sentence
struct  RecombinationInfo
class  SentenceStats
class  SquareMatrix
 A square array of floats to store future costs. More...
class  StaticData
class  CountInfo
class  TargetPhrase
struct  CompareTargetPhrase
class  TargetPhraseCollection
 a list of target phrases that is translated from the same source phrase More...
class  Timer
class  TranslationOption
class  TranslationOptionCollection
class  TranslationOptionCollectionConfusionNet
class  TranslationOptionCollectionText
class  TranslationOptionList
class  XMLParseOutput
class  TreeInput
class  TrellisPath
struct  CompareTrellisPathCollection
class  TrellisPathCollection
class  TrellisPathList
class  UserMessage
class  Word
struct  WordComparer
class  WordConsumed
class  WordLattice
class  WordsBitmap
class  WordsRange
struct  XmlOption
class  Task

Typedefs

typedef std::vector< Hypothesis * > HypothesisSet
typedef std::set< BackwardsEdge * > BackwardsEdgeSet
typedef std::priority_queue
< HypothesisQueueItem
*, std::vector
< HypothesisQueueItem * >
, QueueItemOrderer
HypothesisQueue
typedef pair< Word,
ScoreComponentCollection
WordPair
typedef list< WordPairWordList
typedef list< WordPair >
::const_iterator 
WordListIterator
typedef std::vector< unsigned > vuint_t
typedef std::set< FactorFactorSet
typedef std::set< std::string > StringSet
typedef std::map< Word,
ScoreComponentCollection
OutputWordCollection
typedef std::vector< Hypothesis * > ArcList
typedef std::map< WordsBitmap,
BitmapContainer * > 
_BMType
typedef std::vector< WordLabelList
typedef std::vector< const
Factor * > 
FactorVector
typedef std::vector< std::string > PARAM_VEC
typedef std::map< std::string,
PARAM_VEC
PARAM_MAP
typedef std::map< std::string,
bool > 
PARAM_BOOL
typedef std::map< std::string,
std::string > 
PARAM_STRING
typedef LVoc< std::string > WordVoc
typedef PrefixTreeF< LabelId,
OFF_T > 
PTF
typedef FilePtr< PTFCPT
typedef std::vector< CPTData
typedef std::pair< std::string,
float > 
UnknownLHSEntry
typedef std::vector
< UnknownLHSEntry
UnknownLHSList
typedef size_t FactorType
typedef std::vector< float > Scores
typedef std::vector< std::string > WordAlignments
typedef std::vector< FactorTypeFactorList
typedef std::pair< std::vector
< std::string const * >
, Scores
StringTgtCand
typedef std::pair< std::vector
< std::string const * >
, WordAlignments
StringWordAlignmentCand
typedef unsigned long WordsBitmapID

Enumerations

enum  FactorDirection { Input, Output }
enum  DecodeType { Translate, Generate, InsertNullFertilityWord }
enum  LMType { SingleFactor, MultiFactor }
enum  LMImplementation {
  SRI = 0, IRST = 1, Skip = 2, Joint = 3,
  Internal = 4, RandLM = 5, Remote = 6, ParallelBackoff = 7
}
enum  PhraseTableImplementation {
  Memory = 0, Binary = 1, OnDisk = 2, SCFG = 6,
  SuffixArray = 8
}
enum  InputTypeEnum { SentenceInput = 0, ConfusionNetworkInput = 1, WordLatticeInput = 2, TreeInputType = 3 }
enum  XmlInputType { XmlPassThrough = 0, XmlIgnore = 1, XmlExclusive = 2, XmlInclusive = 3 }
enum  DictionaryFind { Best = 0, All = 1 }
enum  SearchAlgorithm { Normal = 0, CubePruning = 1, CubeGrowing = 2, ChartDecoding = 3 }
enum  SourceLabelOverlap { SourceLabelOverlapAdd = 0, SourceLabelOverlapReplace = 1, SourceLabelOverlapDiscard = 2 }

Functions

std::ostream & operator<< (std::ostream &out, const AlignmentInfo &alignmentInfo)
std::ostream & operator<< (std::ostream &out, const ChartRule &rule)
std::ostream & operator<< (std::ostream &out, const ChartRuleCollection &coll)
std::ostream & operator<< (std::ostream &out, const ConfusionNet &cn)
void IncrementIterators (vector< WordListIterator > &wordListIterVector, const vector< WordList > &wordListVector)
std::ostream & operator<< (std::ostream &out, const ProcessedRule &rule)
std::ostream & operator<< (std::ostream &out, const ProcessedRuleColl &coll)
std::ostream & operator<< (std::ostream &out, const ProcessedRuleOnDisk &rule)
std::ostream & operator<< (std::ostream &out, const ProcessedRuleCollOnDisk &coll)
ostream & operator<< (ostream &out, const Factor &factor)
 TO_STRING_BODY (FactorCollection)
ostream & operator<< (ostream &out, const FactorCollection &factorCollection)
 TO_STRING_BODY (FactorMask)
std::ostream & operator<< (std::ostream &out, const FactorMask &fm)
template<typename T >
size_t fWrite (FILE *f, const T &t)
template<typename T >
void fRead (FILE *f, T &t)
template<typename T >
size_t fWrite (FILE *f, const T *b, const T *e)
template<typename T >
size_t fWrite (FILE *f, const T b, const T e)
template<typename C >
size_t fWriteVector (FILE *f, const C &v)
template<typename C >
void fReadVector (FILE *f, C &v)
size_t fWriteString (FILE *f, const char *e, UINT32 s)
void fReadString (FILE *f, std::string &e)
size_t fWriteStringVector (FILE *f, const std::vector< std::string > &v)
void fReadStringVector (FILE *f, std::vector< std::string > &v)
OFF_T fTell (FILE *f)
void fSeek (FILE *f, OFF_T o)
FILE * fOpen (const char *fn, const char *m)
void fClose (FILE *f)
ostream & operator<< (ostream &out, const Hypothesis &hypo)
std::ostream & operator<< (std::ostream &out, const Hypothesis &hypothesis)
 TO_STRING_BODY (HypothesisStackCubePruning)
std::ostream & operator<< (std::ostream &out, const HypothesisStackCubePruning &hypoColl)
 TO_STRING_BODY (HypothesisStackNormal)
std::ostream & operator<< (std::ostream &out, const HypothesisStackNormal &hypoColl)
 TO_STRING_BODY (InputType)
std::ostream & operator<< (std::ostream &out, InputType const &x)
bool LMCacheCleanup (size_t sentences_done, size_t m_lmcache_cleanup_threshold)
std::string auxClearString (const std::string &str)
void auxAppend (IPhrase &head, const IPhrase &tail)
void OutputWordGraph (std::ostream &outputWordGraphStream, const Hypothesis *hypo, size_t &linkId)
void OutputSearchNode (long translationId, std::ostream &outputSearchGraphStream, const SearchGraphNode &searchNode)
std::ostream & operator<< (std::ostream &os, const Credit &credit)
bool ComparePartialTranslationOption (const TranslationOption *a, const TranslationOption *b)
bool existsFile (const char *filePath)
double addLogScale (double x, double y)
double Exp (double x)
 TO_STRING_BODY (Phrase)
ostream & operator<< (ostream &out, const Phrase &phrase)
 TO_STRING_BODY (PhraseDictionaryMemory)
ostream & operator<< (ostream &out, const PhraseDictionaryMemory &phraseDict)
std::ostream & operator<< (std::ostream &out, const PhraseDictionaryNodeSCFG &node)
void TransformString (vector< vector< string > * > &phraseVector)
 TO_STRING_BODY (PhraseDictionarySCFG)
ostream & operator<< (ostream &out, const PhraseDictionarySCFG &phraseDict)
template<typename T >
std::ostream & operator<< (std::ostream &out, const std::vector< T > &x)
std::ostream & operator<< (std::ostream &os, const ScoreComponentCollection &rhs)
std::ostream & operator<< (std::ostream &os, const ScoreIndexManager &sim)
std::ostream & operator<< (std::ostream &os, const SentenceStats &ss)
 TO_STRING_BODY (SquareMatrix)
std::ostream & operator<< (std::ostream &out, const SquareMatrix &matrix)
 TO_STRING_BODY (TargetPhrase)
std::ostream & operator<< (std::ostream &os, const TargetPhrase &tp)
std::ostream & operator<< (std::ostream &os, Timer &t)
 TO_STRING_BODY (TranslationOption)
ostream & operator<< (ostream &out, const TranslationOption &possibleTranslation)
bool CompareTranslationOption (const TranslationOption *a, const TranslationOption *b)
 TO_STRING_BODY (TranslationOptionCollection)
std::ostream & operator<< (std::ostream &out, const TranslationOptionCollection &coll)
 TO_STRING_BODY (TranslationOptionList)
std::ostream & operator<< (std::ostream &out, const TranslationOptionList &coll)
std::ostream & operator<< (std::ostream &out, const TreeInput &input)
 TO_STRING_BODY (TrellisPath)
std::ostream & operator<< (std::ostream &out, const TrellisPath &path)
std::ostream & operator<< (std::ostream &out, const TrellisPathCollection &pathColl)
string GetTempFolder ()
 x-platform reference to temp folder
void CreateTempFile (ofstream &fileStream, string &filePath)
const std::string ToLower (const std::string &str)
template<>
bool Scan< bool > (const std::string &input)
 Specialisation to understand yes/no y/n true/false 0/1.
bool FileExists (const std::string &filePath)
const std::string Trim (const std::string &str, const std::string dropChars=" \t\n\r")
 delete white spaces at beginning and end of string
void ResetUserTime ()
void PrintUserTime (const std::string &message)
double GetUserTime ()
std::map< std::string,
std::string > 
ProcessAndStripSGML (std::string &line)
template<typename T >
std::string SPrint (const T &input)
 get string representation of any object/variable, as long as it can pipe to a stream
template<typename T >
Scan (const std::string &input)
 convert string to variable of type T. Used to reading floats, int etc from files
template<>
std::string Scan< std::string > (const std::string &input)
 just return input
template<typename T >
std::vector< T > Scan (const std::vector< std::string > &input)
 convert vectors of string to vectors of type T variables
template<typename T >
void Scan (std::vector< T > &output, const std::vector< std::string > &input)
 speeded up version of above
std::string Replace (const std::string &str, const std::string &todelStr, const std::string &toaddStr)
std::vector< std::string > Tokenize (const std::string &input, const std::string &delimiters=" \t")
 tokenise input string to vector of type T
void Tokenize (std::vector< std::string > &output, const std::string &str, const std::string &delimiters=" \t")
template<typename T >
void Tokenize (std::vector< T > &output, const std::string &input, const std::string &delimiters=" \t")
std::vector< std::string > TokenizeMultiCharSeparator (const std::string &str, const std::string &separator)
void TokenizeMultiCharSeparator (std::vector< std::string > &output, const std::string &str, const std::string &separator)
template<typename T >
std::string Join (const std::string &delimiter, const std::vector< T > &items)
float TransformScore (float prob)
 transform prob to natural log score
float UntransformScore (float score)
 transform natural log score to prob. Not currently used
float TransformLMScore (float irstScore)
 irst number are in log 10, transform to natural log
float UntransformLMScore (float logNScore)
float FloorScore (float logScore)
 make sure score doesn't fall below LOWEST_SCORE
float CalcTranslationScore (const std::vector< float > &probVector, const std::vector< float > &weightT)
template<class COLL >
void RemoveAllInColl (COLL &coll)
 delete and remove every element of a collection object such as map, set, list etc
void CreateTempFile (std::ofstream &fileStream, std::string &filePath)
 Create temp file and return output stream and full file path as arguments.
std::string GetMD5Hash (const std::string &filePath)
 MD5 hash of a file.
template<typename T >
void ShrinkToFit (T &v)
 save memory by getting rid of spare, unused elements in a collection
 TO_STRING_BODY (Word)
ostream & operator<< (ostream &out, const Word &word)
std::ostream & operator<< (std::ostream &out, const WordConsumed &wordConsumed)
 TO_STRING_BODY (WordsBitmap)
std::ostream & operator<< (std::ostream &out, const WordsBitmap &wordsBitmap)
 TO_STRING_BODY (WordsRange)
std::ostream & operator<< (std::ostream &out, const WordsRange &range)
string ParseXmlTagAttribute (const string &tag, const string &attributeName)
string TrimXml (const string &str)
bool isXmlTag (const string &tag)
vector< string > TokenizeXml (const string &str)
bool ProcessAndStripXMLTags (string &line, vector< vector< XmlOption * > > &res, ReorderingConstraint &reorderingConstraint, vector< size_t > &walls)
std::string ParseXmlTagAttribute (const std::string &tag, const std::string &attributeName)
std::string TrimXml (const std::string &str)
bool isXmlTag (const std::string &tag)
std::vector< std::string > TokenizeXml (const std::string &str)
bool ProcessAndStripXMLTags (std::string &line, std::vector< std::vector< XmlOption * > > &res, ReorderingConstraint &reorderingConstraint, std::vector< size_t > &walls)

Variables

CNStats stats
const size_t DEFAULT_CUBE_PRUNING_POP_LIMIT = 1000
const size_t DEFAULT_CUBE_PRUNING_DIVERSITY = 0
const size_t DEFAULT_MAX_HYPOSTACK_SIZE = 200
const size_t DEFAULT_MAX_TRANS_OPT_CACHE_SIZE = 10000
const size_t DEFAULT_MAX_TRANS_OPT_SIZE = 5000
const size_t DEFAULT_MAX_PART_TRANS_OPT_SIZE = 10000
const size_t DEFAULT_MAX_PHRASE_LENGTH = 20
const size_t DEFAULT_MAX_CHART_SPAN = 10
const size_t ARRAY_SIZE_INCR = 10
const float LOWEST_SCORE = -100.0f
const float DEFAULT_BEAM_WIDTH = 0.00001f
const float DEFAULT_EARLY_DISCARDING_THRESHOLD = 0.0f
const float DEFAULT_TRANSLATION_OPTION_THRESHOLD = 0.0f
const size_t DEFAULT_VERBOSE_LEVEL = 1
const int NUM_LANGUAGES = 2
const size_t MAX_NUM_FACTORS = 4
const size_t MAX_MSG_QUEUE = 5
Timer g_timer

Detailed Description

Classes to implement a ThreadPool.


Typedef Documentation

typedef std::vector<Hypothesis*> Moses::ArcList

typedef std::set< BackwardsEdge* > Moses::BackwardsEdgeSet

typedef std::vector<CPT> Moses::Data

typedef std::vector<FactorType> Moses::FactorList

typedef std::set<Factor> Moses::FactorSet

typedef size_t Moses::FactorType

typedef std::vector<const Factor*> Moses::FactorVector

typedef std::priority_queue< HypothesisQueueItem*, std::vector< HypothesisQueueItem* >, QueueItemOrderer> Moses::HypothesisQueue

typedef std::vector< Hypothesis* > Moses::HypothesisSet

typedef std::vector<Word> Moses::LabelList

typedef std::map<std::string, bool> Moses::PARAM_BOOL

typedef std::map<std::string, PARAM_VEC > Moses::PARAM_MAP

typedef std::map<std::string, std::string > Moses::PARAM_STRING

typedef std::vector<std::string> Moses::PARAM_VEC

typedef PrefixTreeF< LabelId, OFF_T > Moses::PTF

typedef std::vector<float> Moses::Scores

typedef std::set<std::string> Moses::StringSet

typedef std::pair<std::vector<std::string const*>,Scores > Moses::StringTgtCand

typedef std::pair<std::vector<std::string const*>,WordAlignments > Moses::StringWordAlignmentCand

typedef std::pair<std::string, float> Moses::UnknownLHSEntry

typedef std::vector<UnknownLHSEntry> Moses::UnknownLHSList

typedef std::vector<unsigned> Moses::vuint_t

typedef std::vector<std::string> Moses::WordAlignments

typedef list< WordPair > Moses::WordList

typedef list< WordPair >::const_iterator Moses::WordListIterator

typedef unsigned long Moses::WordsBitmapID

typedef LVoc< std::string > Moses::WordVoc


Enumeration Type Documentation

Enumerator:
Translate 
Generate 
InsertNullFertilityWord  an optional step that attempts to insert a few closed-class words to improve LM scores

Enumerator:
Best 
All 

Enumerator:
Input 
Output  Source factors.

Target factors

Enumerator:
SentenceInput 
ConfusionNetworkInput 
WordLatticeInput 
TreeInputType 

Enumerator:
SRI 
IRST 
Skip 
Joint 
Internal 
RandLM 
Remote 
ParallelBackoff 

Enumerator:
SingleFactor 
MultiFactor 

Enumerator:
Memory 
Binary 
OnDisk 
SCFG 
SuffixArray 

Enumerator:
Normal 
CubePruning 
CubeGrowing 
ChartDecoding 

Enumerator:
SourceLabelOverlapAdd 
SourceLabelOverlapReplace 
SourceLabelOverlapDiscard 

Enumerator:
XmlPassThrough 
XmlIgnore 
XmlExclusive 
XmlInclusive 


Function Documentation

double Moses::addLogScale ( double  x,
double  y 
)

Referenced by Moses::PDTAimp::CacheSource().

Here is the caller graph for this function:

void Moses::auxAppend ( IPhrase head,
const IPhrase tail 
)

std::string Moses::auxClearString ( const std::string &  str  ) 

float Moses::CalcTranslationScore ( const std::vector< float > &  probVector,
const std::vector< float > &  weightT 
) [inline]

convert prob vector to log prob and calc inner product with weight vector. At least, that's what I think it does, fn is only 9 lines but can't figure out what it does. Not sure whether give zens a medal for being a genius, or shoot him for writing unreadable code. Mabe both...

References TransformScore().

Here is the call graph for this function:

bool Moses::ComparePartialTranslationOption ( const TranslationOption *  a,
const TranslationOption *  b 
)

helper, used by pruning

References Moses::TranslationOption::GetFutureScore().

Referenced by Moses::PartialTranslOptColl::Prune().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::CompareTranslationOption ( const TranslationOption *  a,
const TranslationOption *  b 
)

helper for pruning

References Moses::TranslationOption::GetFutureScore().

Referenced by Moses::TranslationOptionCollection::Prune(), and Moses::TranslationOptionCollection::Sort().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::CreateTempFile ( std::ofstream &  fileStream,
std::string &  filePath 
)

Create temp file and return output stream and full file path as arguments.

void Moses::CreateTempFile ( ofstream &  fileStream,
string &  filePath 
)

References GetTempFolder(), and PROJECT_NAME.

Here is the call graph for this function:

bool Moses::existsFile ( const char *  filePath  )  [inline]

Referenced by Moses::PDTAimp::Create(), existsFile(), and main().

Here is the caller graph for this function:

double Moses::Exp ( double  x  ) 

Referenced by Moses::PDTAimp::CacheSource(), and Moses::PDTAimp::~PDTAimp().

Here is the caller graph for this function:

void Moses::fClose ( FILE *  f  )  [inline]

bool Moses::FileExists ( const std::string &  filePath  ) 

float Moses::FloorScore ( float  logScore  )  [inline]

FILE* Moses::fOpen ( const char *  fn,
const char *  m 
) [inline]

References Moses::UserMessage::Add(), and NULL.

Referenced by Moses::PrefixTreeF< T, D >::create(), Moses::PhraseDictionaryTree::Create(), Moses::LexicalReorderingTableTree::Create(), Moses::PrefixTreeMap::Read(), and Moses::PDTimp::Read().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
void Moses::fRead ( FILE *  f,
T &  t 
) [inline]

void Moses::fReadString ( FILE *  f,
std::string &  e 
) [inline]

References fRead(), and TRACE_ERR.

Referenced by fReadStringVector().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::fReadStringVector ( FILE *  f,
std::vector< std::string > &  v 
) [inline]

References fRead(), and fReadString().

Referenced by Moses::TgtCand::readBinWithAlignment().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename C >
void Moses::fReadVector ( FILE *  f,
C &  v 
) [inline]

void Moses::fSeek ( FILE *  f,
OFF_T  o 
) [inline]

OFF_T Moses::fTell ( FILE *  f  )  [inline]

template<typename T >
size_t Moses::fWrite ( FILE *  f,
const T  b,
const T  e 
) [inline]

References fWrite(), and TRACE_ERR.

Here is the call graph for this function:

template<typename T >
size_t Moses::fWrite ( FILE *  f,
const T *  b,
const T *  e 
) [inline]

References fWrite(), and TRACE_ERR.

Here is the call graph for this function:

template<typename T >
size_t Moses::fWrite ( FILE *  f,
const T &  t 
) [inline]

size_t Moses::fWriteString ( FILE *  f,
const char *  e,
UINT32  s 
) [inline]

References fWrite(), and TRACE_ERR.

Referenced by fWriteStringVector().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t Moses::fWriteStringVector ( FILE *  f,
const std::vector< std::string > &  v 
) [inline]

References fWrite(), and fWriteString().

Referenced by Moses::TgtCand::writeBinWithAlignment().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename C >
size_t Moses::fWriteVector ( FILE *  f,
const C &  v 
) [inline]

std::string Moses::GetMD5Hash ( const std::string &  filePath  ) 

MD5 hash of a file.

std::string Moses::GetTempFolder (  ) 

x-platform reference to temp folder

Referenced by CreateTempFile().

Here is the caller graph for this function:

double Moses::GetUserTime (  ) 

Referenced by Moses::SearchNormal::ProcessSentence(), and Moses::SearchCubePruning::ProcessSentence().

Here is the caller graph for this function:

void Moses::IncrementIterators ( vector< WordListIterator > &  wordListIterVector,
const vector< WordList > &  wordListVector 
) [inline]

used in generation: increases iterators when looping through the exponential number of generation expansions

Referenced by Moses::DecodeStepGeneration::Process().

Here is the caller graph for this function:

bool Moses::isXmlTag ( const std::string &  tag  ) 

bool Moses::isXmlTag ( const string &  tag  ) 

Check if the token is an XML tag, i.e. starts with "<"

Parameters:
tag token to be checked

Referenced by ProcessAndStripXMLTags().

Here is the caller graph for this function:

template<typename T >
std::string Moses::Join ( const std::string &  delimiter,
const std::vector< T > &  items 
) [inline]

Convert vector of type T to string

Referenced by operator<<().

Here is the caller graph for this function:

bool Moses::LMCacheCleanup ( size_t  sentences_done,
size_t  m_lmcache_cleanup_threshold 
)

Referenced by Moses::LanguageModelIRST::CleanUpAfterSentenceProcessing().

Here is the caller graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const WordsRange &  range 
)

std::ostream& Moses::operator<< ( std::ostream &  out,
const WordsBitmap &  wordsBitmap 
) [inline]

References Moses::WordsBitmap::GetValue(), and Moses::WordsBitmap::m_size.

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const WordConsumed &  wordConsumed 
)

ostream& Moses::operator<< ( ostream &  out,
const Word &  word 
)

std::ostream& Moses::operator<< ( std::ostream &  out,
const TrellisPathCollection &  pathColl 
) [inline]

std::ostream& Moses::operator<< ( std::ostream &  out,
const TrellisPath &  path 
) [inline]

std::ostream& Moses::operator<< ( std::ostream &  out,
const TreeInput &  input 
)

References Moses::TreeInput::GetLabelList(), Moses::Sentence::GetSize(), and Moses::Word::IsNonTerminal().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const TranslationOptionList &  coll 
)

References Moses::TranslationOptionList::begin(), and Moses::TranslationOptionList::end().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const TranslationOptionCollection &  coll 
)

ostream& Moses::operator<< ( ostream &  out,
const TranslationOption &  possibleTranslation 
)

std::ostream& Moses::operator<< ( std::ostream &  os,
Timer t 
)

std::ostream & Moses::operator<< ( std::ostream &  os,
const TargetPhrase &  tp 
)

std::ostream& Moses::operator<< ( std::ostream &  out,
const SquareMatrix &  matrix 
) [inline]

References Moses::SquareMatrix::GetScore(), and Moses::SquareMatrix::GetSize().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  os,
const SentenceStats &  ss 
) [inline]

std::ostream& Moses::operator<< ( std::ostream &  os,
const ScoreIndexManager &  sim 
)

std::ostream& Moses::operator<< ( std::ostream &  os,
const ScoreComponentCollection &  rhs 
) [inline]

template<typename T >
std::ostream& Moses::operator<< ( std::ostream &  out,
const std::vector< T > &  x 
) [inline]

ostream& Moses::operator<< ( ostream &  out,
const PhraseDictionarySCFG &  phraseDict 
)

std::ostream& Moses::operator<< ( std::ostream &  out,
const PhraseDictionaryNodeSCFG &  node 
)

References Moses::PhraseDictionaryNodeSCFG::GetTargetPhraseCollection().

Here is the call graph for this function:

ostream& Moses::operator<< ( ostream &  out,
const PhraseDictionaryMemory &  phraseDict 
)

ostream& Moses::operator<< ( ostream &  out,
const Phrase &  phrase 
)

References Moses::Phrase::GetSize(), and Moses::Phrase::GetWord().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  os,
const Credit &  credit 
)

std::ostream & Moses::operator<< ( std::ostream &  out,
InputType const &  x 
)

References Moses::InputType::Print().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const HypothesisStackNormal &  hypoColl 
)

References Moses::HypothesisStack::begin(), and Moses::HypothesisStack::end().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const HypothesisStackCubePruning &  hypoColl 
)

References Moses::HypothesisStack::begin(), and Moses::HypothesisStack::end().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const Hypothesis &  hypothesis 
)

ostream& Moses::operator<< ( ostream &  out,
const Hypothesis &  hypo 
)

std::ostream& Moses::operator<< ( std::ostream &  out,
const FactorMask &  fm 
)

References MAX_NUM_FACTORS.

ostream& Moses::operator<< ( ostream &  out,
const FactorCollection &  factorCollection 
)

ostream& Moses::operator<< ( ostream &  out,
const Factor &  factor 
)

std::ostream& Moses::operator<< ( std::ostream &  out,
const ProcessedRuleCollOnDisk &  coll 
)

References Moses::ProcessedRuleCollOnDisk::begin(), and Moses::ProcessedRuleCollOnDisk::end().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const ProcessedRuleOnDisk &  rule 
)

std::ostream& Moses::operator<< ( std::ostream &  out,
const ProcessedRuleColl &  coll 
)

References Moses::ProcessedRuleColl::begin(), and Moses::ProcessedRuleColl::end().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const ProcessedRule &  rule 
)

std::ostream & Moses::operator<< ( std::ostream &  out,
const ConfusionNet &  cn 
)

References Moses::ConfusionNet::Print().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const ChartRuleCollection coll 
)

References Moses::ChartRuleCollection::begin(), and Moses::ChartRuleCollection::end().

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const ChartRule &  rule 
)

std::ostream& Moses::operator<< ( std::ostream &  out,
const AlignmentInfo &  alignmentInfo 
)

References Moses::AlignmentInfo::begin(), and Moses::AlignmentInfo::end().

Here is the call graph for this function:

void Moses::OutputSearchNode ( long  translationId,
std::ostream &  outputSearchGraphStream,
const SearchGraphNode &  searchNode 
)

void Moses::OutputWordGraph ( std::ostream &  outputWordGraphStream,
const Hypothesis *  hypo,
size_t &  linkId 
)

std::string Moses::ParseXmlTagAttribute ( const std::string &  tag,
const std::string &  attributeName 
)

string Moses::ParseXmlTagAttribute ( const string &  tag,
const string &  attributeName 
)

References TRACE_ERR.

Referenced by ProcessAndStripXMLTags().

Here is the caller graph for this function:

void Moses::PrintUserTime ( const std::string &  message  ) 

std::map< std::string, std::string > Moses::ProcessAndStripSGML ( std::string &  line  ) 

References ToLower(), TRACE_ERR, and Trim().

Referenced by Moses::WordLattice::Read(), and Moses::Sentence::Read().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::ProcessAndStripXMLTags ( std::string &  line,
std::vector< std::vector< XmlOption * > > &  res,
ReorderingConstraint &  reorderingConstraint,
std::vector< size_t > &  walls 
)

bool Moses::ProcessAndStripXMLTags ( string &  line,
vector< vector< XmlOption * > > &  res,
ReorderingConstraint &  reorderingConstraint,
vector< size_t > &  walls 
)

Process a sentence with xml annotation Xml tags may specifiy additional/replacing translation options and reordering constraints

Parameters:
line in: sentence, out: sentence without the xml
res vector with translation options specified by xml
reorderingConstraint reordering constraint zones specified by xml
walls reordering constraint walls specified by xml

References Moses::Phrase::CreateFromString(), FloorScore(), Moses::StaticData::GetFactorDelimiter(), Moses::StaticData::GetOutputFactorOrder(), Moses::StaticData::Instance(), isXmlTag(), Output, ParseXmlTagAttribute(), Moses::TargetPhrase::SetScore(), Moses::ReorderingConstraint::SetZone(), Tokenize(), TokenizeMultiCharSeparator(), TokenizeXml(), TRACE_ERR, TransformScore(), Trim(), TrimXml(), VERBOSE, and XmlIgnore.

Referenced by Moses::Sentence::Read().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class COLL >
void Moses::RemoveAllInColl ( COLL &  coll  )  [inline]

std::string Moses::Replace ( const std::string &  str,
const std::string &  todelStr,
const std::string &  toaddStr 
) [inline]

replace all occurrences of todelStr in str with the string toaddStr

void Moses::ResetUserTime (  ) 

Referenced by Moses::StaticData::LoadData(), and main().

Here is the caller graph for this function:

template<typename T >
void Moses::Scan ( std::vector< T > &  output,
const std::vector< std::string > &  input 
) [inline]

speeded up version of above

template<typename T >
std::vector<T> Moses::Scan ( const std::vector< std::string > &  input  )  [inline]

convert vectors of string to vectors of type T variables

template<typename T >
T Moses::Scan ( const std::string &  input  )  [inline]

convert string to variable of type T. Used to reading floats, int etc from files

Referenced by GetParams().

Here is the caller graph for this function:

template<>
bool Moses::Scan< bool > ( const std::string &  input  )  [inline]

Specialisation to understand yes/no y/n true/false 0/1.

Referenced by Moses::Manager::GetWordGraph(), and Moses::StaticData::LoadData().

Here is the caller graph for this function:

template<>
std::string Moses::Scan< std::string > ( const std::string &  input  )  [inline]

just return input

template<typename T >
void Moses::ShrinkToFit ( T &  v  )  [inline]

save memory by getting rid of spare, unused elements in a collection

Referenced by Moses::ConfusionNet::ReadFormat0(), and Moses::PrefixTreeSA< T, D >::shrink().

Here is the caller graph for this function:

template<typename T >
std::string Moses::SPrint ( const T &  input  )  [inline]

get string representation of any object/variable, as long as it can pipe to a stream

Moses::TO_STRING_BODY ( WordsRange   ) 

Moses::TO_STRING_BODY ( WordsBitmap   ) 

Moses::TO_STRING_BODY ( Word   ) 

Moses::TO_STRING_BODY ( TrellisPath   ) 

Moses::TO_STRING_BODY ( TranslationOptionList   ) 

Moses::TO_STRING_BODY ( TranslationOptionCollection   ) 

Moses::TO_STRING_BODY ( TranslationOption   ) 

Moses::TO_STRING_BODY ( TargetPhrase   ) 

Moses::TO_STRING_BODY ( SquareMatrix   ) 

Moses::TO_STRING_BODY ( PhraseDictionarySCFG   ) 

Moses::TO_STRING_BODY ( PhraseDictionaryMemory   ) 

Moses::TO_STRING_BODY ( Phrase   ) 

Moses::TO_STRING_BODY ( InputType   ) 

Moses::TO_STRING_BODY ( HypothesisStackNormal   ) 

Moses::TO_STRING_BODY ( HypothesisStackCubePruning   ) 

Moses::TO_STRING_BODY ( FactorMask   ) 

Moses::TO_STRING_BODY ( FactorCollection   ) 

template<typename T >
void Moses::Tokenize ( std::vector< T > &  output,
const std::string &  input,
const std::string &  delimiters = " \t" 
) [inline]

References Tokenize().

Here is the call graph for this function:

void Moses::Tokenize ( std::vector< std::string > &  output,
const std::string &  str,
const std::string &  delimiters = " \t" 
) [inline]

std::vector< T > Moses::Tokenize ( const std::string &  str,
const std::string &  delimiters = " \t" 
) [inline]

void Moses::TokenizeMultiCharSeparator ( std::vector< std::string > &  output,
const std::string &  str,
const std::string &  separator 
) [inline]

References Trim().

Here is the call graph for this function:

std::vector<std::string> Moses::TokenizeMultiCharSeparator ( const std::string &  str,
const std::string &  separator 
) [inline]

std::vector<std::string> Moses::TokenizeXml ( const std::string &  str  ) 

vector<string> Moses::TokenizeXml ( const string &  str  ) 

Split up the input character string into tokens made up of either XML tags or text. example: this is a test . => (this ), (), ( is a ), (), ( test .)

Parameters:
str input string

References TRACE_ERR.

Referenced by ProcessAndStripXMLTags().

Here is the caller graph for this function:

const std::string Moses::ToLower ( const std::string &  str  ) 

Referenced by ProcessAndStripSGML().

Here is the caller graph for this function:

float Moses::TransformLMScore ( float  irstScore  )  [inline]

irst number are in log 10, transform to natural log

Referenced by Moses::LanguageModelSRI::GetValue(), Moses::LanguageModelRemote::GetValue(), Moses::LanguageModelParallelBackoff::GetValue(), and Moses::LanguageModelInternal::Load().

Here is the caller graph for this function:

float Moses::TransformScore ( float  prob  )  [inline]

void Moses::TransformString ( vector< vector< string > * > &  phraseVector  )  [inline]

const std::string Moses::Trim ( const std::string &  str,
const std::string  dropChars 
)

delete white spaces at beginning and end of string

Referenced by ProcessAndStripSGML(), ProcessAndStripXMLTags(), Moses::Sentence::Read(), and TokenizeMultiCharSeparator().

Here is the caller graph for this function:

std::string Moses::TrimXml ( const std::string &  str  ) 

string Moses::TrimXml ( const string &  str  ) 

Remove "<" and ">" from XML tag

Parameters:
str xml token to be stripped

Referenced by ProcessAndStripXMLTags().

Here is the caller graph for this function:

float Moses::UntransformLMScore ( float  logNScore  )  [inline]

Referenced by Moses::LMList::CalcAllLMScores().

Here is the caller graph for this function:

float Moses::UntransformScore ( float  score  )  [inline]

transform natural log score to prob. Not currently used

Referenced by doMBR().

Here is the caller graph for this function:


Variable Documentation

const size_t Moses::ARRAY_SIZE_INCR = 10

const float Moses::DEFAULT_BEAM_WIDTH = 0.00001f

const size_t Moses::DEFAULT_MAX_CHART_SPAN = 10

const size_t Moses::DEFAULT_MAX_TRANS_OPT_SIZE = 5000

const size_t Moses::DEFAULT_VERBOSE_LEVEL = 1

const float Moses::LOWEST_SCORE = -100.0f

const size_t Moses::MAX_MSG_QUEUE = 5

const size_t Moses::MAX_NUM_FACTORS = 4

const int Moses::NUM_LANGUAGES = 2


Generated on Fri Jul 30 20:05:15 2010 for Moses by  doxygen 1.5.9