Moses Namespace Reference


Namespaces

namespace  DistortionOrientationType
namespace  LanguageModelFactory
namespace  LexReorderType

Classes

class  AlignmentInfo
struct  AlignmentInfoOrderer
class  AlignmentInfoCollection
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  ChartCell
class  ChartCellCollection
class  ChartCellLabel
class  ChartCellLabelSet
struct  CompareChartChartHypothesisTotalScore
class  ChartHypothesis
class  ChartHypothesisScoreOrderer
class  ChartHypothesisRecombinationOrderer
class  ChartHypothesisCollection
class  ChartManager
class  ChartRuleLookupManager
class  ChartTranslationOption
class  ChartTranslationOptionCollection
class  ChartTranslationOptionOrderer
class  ChartTranslationOptionList
 a list of target phrases that is trsnalated from the same source phrase More...
class  ChartTrellisDetour
class  ChartTrellisDetourQueue
class  ChartTrellisNode
class  ChartTrellisPath
class  ChartTrellisPathList
struct  CNStats
class  ConfusionNet
class  DecodeFeature
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
struct  DistortionState_traditional
class  DistortionScoreProducer
class  WordPenaltyProducer
class  UnknownWordPenaltyProducer
class  DynSuffixArray
class  Factor
struct  FactorFriend
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...
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  SGNReverseCompare
struct  SearchGraphNode
class  Manager
class  NonTerminalHasher
class  NonTerminalEqualityPred
class  OutputCollector
struct  Credit
class  Parameter
class  PartialTranslOptColl
class  PDTAimp
class  Phrase
class  PhraseDictionary
class  PhraseDictionaryFeature
class  PhraseDictionaryDynSuffixArray
class  PhraseDictionaryMemory
class  PhraseDictionaryNode
class  TgtCand
class  TgtCands
class  PDTimp
class  PhraseDictionaryTree
class  PhraseDictionaryTreeAdaptor
class  PrefixTreeSA
class  PrefixTreeF
class  GenericCandidate
struct  PPimp
class  Candidates
class  PrefixTreeMap
class  ReorderingConstraint
class  ReorderingStack
class  RuleCubeItemScoreOrderer
class  RuleCubeItemPositionOrderer
class  RuleCubeItemHasher
class  RuleCubeItemEqualityPred
class  RuleCube
class  TranslationDimension
class  HypothesisDimension
class  RuleCubeItem
class  RuleCubeOrderer
class  RuleCubeQueue
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  SyntacticLanguageModel
class  SyntacticLanguageModelFiles
class  SyntacticLanguageModelState
class  TargetPhrase
struct  CompareTargetPhrase
class  TargetPhraseCollection
 a list of target phrases that is translated from the same source phrase More...
class  TerminalHasher
class  TerminalEqualityPred
class  Task
class  Timer
class  TranslationOption
class  TranslationOptionCollection
class  TranslationOptionCollectionConfusionNet
class  TranslationOptionCollectionText
class  TranslationOptionList
class  TranslationSystem
class  XMLParseOutput
class  TreeInput
class  TrellisPath
struct  CompareTrellisPathCollection
class  TrellisPathCollection
class  TrellisPathList
class  UserMessage
class  Word
struct  WordComparer
class  WordLattice
class  WordsBitmap
class  WordsRange
struct  XmlOption
class  LanguageModel
 Abstract base class which represent a language model on a contiguous phrase. More...
class  DMapLMState
class  LanguageModelDMapLM
struct  LMResult
class  LanguageModelImplementation
 Abstract base class which represent a language model on a contiguous phrase. More...
class  LMRefCount
class  LanguageModelIRST
class  LanguageModelJoint
class  LanguageModelMultiFactor
 Abstract class for for multi factor LM. More...
class  LanguageModelORLM
class  LanguageModelRemote
struct  PointerState
class  LanguageModelSingleFactor
 Abstract class for for single factor LM. More...
class  LanguageModelPointerState
class  LanguageModelSRI
class  ChartRuleLookupManagerCYKPlus
class  ChartRuleLookupManagerMemory
class  ChartRuleLookupManagerOnDisk
class  DottedRule
class  DottedRuleInMemory
class  DottedRuleColl
class  SavedNodesOderer
class  DottedRuleOnDisk
class  DottedRuleCollOnDisk
class  SavedNodeOnDisk
class  DottedRuleStackOnDisk
class  RuleTableLoader
class  RuleTableLoaderCompact
class  RuleTableLoaderFactory
class  RuleTableLoaderHiero
class  RuleTableLoaderStandard
class  PhraseDictionaryALSuffixArray
class  NonTerminalMapKeyHasher
class  NonTerminalMapKeyEqualityPred
class  PhraseDictionaryNodeSCFG
class  PhraseDictionaryOnDisk
class  PhraseDictionarySCFG
class  RuleTableTrie
class  RuleTableUTrie
class  UTrieNode
struct  ApplicableRuleTrie
struct  IntermediateVarSpanNode
class  Scope3Parser
class  StackLatticeBuilder
class  StackLatticeSearcher
struct  VarSpanNode
class  VarSpanTrieBuilder
class  FileHandler
struct  ParamDefs
class  Parameters
class  Vocab

Typedefs

typedef std::vector< Hypothesis * > HypothesisSet
typedef std::set< BackwardsEdge * > BackwardsEdgeSet
typedef std::priority_queue
< HypothesisQueueItem
*, std::vector
< HypothesisQueueItem * >
, QueueItemOrderer
HypothesisQueue
typedef std::vector
< ChartHypothesis * > 
ChartArcList
typedef pair< Word,
ScoreComponentCollection
WordPair
typedef list< WordPairWordList
typedef list< WordPair >
::const_iterator 
WordListIterator
typedef std::vector< unsigned > vuint_t
typedef std::map< Word,
ScoreComponentCollection
OutputWordCollection
typedef std::vector< const
ChartHypothesis * > 
HypoList
typedef std::vector< Hypothesis * > ArcList
typedef std::map< WordsBitmap,
BitmapContainer * > 
_BMType
typedef boost::unordered_set
< Word, NonTerminalHasher,
NonTerminalEqualityPred
NonTerminalSet
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::vector< const
HypoList * > 
StackVec
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
typedef std::vector< const
DottedRuleInMemory * > 
DottedRuleList
typedef boost::unordered_map
< Word, std::vector< size_t >
, TerminalHasher,
TerminalEqualityPred
SentenceMap
typedef std::vector
< std::vector< std::vector
< StackVec > > > 
StackLattice
typedef std::string FileExtension
typedef struct Moses::ParamDefs ParamDefs

Enumerations

enum  FactorDirection { Input, Output }
enum  DecodeType { Translate, Generate, InsertNullFertilityWord }
enum  LMType { SingleFactor, MultiFactor }
enum  LMImplementation {
  SRI = 0, IRST = 1, Joint = 3, RandLM = 5,
  Remote = 6, ParallelBackoff = 7, Ken = 8, LazyKen = 9,
  ORLM = 10, DMapLM = 11
}
enum  PhraseTableImplementation {
  Memory = 0, Binary = 1, OnDisk = 2, SCFG = 6,
  SuffixArray = 8, Hiero = 9, ALSuffixArray = 10
}
enum  InputTypeEnum {
  SentenceInput = 0, ConfusionNetworkInput = 1, WordLatticeInput = 2, TreeInputType = 3,
  WordLatticeInput2 = 4
}
enum  XmlInputType { XmlPassThrough = 0, XmlIgnore = 1, XmlExclusive = 2, XmlInclusive = 3 }
enum  DictionaryFind { Best = 0, All = 1 }
enum  ParsingAlgorithm { ParseCYKPlus = 0, ParseScope3 = 1 }
enum  SearchAlgorithm { Normal = 0, CubePruning = 1, CubeGrowing = 2, ChartDecoding = 3 }
enum  SourceLabelOverlap { SourceLabelOverlapAdd = 0, SourceLabelOverlapReplace = 1, SourceLabelOverlapDiscard = 2 }
enum  WordAlignmentSort { NoSort = 0, TargetOrder = 1 }
enum  FormatType { MosesFormat, HieroFormat }

Functions

bool compare_target (const std::pair< size_t, size_t > *a, const std::pair< size_t, size_t > *b)
std::ostream & operator<< (std::ostream &out, const AlignmentInfo &alignmentInfo)
std::ostream & operator<< (std::ostream &out, const ChartCell &cell)
std::ostream & operator<< (std::ostream &out, const ChartHypothesis &hypo)
std::ostream & operator<< (std::ostream &out, const ChartHypothesisCollection &coll)
std::ostream & operator<< (std::ostream &out, const ConfusionNet &cn)
void IncrementIterators (vector< WordListIterator > &wordListIterVector, const vector< WordList > &wordListVector)
ostream & operator<< (ostream &out, const Factor &factor)
size_t hash_value (const Factor &f)
 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)
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, const TranslationSystem *system)
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)
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)
template<typename T >
std::ostream & operator<< (std::ostream &out, const std::vector< T > &x)
std::size_t hash_value (const HypothesisDimension &dimension)
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
template<class T >
log_sum (T log_a, T log_b)
 TO_STRING_BODY (Word)
ostream & operator<< (ostream &out, const Word &word)
 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, const std::string &lbrackStr, const std::string &rbrackStr)
bool isXmlTag (const string &tag, const std::string &lbrackStr, const std::string &rbrackStr)
vector< string > TokenizeXml (const string &str, const std::string &lbrackStr, const std::string &rbrackStr)
bool ProcessAndStripXMLTags (string &line, vector< XmlOption * > &res, ReorderingConstraint &reorderingConstraint, vector< size_t > &walls, const std::string &lbrackStr, const std::string &rbrackStr)
std::string ParseXmlTagAttribute (const std::string &tag, const std::string &attributeName)
std::string TrimXml (const std::string &str, const std::string &lbrackStr="<", const std::string &rbrackStr=">")
bool isXmlTag (const std::string &tag, const std::string &lbrackStr="<", const std::string &rbrackStr=">")
std::vector< std::string > TokenizeXml (const std::string &str, const std::string &lbrackStr="<", const std::string &rbrackStr=">")
bool ProcessAndStripXMLTags (std::string &line, std::vector< XmlOption * > &res, ReorderingConstraint &reorderingConstraint, std::vector< size_t > &walls, const std::string &lbrackStr="<", const std::string &rbrackStr=">")
bool LMCacheCleanup (size_t sentences_done, size_t m_lmcache_cleanup_threshold)
LanguageModelConstructKenLM (const std::string &file, ScoreIndexManager &manager, FactorType factorType, bool lazy)
LanguageModelMultiFactorNewParallelBackoff ()
LanguageModelPointerStateNewRandLM ()
void ReformatHieroRule (int sourceTarget, string &phrase, map< size_t, pair< size_t, size_t > > &ntAlign)
void ReformateHieroScore (string &scoreString)
string * ReformatHieroRule (const string &lineOrig)
std::ostream & operator<< (std::ostream &out, const PhraseDictionaryNodeSCFG &node)
 TO_STRING_BODY (PhraseDictionarySCFG)
ostream & operator<< (ostream &out, const PhraseDictionarySCFG &phraseDict)

Variables

bool g_debug
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

Definition at line 37 of file HypothesisStackCubePruning.h.

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

Definition at line 49 of file Hypothesis.h.

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

Definition at line 47 of file BitmapContainer.h.

typedef std::vector<ChartHypothesis*> Moses::ChartArcList

Definition at line 36 of file ChartHypothesis.h.

Definition at line 20 of file PrefixTreeMap.h.

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

Definition at line 21 of file PrefixTreeMap.h.

typedef std::vector<const DottedRuleInMemory*> Moses::DottedRuleList

Definition at line 51 of file DotChartInMemory.h.

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

Definition at line 190 of file TypeDef.h.

typedef size_t Moses::FactorType

Definition at line 185 of file TypeDef.h.

typedef std::string Moses::FileExtension

Definition at line 16 of file file.h.

typedef std::vector< const ChartHypothesis * > Moses::HypoList

Definition at line 27 of file HypoList.h.

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

Definition at line 48 of file BitmapContainer.h.

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

Definition at line 44 of file BitmapContainer.h.

Definition at line 56 of file NonTerminal.h.

Definition at line 37 of file GenerationDictionary.h.

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

Definition at line 35 of file Parameter.h.

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

Definition at line 34 of file Parameter.h.

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

Definition at line 36 of file Parameter.h.

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

Definition at line 33 of file Parameter.h.

typedef PrefixTreeF< LabelId, OFF_T > Moses::PTF

Definition at line 32 of file PhraseDictionaryTree.h.

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

Definition at line 187 of file TypeDef.h.

typedef boost::unordered_map<Word, std::vector<size_t>, TerminalHasher, TerminalEqualityPred> Moses::SentenceMap

Definition at line 34 of file SentenceMap.h.

typedef std::vector<std::vector<std::vector<StackVec> > > Moses::StackLattice

Definition at line 35 of file StackLattice.h.

typedef std::vector<const HypoList *> Moses::StackVec

Definition at line 29 of file StackVec.h.

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

Definition at line 192 of file TypeDef.h.

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

Definition at line 193 of file TypeDef.h.

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

Definition at line 64 of file StaticData.h.

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

Definition at line 67 of file StaticData.h.

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

Definition at line 15 of file DynSuffixArray.h.

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

Definition at line 188 of file TypeDef.h.

typedef list< WordPair > Moses::WordList

Definition at line 54 of file DecodeStepGeneration.cpp.

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

Definition at line 57 of file DecodeStepGeneration.cpp.

Definition at line 53 of file DecodeStepGeneration.cpp.

typedef unsigned long Moses::WordsBitmapID

Definition at line 36 of file WordsBitmap.h.

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

Definition at line 120 of file PhraseDictionaryTree.cpp.


Enumeration Type Documentation

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

Definition at line 82 of file TypeDef.h.

Enumerator:
Best 
All 

Definition at line 156 of file TypeDef.h.

Enumerator:
Input 
Output  Source factors.

Target factors

Definition at line 77 of file TypeDef.h.

Enumerator:
MosesFormat 
HieroFormat 

Definition at line 27 of file LoaderStandard.h.

Enumerator:
SentenceInput 
ConfusionNetworkInput 
WordLatticeInput 
TreeInputType 
WordLatticeInput2 

Definition at line 140 of file TypeDef.h.

Enumerator:
SRI 
IRST 
Joint 
RandLM 
Remote 
ParallelBackoff 
Ken 
LazyKen 
ORLM 
DMapLM 

Definition at line 111 of file TypeDef.h.

Enumerator:
SingleFactor 
MultiFactor 

Definition at line 107 of file TypeDef.h.

Enumerator:
ParseCYKPlus 
ParseScope3 

Definition at line 161 of file TypeDef.h.

Enumerator:
Memory 
Binary 
OnDisk 
SCFG 
SuffixArray 
Hiero 
ALSuffixArray 

Definition at line 126 of file TypeDef.h.

Enumerator:
Normal 
CubePruning 
CubeGrowing 
ChartDecoding 

Definition at line 166 of file TypeDef.h.

Enumerator:
SourceLabelOverlapAdd 
SourceLabelOverlapReplace 
SourceLabelOverlapDiscard 

Definition at line 173 of file TypeDef.h.

Enumerator:
NoSort 
TargetOrder 

Definition at line 179 of file TypeDef.h.

Enumerator:
XmlPassThrough 
XmlIgnore 
XmlExclusive 
XmlInclusive 

Definition at line 149 of file TypeDef.h.


Function Documentation

double Moses::addLogScale ( double  x,
double  y 
) [inline]

Definition at line 17 of file PDTAimp.h.

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

Here is the caller graph for this function:

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

Definition at line 37 of file LexicalReorderingTable.cpp.

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

Definition at line 17 of file LexicalReorderingTable.cpp.

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...

Definition at line 285 of file Util.h.

References CHECK, and TransformScore().

Here is the call graph for this function:

bool Moses::compare_target ( const std::pair< size_t, size_t > *  a,
const std::pair< size_t, size_t > *  b 
)

Definition at line 48 of file AlignmentInfo.cpp.

Referenced by Moses::AlignmentInfo::GetSortedAlignments().

Here is the caller graph for this function:

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

helper, used by pruning

Definition at line 67 of file PartialTranslOptColl.cpp.

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

Definition at line 42 of file TranslationOptionCollection.cpp.

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:

LanguageModel * Moses::ConstructKenLM ( const std::string &  file,
ScoreIndexManager &  manager,
FactorType  factorType,
bool  lazy 
)

Definition at line 326 of file Ken.cpp.

References lm::ngram::ARRAY_TRIE_SORTED, lm::ngram::HASH_PROBING, lm::ngram::QUANT_ARRAY_TRIE_SORTED, lm::ngram::QUANT_TRIE_SORTED, lm::ngram::RecognizeBinary(), and lm::ngram::TRIE_SORTED.

Referenced by Moses::LanguageModelFactory::CreateLanguageModel().

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 
)

Definition at line 60 of file Util.cpp.

References GetTempFolder(), and PROJECT_NAME.

Here is the call graph for this function:

double Moses::Exp ( double  x  )  [inline]

Definition at line 23 of file PDTAimp.h.

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]

Definition at line 158 of file File.h.

References Moses::UserMessage::Add(), CHECK, 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]

Definition at line 109 of file File.h.

References fRead(), and TRACE_ERR.

Referenced by fReadStringVector(), and Moses::TgtCand::readBinWithAlignment().

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]

Definition at line 133 of file File.h.

References fRead(), and fReadString().

Here is the call graph for this function:

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

Definition at line 87 of file File.h.

References fRead(), and TRACE_ERR.

Referenced by Moses::DynSuffixArray::Load(), Moses::PrefixTreeMap::Read(), Moses::PrefixTreeF< T, D >::read(), Moses::PDTimp::Read(), Moses::GenericCandidate::readBin(), Moses::TgtCand::readBin(), and Moses::TgtCand::readBinWithAlignment().

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 144 of file File.h.

References FTELLO.

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

Here is the caller graph for this function:

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

Definition at line 65 of file File.h.

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]

Definition at line 54 of file File.h.

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]

Definition at line 99 of file File.h.

References fWrite(), and TRACE_ERR.

Referenced by fWriteStringVector(), and Moses::TgtCand::writeBinWithAlignment().

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]

Definition at line 123 of file File.h.

References fWrite(), and fWriteString().

Here is the call 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

Definition at line 47 of file Util.cpp.

Referenced by CreateTempFile().

Here is the caller graph for this function:

double Moses::GetUserTime (  ) 

Definition at line 120 of file Util.cpp.

References g_timer, and Moses::Timer::get_elapsed_time().

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

Here is the call graph for this function:

Here is the caller graph for this function:

std::size_t Moses::hash_value ( const HypothesisDimension &  dimension  ) 

Definition at line 34 of file RuleCubeItem.cpp.

References Moses::HypothesisDimension::GetHypothesis().

Here is the call graph for this function:

size_t Moses::hash_value ( const Factor &  f  ) 

Definition at line 40 of file Factor.cpp.

References Moses::Factor::GetId().

Referenced by Moses::NonTerminalHasher::operator()().

Here is the call graph for this function:

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

Definition at line 60 of file DecodeStepGeneration.cpp.

References end.

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

Here is the caller graph for this function:

bool Moses::isXmlTag ( const std::string &  tag,
const std::string &  lbrackStr = "<",
const std::string &  rbrackStr = ">" 
)

bool Moses::isXmlTag ( const string &  tag,
const std::string &  lbrackStr,
const std::string &  rbrackStr 
)

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

Parameters:
tag token to be checked
lbrackStr xml tag's left bracket string, typically "<"
rbrackStr xml tag's right bracket string, typically ">"

Definition at line 84 of file XmlOption.cpp.

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

Definition at line 241 of file Util.h.

Referenced by operator<<(), ReformateHieroScore(), and ReformatHieroRule().

Here is the caller graph for this function:

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

Definition at line 243 of file IRST.cpp.

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

Here is the caller graph for this function:

template<class T >
T Moses::log_sum ( log_a,
log_b 
) [inline]

Definition at line 350 of file Util.h.

Referenced by NgramScores::addScore(), Moses::Manager::CalcLatticeSamples(), and calcNgramExpectations().

Here is the caller graph for this function:

LanguageModelMultiFactor * Moses::NewParallelBackoff (  ) 

Definition at line 350 of file ParallelBackoff.cpp.

Referenced by Moses::LanguageModelFactory::CreateLanguageModel().

Here is the caller graph for this function:

LanguageModelPointerState * Moses::NewRandLM (  ) 

Definition at line 159 of file Rand.cpp.

Referenced by Moses::LanguageModelFactory::CreateLanguageModel().

Here is the caller graph for this function:

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

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

Definition at line 115 of file PhraseDictionaryNodeSCFG.cpp.

References Moses::PhraseDictionaryNodeSCFG::GetTargetPhraseCollection().

Here is the call graph for this function:

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

Definition at line 27 of file WordsRange.cpp.

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

Definition at line 250 of file WordsBitmap.h.

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

Here is the call graph for this function:

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

Definition at line 129 of file Word.cpp.

References Moses::Word::GetFactor(), Moses::StaticData::GetFactorDelimiter(), Moses::StaticData::Instance(), MAX_NUM_FACTORS, and NULL.

Here is the call graph for this function:

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 
)

Definition at line 263 of file TreeInput.cpp.

References CHECK, Moses::TreeInput::GetLabelSet(), 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 
)

Definition at line 28 of file TranslationOptionList.cpp.

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 
)

Definition at line 105 of file Timer.cpp.

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

Definition at line 341 of file TargetPhrase.cpp.

References Moses::TargetPhrase::GetAlignmentInfo(), Moses::TargetPhrase::m_fullScore, and Moses::TargetPhrase::m_transScore.

Here is the call graph for this function:

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

Definition at line 70 of file SquareMatrix.h.

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 
)

Definition at line 133 of file ScoreIndexManager.cpp.

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

Definition at line 202 of file ScoreComponentCollection.h.

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

Definition at line 16 of file PhraseDictionaryTree.cpp.

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

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

Definition at line 336 of file Phrase.cpp.

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 
)

Definition at line 40 of file InputType.cpp.

References Moses::InputType::Print().

Here is the call graph for this function:

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

Definition at line 269 of file HypothesisStackNormal.cpp.

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 
)

Definition at line 271 of file HypothesisStackCubePruning.cpp.

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 
)

Definition at line 449 of file Hypothesis.cpp.

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

Definition at line 39 of file FactorTypeSet.cpp.

References MAX_NUM_FACTORS.

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

Definition at line 74 of file FactorCollection.cpp.

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

Definition at line 34 of file Factor.cpp.

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

Definition at line 238 of file ConfusionNet.cpp.

References Moses::ConfusionNet::Print().

Here is the call graph for this function:

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

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

Definition at line 255 of file ChartHypothesis.cpp.

References Moses::ChartHypothesis::GetId(), and NULL.

Here is the call graph for this function:

std::ostream& Moses::operator<< ( std::ostream &  out,
const ChartCell &  cell 
)

Definition at line 184 of file ChartCell.cpp.

References Moses::ChartCell::m_hypoColl.

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

Definition at line 86 of file AlignmentInfo.cpp.

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,
const TranslationSystem *  system 
)

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

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

Definition at line 36 of file XmlOption.cpp.

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  ) 

Definition at line 125 of file Util.cpp.

References end, 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< XmlOption * > &  res,
ReorderingConstraint &  reorderingConstraint,
std::vector< size_t > &  walls,
const std::string &  lbrackStr = "<",
const std::string &  rbrackStr = ">" 
)

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

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
lbrackStr xml tag's left bracket string, typically "<"
rbrackStr xml tag's right bracket string, typically ">"

Definition at line 152 of file XmlOption.cpp.

References CHECK, 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:

void Moses::ReformateHieroScore ( string &  scoreString  ) 

Definition at line 93 of file LoaderStandard.cpp.

References Join(), SPrint(), and Tokenize().

Referenced by ReformatHieroRule().

Here is the call graph for this function:

Here is the caller graph for this function:

string* Moses::ReformatHieroRule ( const string &  lineOrig  ) 

Definition at line 110 of file LoaderStandard.cpp.

References ReformateHieroScore(), ReformatHieroRule(), and TokenizeMultiCharSeparator().

Here is the call graph for this function:

void Moses::ReformatHieroRule ( int  sourceTarget,
string &  phrase,
map< size_t, pair< size_t, size_t > > &  ntAlign 
)

Definition at line 60 of file LoaderStandard.cpp.

References CHECK, Join(), and Tokenize().

Referenced by Moses::RuleTableLoaderStandard::Load(), and ReformatHieroRule().

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

Definition at line 117 of file Util.h.

void Moses::ResetUserTime (  ) 

Definition at line 110 of file Util.cpp.

References g_timer, and Moses::Timer::start().

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

Here is the call graph for this function:

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

Definition at line 108 of file Util.h.

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

Definition at line 97 of file Util.h.

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

Definition at line 76 of file Util.h.

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

Definition at line 332 of file Util.h.

References CHECK.

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

Definition at line 67 of file Util.h.

Referenced by Moses::PhraseDictionaryALSuffixArray::InitializeForInput(), and ReformateHieroScore().

Here is the caller graph for this function:

Moses::TO_STRING_BODY ( PhraseDictionarySCFG   ) 

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 ( 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]

Definition at line 184 of file Util.h.

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]

Definition at line 154 of file Util.h.

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]

Definition at line 217 of file Util.h.

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,
const std::string &  lbrackStr = "<",
const std::string &  rbrackStr = ">" 
)

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

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
lbrackStr xml tag's left bracket string, typically "<"
rbrackStr xml tag's right bracket string, typically ">"

Definition at line 102 of file XmlOption.cpp.

References TRACE_ERR.

Referenced by ProcessAndStripXMLTags().

Here is the caller graph for this function:

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

Definition at line 78 of file Util.cpp.

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

Definition at line 264 of file Util.h.

Referenced by Moses::LanguageModelRemote::GetValue(), Moses::LanguageModelORLM::GetValue(), and Moses::LanguageModelDMapLM::GetValue().

Here is the caller graph for this function:

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

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

delete white spaces at beginning and end of string

Definition at line 103 of file Util.cpp.

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,
const std::string &  lbrackStr = "<",
const std::string &  rbrackStr = ">" 
)

string Moses::TrimXml ( const string &  str,
const std::string &  lbrackStr,
const std::string &  rbrackStr 
)

Remove "<" and ">" from XML tag

Parameters:
str xml token to be stripped
lbrackStr xml tag's left bracket string, typically "<"
rbrackStr xml tag's right bracket string, typically ">"

Definition at line 62 of file XmlOption.cpp.

Referenced by ProcessAndStripXMLTags().

Here is the caller graph for this function:

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

Definition at line 269 of file Util.h.

Referenced by Moses::LanguageModelImplementation::EvaluateChart().

Here is the caller graph for this function:

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

transform natural log score to prob. Not currently used

Definition at line 258 of file Util.h.

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

Definition at line 64 of file TypeDef.h.

Referenced by Moses::StaticData::LoadData().

Definition at line 55 of file TypeDef.h.

Referenced by Moses::StaticData::LoadData().

Definition at line 54 of file TypeDef.h.

Referenced by Moses::StaticData::LoadData().

Definition at line 65 of file TypeDef.h.

Referenced by Moses::StaticData::LoadData().

const size_t Moses::DEFAULT_MAX_CHART_SPAN = 10

Definition at line 61 of file TypeDef.h.

Referenced by Moses::StaticData::LoadDecodeGraphs().

Definition at line 56 of file TypeDef.h.

Referenced by Moses::StaticData::LoadData().

Definition at line 59 of file TypeDef.h.

Referenced by Moses::StaticData::LoadData().

Definition at line 60 of file TypeDef.h.

Referenced by Moses::StaticData::LoadData().

Definition at line 57 of file TypeDef.h.

Referenced by Moses::StaticData::LoadData().

const size_t Moses::DEFAULT_MAX_TRANS_OPT_SIZE = 5000

Definition at line 66 of file TypeDef.h.

Referenced by Moses::StaticData::LoadData().

const size_t Moses::DEFAULT_VERBOSE_LEVEL = 1

Definition at line 67 of file TypeDef.h.

Definition at line 38 of file ChartManager.cpp.

Definition at line 45 of file Util.cpp.

Referenced by GetUserTime(), PrintUserTime(), and ResetUserTime().

const float Moses::LOWEST_SCORE = -100.0f

const size_t Moses::MAX_MSG_QUEUE = 5

Definition at line 31 of file UserMessage.cpp.

const size_t Moses::MAX_NUM_FACTORS = 4

const int Moses::NUM_LANGUAGES = 2

Definition at line 73 of file TypeDef.h.


Generated on Wed Feb 8 06:04:10 2012 for Moses by  doxygen 1.5.9