nltk.test.unit.translate.test_stack_decoder module

Tests for stack decoder

class nltk.test.unit.translate.test_stack_decoder.TestStackDecoder[source]

Bases: unittest.case.TestCase

test_find_all_src_phrases()[source]
test_distortion_score()[source]
test_distortion_score_of_first_expansion()[source]
test_compute_future_costs()[source]
test_compute_future_costs_for_phrases_not_in_phrase_table()[source]
test_future_score()[source]
test_valid_phrases()[source]
static create_fake_phrase_table()[source]
static create_fake_language_model()[source]
class nltk.test.unit.translate.test_stack_decoder.TestHypothesis[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_translation_so_far()[source]
test_translation_so_far_for_empty_hypothesis()[source]
test_total_translated_words()[source]
test_translated_positions()[source]
test_untranslated_spans()[source]
test_untranslated_spans_for_empty_hypothesis()[source]
class nltk.test.unit.translate.test_stack_decoder.TestStack[source]

Bases: unittest.case.TestCase

test_push_bumps_off_worst_hypothesis_when_stack_is_full()[source]
test_push_removes_hypotheses_that_fall_below_beam_threshold()[source]
test_push_does_not_add_hypothesis_that_falls_below_beam_threshold()[source]
test_best_returns_the_best_hypothesis()[source]
test_best_returns_none_when_stack_is_empty()[source]