コード例 #1
0
    def __init__(self, ngram_length, smoothing_threshold, collection,
                 unigram_collection):
        super(SimpleGoodTuringNGramFrequencySmoother, self).__init__()

        self._ngram_length = ngram_length
        self._smoothing_threshold = smoothing_threshold
        self._collection = collection
        self._unigram_collection = unigram_collection
        self._ngram_type_frequency_finder = NgramTypeFrequencyFinder()

        assert ngram_length >= 2
        assert smoothing_threshold > 1

        self._ngram_item_types = ['surface', 'stem', 'lemma_root']

        self._smoothers_for_ngram_types = {}