(self, verbose=True)
return
builds a Tamil bigram letter model
builds a Tamil bigram letter model
builds a Tamil bigram letter model
def language_model(self, verbose=True):
        """ builds a Tamil bigram letter model """
        # use a generator in corpus
        prev = None
        for next_letter in self.corpus.next_tamil_letter():
            # update frequency from corpus
            if prev:
                self.letter2[prev][next_letter] += 1
                if verbose:
                    print(prev)
                    print(next_letter)
                    print(self.letter2[prev][next_letter])
            prev = next_letter  # update always
        return
def language_model ( self , verbose = True ) : # use a generator in corpus prev = None for next_letter in self . corpus . next_tamil_letter ( ) : # update frequency from corpus if prev : self . letter2 [ prev ] [ next_letter ] += 1 if verbose : print ( prev ) print ( next_letter ) print ( self . letter2 [ prev ] [ next_letter ] ) prev = next_letter # update always return