Moses::Word Class Reference

#include <Word.h>

Collaboration diagram for Moses::Word:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Word (const Word &copy)
 Word (bool isNonTerminal=false)
 ~Word ()
const Factor *& operator[] (FactorType index)
 returns Factor pointer for particular FactorType
const Factor *const & operator[] (FactorType index) const
const FactorGetFactor (FactorType factorType) const
 Deprecated. should use operator[].
void SetFactor (FactorType factorType, const Factor *factor)
bool IsNonTerminal () const
void SetIsNonTerminal (bool val)
void Merge (const Word &sourceWord)
std::string GetString (const std::vector< FactorType > factorType, bool endWithBlank) const
 TO_STRING ()
bool operator< (const Word &compare) const
 transitive comparison of Word objects
bool operator== (const Word &compare) const
bool operator!= (const Word &compare) const
void CreateFromString (FactorDirection direction, const std::vector< FactorType > &factorOrder, const std::string &str, bool isNonTerminal)
void CreateUnknownWord (const Word &sourceWord)

Static Public Member Functions

static int Compare (const Word &targetWord, const Word &sourceWord)

Protected Types

typedef const FactorFactorArray [MAX_NUM_FACTORS]

Protected Attributes

FactorArray m_factorArray
bool m_isNonTerminal

Friends

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


Detailed Description

Definition at line 41 of file Word.h.


Member Typedef Documentation

typedef const Factor* Moses::Word::FactorArray[MAX_NUM_FACTORS] [protected]

Definition at line 47 of file Word.h.


Constructor & Destructor Documentation

Moses::Word::Word ( const Word copy  )  [inline]

deep copy

Definition at line 54 of file Word.h.

References m_factorArray.

Moses::Word::Word ( bool  isNonTerminal = false  )  [inline, explicit]

empty word

Definition at line 60 of file Word.h.

References m_factorArray, and m_isNonTerminal.

Moses::Word::~Word (  )  [inline]

Definition at line 65 of file Word.h.


Member Function Documentation

int Moses::Word::Compare ( const Word targetWord,
const Word sourceWord 
) [static]

transitive comparison of 2 word objects. Used by operator<. Only compare the co-joined factors, ie. where factor exists for both words. Should make it non-static

Definition at line 35 of file Word.cpp.

References IsNonTerminal(), Moses::MAX_NUM_FACTORS, and NULL.

Referenced by operator!=(), operator<(), and operator==().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::Word::CreateFromString ( FactorDirection  direction,
const std::vector< FactorType > &  factorOrder,
const std::string &  str,
bool  isNonTerminal 
)

void Moses::Word::CreateUnknownWord ( const Word sourceWord  ) 

const Factor* Moses::Word::GetFactor ( FactorType  factorType  )  const [inline]

Deprecated. should use operator[].

Definition at line 77 of file Word.h.

References m_factorArray.

Referenced by Moses::SyntacticLanguageModel::Evaluate(), Moses::operator<<(), and Moses::ChartTranslationOptionCollection::ProcessOneUnknownWord().

Here is the caller graph for this function:

std::string Moses::Word::GetString ( const std::vector< FactorType factorType,
bool  endWithBlank 
) const

get string representation of list of factors. Used by PDTimp so supposed to be invariant to changes in format of debuggin output, therefore, doesn't use streaming output or ToString() from any class so not dependant on these debugging functions.

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

Here is the caller graph for this function:

bool Moses::Word::IsNonTerminal (  )  const [inline]

void Moses::Word::Merge ( const Word sourceWord  ) 

add the factors from sourceWord into this representation, NULL elements in sourceWord will be skipped

Definition at line 56 of file Word.cpp.

References m_factorArray, Moses::MAX_NUM_FACTORS, and NULL.

Referenced by Moses::TargetPhrase::MergeNext().

Here is the caller graph for this function:

bool Moses::Word::operator!= ( const Word compare  )  const [inline]

Definition at line 118 of file Word.h.

References Compare().

Here is the call graph for this function:

bool Moses::Word::operator< ( const Word compare  )  const [inline]

transitive comparison of Word objects

Definition at line 104 of file Word.h.

References Compare().

Here is the call graph for this function:

bool Moses::Word::operator== ( const Word compare  )  const [inline]

Definition at line 111 of file Word.h.

References Compare().

Here is the call graph for this function:

const Factor* const& Moses::Word::operator[] ( FactorType  index  )  const [inline]

Definition at line 72 of file Word.h.

References m_factorArray.

const Factor*& Moses::Word::operator[] ( FactorType  index  )  [inline]

returns Factor pointer for particular FactorType

Definition at line 68 of file Word.h.

References m_factorArray.

void Moses::Word::SetFactor ( FactorType  factorType,
const Factor factor 
) [inline]

void Moses::Word::SetIsNonTerminal ( bool  val  )  [inline]

Definition at line 87 of file Word.h.

References m_isNonTerminal.

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

Here is the caller graph for this function:

Moses::Word::TO_STRING (  ) 


Friends And Related Function Documentation

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


Member Data Documentation

set of factors

Definition at line 49 of file Word.h.

Referenced by CreateFromString(), GetFactor(), Merge(), operator[](), SetFactor(), and Word().

bool Moses::Word::m_isNonTerminal [protected]

Definition at line 50 of file Word.h.

Referenced by CreateFromString(), CreateUnknownWord(), IsNonTerminal(), SetIsNonTerminal(), and Word().


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

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