malayalam word sense disambiguation in python
Question: 
    # encoding=utf-8
    file=open("mm.txt","r+")
    wordcount={}
    for word in file.read().split():
        if word not in wordcount:
            wordcount[word] = 1
        else:
            wordcount[word] += 1
    print (word,wordcount)
    file.close();
    

This work fine for english sentence how to work this code for malayalam
sentence


Answer: You have to **include encoding (utf-8)** while opening the file

    
    
    import codecs
    with codecs.open("mm.txt",encoding="utf-8") as f:
       wordcount={}
         for word in f.read().split():
    

this will work

