from Tkinter import *
import tkMessageBox
import tkFileDialog
from nltk.tokenize import word_tokenize, sent_tokenize
def prosesPilihanNew():
tkMessageBox.showinfo("Informasi", "Cuma coba-coba")
def prosesPilihanOpen():
nama = tkFileDialog.askopenfile()
tkMessageBox.showinfo
dataRead = str(nama.read())
print(sent_tokenize(dataRead))
print(word_tokenize(dataRead))
nama.close()
def prosesPilihanAbout():
tkMessageBox.showinfo("Informasi", "Bukan Chumacera!")
jendela = Tk()
menuUtama = Menu(jendela)
jendela.config(menu=menuUtama)
menuFile = Menu (menuUtama, tearoff = 0)
menuUtama.add_cascade(label = "File", menu = menuFile)
menuFile.add_command(label = "New", command=prosesPilihanNew)
menuFile.add_command(label = "Open. . .", command = prosesPilihanOpen)
menuFile.add_separator()
menuFile.add_command(label = "Exit", command = jendela.destroy)
menuBantuan = Menu(menuUtama, tearoff = 0)
menuUtama.add_cascade(label = "Bantuan", menu=menuBantuan)
menuBantuan.add_command(label = "About. . .", command = prosesPilihanAbout)
jendela.mainloop()
# Tokenize code
How do I change direct sentence into indirect sentence in phyton??? So, I choose a file and read it which contains +/- 100 sentence. Before the changing I’ve already tokenize them, next, how do I change the sentence into indirect sentence from that docs. I want to know what method or algorithm that needed in phyton