class documentation

class PhraseTable(object): (source)

View In Hierarchy

In-memory store of translations for a given phrase, and the log probability of the those translations

Method __contains__ Undocumented
Method __init__ Undocumented
Method add No summary
Method translations_for Get the translations for a source language phrase
Instance Variable src_phrases Undocumented
def __contains__(self, src_phrase): (source)

Undocumented

def __init__(self): (source)

Undocumented

def add(self, src_phrase, trg_phrase, log_prob): (source)
Parameters
src_phrase:tuple(str)Undocumented
trg_phrase:tuple(str)Undocumented
log_prob:floatLog probability that given src_phrase, trg_phrase is its translation
def translations_for(self, src_phrase): (source)

Get the translations for a source language phrase

Parameters
src_phrase:tuple(str)Source language phrase of interest
Returns
list(PhraseTableEntry)A list of target language phrases that are translations of src_phrase, ordered in decreasing order of likelihood. Each list element is a tuple of the target phrase and its log probability.
src_phrases = (source)

Undocumented