tmmt::FuzzyMatchWrapper Class Reference

#include <FuzzyMatchWrapper.h>

Collaboration diagram for tmmt::FuzzyMatchWrapper:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FuzzyMatchWrapper (const std::string &source, const std::string &target, const std::string &alignment)
std::string Extract (long translationId, const std::string &dirNameStr)

Protected Types

typedef std::map< WORD_ID,
std::vector< int > > 
WordIndex

Protected Member Functions

void load_corpus (const std::string &fileName, std::vector< std::vector< tmmt::WORD_ID > > &corpus)
void load_target (const std::string &fileName, std::vector< std::vector< tmmt::SentenceAlignment > > &corpus)
void load_alignment (const std::string &fileName, std::vector< std::vector< tmmt::SentenceAlignment > > &corpus)
void basic_fuzzy_match (std::vector< std::vector< tmmt::WORD_ID > > source, std::vector< std::vector< tmmt::WORD_ID > > input)
unsigned int compute_length (const std::vector< tmmt::WORD_ID > &sentence)
unsigned int letter_sed (WORD_ID aIdx, WORD_ID bIdx)
unsigned int sed (const std::vector< WORD_ID > &a, const std::vector< WORD_ID > &b, std::string &best_path, bool use_letter_sed)
void init_short_matches (WordIndex &wordIndex, long translationId, const std::vector< WORD_ID > &input)
int short_match_max_length (int input_length)
void add_short_matches (WordIndex &wordIndex, long translationId, std::vector< Match > &match, const std::vector< WORD_ID > &tm, int input_length, int best_cost)
std::vector< Matchprune_matches (const std::vector< Match > &match, int best_cost)
int parse_matches (std::vector< Match > &match, int input_length, int tm_length, int &best_cost)
void create_extract (int sentenceInd, int cost, const std::vector< WORD_ID > &sourceSentence, const std::vector< SentenceAlignment > &targets, const std::string &inputStr, const std::string &path, std::ofstream &outputFile)
std::string ExtractTM (WordIndex &wordIndex, long translationId, const std::string &inputPath)
VocabularyGetVocabulary ()
bool GetLSEDCache (const std::pair< WORD_ID, WORD_ID > &key, unsigned int &value) const
void SetLSEDCache (const std::pair< WORD_ID, WORD_ID > &key, const unsigned int &value)

Protected Attributes

std::vector< std::vector
< tmmt::SentenceAlignment > > 
targetAndAlignment
tmmt::SuffixArraysuffixArray
int basic_flag
int lsed_flag
int refined_flag
int length_filter_flag
int parse_flag
int min_match
int multiple_flag
int multiple_slack
int multiple_max
std::map< std::pair< WORD_ID,
WORD_ID >, unsigned int > 
m_lsed


Detailed Description

Definition at line 28 of file FuzzyMatchWrapper.h.


Member Typedef Documentation

typedef std::map< WORD_ID,std::vector< int > > tmmt::FuzzyMatchWrapper::WordIndex [protected]

Definition at line 49 of file FuzzyMatchWrapper.h.


Constructor & Destructor Documentation

tmmt::FuzzyMatchWrapper::FuzzyMatchWrapper ( const std::string &  source,
const std::string &  target,
const std::string &  alignment 
)

Definition at line 23 of file FuzzyMatchWrapper.cpp.

References load_alignment(), load_target(), suffixArray, and targetAndAlignment.

Here is the call graph for this function:


Member Function Documentation

void tmmt::FuzzyMatchWrapper::add_short_matches ( WordIndex wordIndex,
long  translationId,
std::vector< Match > &  match,
const std::vector< WORD_ID > &  tm,
int  input_length,
int  best_cost 
) [protected]

void tmmt::FuzzyMatchWrapper::basic_fuzzy_match ( std::vector< std::vector< tmmt::WORD_ID > >  source,
std::vector< std::vector< tmmt::WORD_ID > >  input 
) [protected]

brute force method: compare input to all corpus sentences

unsigned int tmmt::FuzzyMatchWrapper::compute_length ( const std::vector< tmmt::WORD_ID > &  sentence  )  [protected]

utlility function: compute length of sentence in characters (spaces do not count)

void tmmt::FuzzyMatchWrapper::create_extract ( int  sentenceInd,
int  cost,
const std::vector< WORD_ID > &  sourceSentence,
const std::vector< SentenceAlignment > &  targets,
const std::string &  inputStr,
const std::string &  path,
std::ofstream &  outputFile 
) [protected]

std::string tmmt::FuzzyMatchWrapper::Extract ( long  translationId,
const std::string &  dirNameStr 
)

Referenced by Moses::PhraseDictionaryFuzzyMatch::InitializeForInput().

Here is the caller graph for this function:

std::string tmmt::FuzzyMatchWrapper::ExtractTM ( WordIndex wordIndex,
long  translationId,
const std::string &  inputPath 
) [protected]

bool tmmt::FuzzyMatchWrapper::GetLSEDCache ( const std::pair< WORD_ID, WORD_ID > &  key,
unsigned int &  value 
) const [protected]

Definition at line 514 of file FuzzyMatchWrapper.cpp.

References m_lsed.

Referenced by letter_sed().

Here is the caller graph for this function:

Vocabulary& tmmt::FuzzyMatchWrapper::GetVocabulary (  )  [inline, protected]

Definition at line 80 of file FuzzyMatchWrapper.h.

References tmmt::SuffixArray::GetVocabulary(), and suffixArray.

Referenced by letter_sed().

Here is the call graph for this function:

Here is the caller graph for this function:

void tmmt::FuzzyMatchWrapper::init_short_matches ( WordIndex wordIndex,
long  translationId,
const std::vector< WORD_ID > &  input 
) [protected]

unsigned int tmmt::FuzzyMatchWrapper::letter_sed ( WORD_ID  aIdx,
WORD_ID  bIdx 
) [protected]

Definition at line 538 of file FuzzyMatchWrapper.cpp.

References GetLSEDCache(), GetVocabulary(), tmmt::Vocabulary::GetWord(), and SetLSEDCache().

Here is the call graph for this function:

void tmmt::FuzzyMatchWrapper::load_alignment ( const std::string &  fileName,
std::vector< std::vector< tmmt::SentenceAlignment > > &  corpus 
) [protected]

Referenced by FuzzyMatchWrapper().

Here is the caller graph for this function:

void tmmt::FuzzyMatchWrapper::load_corpus ( const std::string &  fileName,
std::vector< std::vector< tmmt::WORD_ID > > &  corpus 
) [protected]

void tmmt::FuzzyMatchWrapper::load_target ( const std::string &  fileName,
std::vector< std::vector< tmmt::SentenceAlignment > > &  corpus 
) [protected]

Referenced by FuzzyMatchWrapper().

Here is the caller graph for this function:

int tmmt::FuzzyMatchWrapper::parse_matches ( std::vector< Match > &  match,
int  input_length,
int  tm_length,
int &  best_cost 
) [protected]

std::vector< Match > tmmt::FuzzyMatchWrapper::prune_matches ( const std::vector< Match > &  match,
int  best_cost 
) [protected]

unsigned int tmmt::FuzzyMatchWrapper::sed ( const std::vector< WORD_ID > &  a,
const std::vector< WORD_ID > &  b,
std::string &  best_path,
bool  use_letter_sed 
) [protected]

void tmmt::FuzzyMatchWrapper::SetLSEDCache ( const std::pair< WORD_ID, WORD_ID > &  key,
const unsigned int &  value 
) [protected]

Definition at line 528 of file FuzzyMatchWrapper.cpp.

References m_lsed.

Referenced by letter_sed().

Here is the caller graph for this function:

int tmmt::FuzzyMatchWrapper::short_match_max_length ( int  input_length  )  [protected]

Definition at line 754 of file FuzzyMatchWrapper.cpp.

References refined_flag.


Member Data Documentation

Definition at line 39 of file FuzzyMatchWrapper.h.

Definition at line 42 of file FuzzyMatchWrapper.h.

Definition at line 40 of file FuzzyMatchWrapper.h.

std::map< std::pair< WORD_ID, WORD_ID >, unsigned int > tmmt::FuzzyMatchWrapper::m_lsed [protected]

Definition at line 52 of file FuzzyMatchWrapper.h.

Referenced by GetLSEDCache(), and SetLSEDCache().

Definition at line 44 of file FuzzyMatchWrapper.h.

Definition at line 45 of file FuzzyMatchWrapper.h.

Definition at line 47 of file FuzzyMatchWrapper.h.

Definition at line 46 of file FuzzyMatchWrapper.h.

Definition at line 43 of file FuzzyMatchWrapper.h.

Definition at line 41 of file FuzzyMatchWrapper.h.

Referenced by short_match_max_length().

Definition at line 38 of file FuzzyMatchWrapper.h.

Referenced by FuzzyMatchWrapper(), and GetVocabulary().

std::vector< std::vector< tmmt::SentenceAlignment > > tmmt::FuzzyMatchWrapper::targetAndAlignment [protected]

Definition at line 37 of file FuzzyMatchWrapper.h.

Referenced by FuzzyMatchWrapper().


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

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