Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_basic_unigram_counts(self):
z = Corpus("data/ex.unicode")
for letter in z.next_tamil_letter():
#if ( LINUX ): print(letter)
pass
# LetterModels
q = Unigram( "data/ex.unicode" )
q.frequency_model( )
if not PYTHON3:
#if ( LINUX ): print(unicode(q))
pass
else:
#if ( LINUX ): print( q )
pass
self.assertEqual( q.letter[u"ஷை"] + q.letter[u"சி"] , q.letter[u"ந"] )
del z, q
def __init__(self,filename):
self.letter = dict()
self.letter.update(zip( tamil.utf8.tamil_letters,
map(lambda x : 0, tamil.utf8.tamil_letters) ) )
self.corpus = Corpus( filename )
def update_file(self,filename):
self.corpus = Corpus( filename )