Moses::Sentence Class Reference

#include <Sentence.h>

Inheritance diagram for Moses::Sentence:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Sentence (AllOptions::ptr const &opts)
 Sentence (AllOptions::ptr const &opts, size_t const transId, std::string stext)
 ~Sentence ()
InputTypeEnum GetType () const
Phrase GetSubString (const Range &r) const
 Calls Phrase::GetSubString(). Implements abstract InputType::GetSubString().
const WordGetWord (size_t pos) const
 Calls Phrase::GetWord(). Implements abstract InputType::GetWord().
size_t GetSize () const
 Calls Phrase::GetSize(). Implements abstract InputType::GetSize().
bool XmlOverlap (size_t startPos, size_t endPos) const
 Returns true if there were any XML tags parsed that at least partially covered the range passed.
void GetXmlTranslationOptions (std::vector< TranslationOption * > &list) const
 populates vector argument with XML force translation options for the specific range passed
void GetXmlTranslationOptions (std::vector< TranslationOption * > &list, size_t startPos, size_t endPos) const
std::vector
< ChartTranslationOptions * > 
GetXmlChartTranslationOptions () const
virtual int Read (std::istream &in)
 populate this InputType with data from in stream
void Print (std::ostream &out) const
 Output debugging info to stream out.
TranslationOptionCollectionCreateTranslationOptionCollection (ttasksptr const &ttask) const
 create trans options specific to this InputType
virtual void CreateFromString (std::vector< FactorType > const &factorOrder, std::string const &phraseString)
const NonTerminalSetGetLabelSet (size_t, size_t) const
void init (std::string line)
std::vector< std::map
< std::string, std::string >
> const & 
GetDltMeta () const

Protected Member Functions

void ProcessPlaceholders (const std::vector< std::pair< size_t, std::string > > &placeholders)

Protected Attributes

std::vector< XmlOption const * > m_xmlOptions
std::vector< bool > m_xmlCoverageMap
NonTerminalSet m_defaultLabelSet
std::vector< std::map
< std::string, std::string > > 
m_dlt_meta


Detailed Description

A Phrase class with an ID. Used specifically as source input so contains functionality to read from IODevice and create trans opt

Definition at line 47 of file Sentence.h.


Constructor & Destructor Documentation

Moses::Sentence::Sentence ( AllOptions::ptr const &  opts  ) 

Definition at line 44 of file Sentence.cpp.

References Moses::is_syntax(), and m_defaultLabelSet.

Here is the call graph for this function:

Moses::Sentence::Sentence ( AllOptions::ptr const &  opts,
size_t const   transId,
std::string  stext 
)

Moses::Sentence::~Sentence (  ) 

Definition at line 51 of file Sentence.cpp.

References m_xmlOptions, and Moses::RemoveAllInColl().

Here is the call graph for this function:


Member Function Documentation

virtual void Moses::Sentence::CreateFromString ( std::vector< FactorType > const &  factorOrder,
std::string const &  phraseString 
) [virtual]

Reimplemented in Moses::TabbedSentence.

TranslationOptionCollection * Moses::Sentence::CreateTranslationOptionCollection ( ttasksptr const &  ttask  )  const [virtual]

create trans options specific to this InputType

Implements Moses::InputType.

Definition at line 260 of file Sentence.cpp.

std::vector<std::map<std::string,std::string> > const& Moses::Sentence::GetDltMeta (  )  const [inline]

Definition at line 121 of file Sentence.h.

References m_dlt_meta.

Referenced by Moses::TranslationTask::interpret_dlt().

Here is the caller graph for this function:

const NonTerminalSet& Moses::Sentence::GetLabelSet ( size_t  ,
size_t   
) const [inline, virtual]

Implements Moses::InputType.

Reimplemented in Moses::TreeInput.

Definition at line 113 of file Sentence.h.

References m_defaultLabelSet.

Referenced by Moses::TranslationOptionCollectionText::TranslationOptionCollectionText().

Here is the caller graph for this function:

size_t Moses::Sentence::GetSize (  )  const [inline, virtual]

Phrase Moses::Sentence::GetSubString ( const Range r  )  const [inline, virtual]

Calls Phrase::GetSubString(). Implements abstract InputType::GetSubString().

Implements Moses::InputType.

Definition at line 77 of file Sentence.h.

Referenced by Moses::TranslationOptionCollectionText::TranslationOptionCollectionText().

Here is the caller graph for this function:

InputTypeEnum Moses::Sentence::GetType (  )  const [inline, virtual]

Implements Moses::InputType.

Reimplemented in Moses::ForestInput, Moses::TabbedSentence, and Moses::TreeInput.

Definition at line 72 of file Sentence.h.

References Moses::SentenceInput.

const Word& Moses::Sentence::GetWord ( size_t  pos  )  const [inline, virtual]

std::vector< ChartTranslationOptions * > Moses::Sentence::GetXmlChartTranslationOptions (  )  const [virtual]

void Moses::Sentence::GetXmlTranslationOptions ( std::vector< TranslationOption * > &  list,
size_t  startPos,
size_t  endPos 
) const

Definition at line 295 of file Sentence.cpp.

References Moses::Range::GetEndPos(), Moses::Range::GetStartPos(), m_xmlOptions, Moses::XmlOption::range, range, and Moses::XmlOption::targetPhrase.

Here is the call graph for this function:

void Moses::Sentence::GetXmlTranslationOptions ( std::vector< TranslationOption * > &  list  )  const

populates vector argument with XML force translation options for the specific range passed

Definition at line 283 of file Sentence.cpp.

References m_xmlOptions, Moses::XmlOption::range, range, and Moses::XmlOption::targetPhrase.

Referenced by Moses::TranslationOptionCollectionText::CreateXmlOptionsForRange(), and Moses::TranslationOptionCollectionText::ViolatesXmlOptionsConstraint().

Here is the caller graph for this function:

void Moses::Sentence::init ( std::string  line  ) 

Referenced by Moses::TabbedSentence::Read(), and Read().

Here is the caller graph for this function:

void Moses::Sentence::Print ( std::ostream &   )  const [virtual]

Output debugging info to stream out.

Implements Moses::InputType.

Reimplemented in Moses::ForestInput, and Moses::TreeInput.

Definition at line 267 of file Sentence.cpp.

void Moses::Sentence::ProcessPlaceholders ( const std::vector< std::pair< size_t, std::string > > &  placeholders  )  [protected]

Definition at line 242 of file Sentence.cpp.

References Moses::FactorCollection::AddFactor(), GetWord(), Moses::FactorCollection::Instance(), Moses::InputType::m_options, NOT_FOUND, and str.

Here is the call graph for this function:

int Moses::Sentence::Read ( std::istream &  in  )  [virtual]

populate this InputType with data from in stream

Implements Moses::InputType.

Reimplemented in Moses::ForestInput, Moses::TabbedSentence, and Moses::TreeInput.

Definition at line 231 of file Sentence.cpp.

References init().

Referenced by translate().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::Sentence::XmlOverlap ( size_t  startPos,
size_t  endPos 
) const

Returns true if there were any XML tags parsed that at least partially covered the range passed.

Definition at line 273 of file Sentence.cpp.

References m_xmlCoverageMap.

Referenced by Moses::TranslationOptionCollectionText::HasXmlOptionsOverlappingRange(), and Moses::TranslationOptionCollectionText::ViolatesXmlOptionsConstraint().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 58 of file Sentence.h.

Referenced by GetLabelSet(), and Sentence().

std::vector<std::map<std::string,std::string> > Moses::Sentence::m_dlt_meta [protected]

Definition at line 63 of file Sentence.h.

Referenced by GetDltMeta().

std::vector<bool> Moses::Sentence::m_xmlCoverageMap [protected]

Definition at line 56 of file Sentence.h.

Referenced by XmlOverlap().

std::vector<XmlOption const*> Moses::Sentence::m_xmlOptions [protected]

Utility method that takes in a string representing an XML tag and the name of the attribute, and returns the value of that tag if present, empty string otherwise

Definition at line 55 of file Sentence.h.

Referenced by GetXmlChartTranslationOptions(), GetXmlTranslationOptions(), Moses::TreeInput::Read(), and ~Sentence().


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

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