How to use the smt.phrase.word_alignment.alignment function in smt

To help you get started, we’ve selected a few smt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kenkov / smt / smt / db / createdb.py View on Github external
db="sqlite:///:memory:"):
    '''
    '''
    transfrom = 2
    transto = 1
    trans = db_viterbi_alignment(lang1s, lang2s,
                                 transfrom=transfrom,
                                 transto=transto,
                                 db=db,
                                 init_val=init_val).items()
    rev_trans = db_viterbi_alignment(lang2s, lang1s,
                                     transfrom=transto,
                                     transto=transfrom,
                                     db=db,
                                     init_val=init_val).items()
    return word_alignment.alignment(lang1s, lang2s, trans, rev_trans)