File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ from tkinter import *
2
+ from tkinter import messagebox
3
+ import backend
4
+
5
+
6
+ def train ():
7
+ sentence = train_entry .get ()
8
+ ac = backend .AutoComplete ()
9
+ ac .train (sentence )
10
+
11
+ def predict_word ():
12
+ word = predict_word_entry .get ()
13
+ ac = backend .AutoComplete ()
14
+ print (ac .predict (word ))
15
+
16
+ if __name__ == "__main__" :
17
+ root = Tk ()
18
+ root .title ("Input note" )
19
+ root .geometry ('300x300' )
20
+
21
+ train_label = Label (root , text = "Train" )
22
+ train_label .pack ()
23
+ train_entry = Entry (root )
24
+ train_entry .pack ()
25
+
26
+ train_button = Button (root , text = "train" , command = train )
27
+ train_button .pack ()
28
+
29
+ predict_word_label = Label (root , text = "Input term to predict" )
30
+ predict_word_label .pack ()
31
+ predict_word_entry = Entry (root )
32
+ predict_word_entry .pack ()
33
+
34
+ predict_button = Button (root , text = "predict" , command = predict_word )
35
+ predict_button .pack ()
36
+
37
+ root .mainloop ()
You can’t perform that action at this time.
0 commit comments