print"\n========Help Mode===== '#' to quit this mode=="
print'\n\n'
print'''\n\n Hi,Welcome to MyDictionary.You may be want to have a dictionary just for yourself in you life.So I share it with you free.But if you want to update it,you should to tell user the mydictionary is based on my name,please!'''
print'\n\n'
if(raw_input(" next step by enter anything >>> ").strip().lower())=='#':
print'You have quited this mode!'
return
print'''\n\n (1).the function listWord(),you have to input the word's fist byte in[a-z],andif you dont do that,the function will not work.And you should input something about the word,if you input nothing ,the dictionary will list all the words begin with you have just inputed first word.\n\n'''
if raw_input(" next step by enter anything >>> ").strip().lower() == '#':
print 'You have quited this mode!'
return
print '''\n\n (2).the functiom addWord(),you can add the word .I want to make it work faster,so you should input the first byte right.\n\n'''
if raw_input(" next step by enter anything >>> ").strip().lower() == '#':
print 'You have quited this mode!'
return
print '''\n\n (3).the function updateWord(),if you have found a error word or you want to update a word,the this function will give you surprise.\n\n'''
if raw_input(" next step by enter anything >>> ").strip().lower() == '#':
print 'You have quited this mode!'
return
print '''\n\n (4).the function deleteWord(),you may input a error word and you want to delete it.Just do it!\n\n'''
if raw_input(" next step by enter anything >>> ").strip().lower() == '#':
print 'You have quited this mode!'
return
print '''\n\n (5).the function queryWord(),you have to input a right word,then you will get it's meaning.If you want to get some surprise,you should add a new word with interesting ^_^\n\n'''
if raw_input(" next step by enter anything >>> ").strip().lower()=='#':
print'You have quited this mode!'
return
print'''\n\n (6).the function saveDT(),I need to make it work faster,but if you dont use the function,the new word which you have just added will not save in you harddisk,so if you want to use it safety,you should use it,good luck.\n\n'''
if raw_input(" next step by enter anything >>> ").strip().lower()=='#':
print'You have quited this mode!'
return
print'''\n\n (7).the function exit(),means you have got you work,have a good time.\n\n'''
if raw_input(" next step by enter anything >>> ").strip().lower()=='#':
print'You have quited this mode!'
return
print'''\n\n (8).the function version(),get some inforamtion about me,zhubuntu...\n\n'''
if raw_input(" next step by enter anything >>> ").strip().lower()=='#':
print'You have quited this mode!'
return
print'''\n\n (9).the test function main()\n\n'''
if raw_input(" next step by enter anything >>> ").strip().lower()=='#':
print'You have quited this mode!'
return
print'''\n\n (10).GOOD LUCK,GOOD BYE!\n\n'''
def listWord():
"list the word depend the regex you input,it will work well when you just know less info about the word"
print"\n======List Mode===== '#' to quit this mode=="
firstwd=raw_input("Enter the first byte [a-z] >>> ").strip().lower()
if firstwd =='':firstwd='\w'
if firstwd =='#':
print'You have quited this mode!'
preturn
if firstwd notin"abcdefghijklmnopqrstuvwxyz'\w'":
print"Input the right char as the word's beginning...."
return
regex = raw_input("Enter the keywords >>>").strip().lower()
if regex =='':regex='\w+'
if regex =='#':
print'You have quited this mode!'
return
moreV = 0;
for firstkey in DT.keys():
if re.match(firstwd,firstkey):
for secondkey in DT[firstkey]:
if re.search(regex,secondkey)or re.search(regex,DT[firstkey][secondkey]):