Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,50 @@
|
|||
import map
|
||||
|
||||
COMMAND_TABLE = " Add ALTer BAckup Bottom CAppend Change SCHANGE CInsert CLAst COMPress COpy\n" +\
|
||||
" COUnt COVerlay CURsor DELete CDelete Down DUPlicate Xedit EXPand EXTract Find\n" +\
|
||||
" NFind NFINDUp NFUp CFind FINdup FUp FOrward GET Help HEXType Input POWerinput\n" +\
|
||||
" Join SPlit SPLTJOIN LOAD Locate CLocate LOWercase UPPercase LPrefix MACRO\n" +\
|
||||
" MErge MODify MOve MSG Next Overlay PARSE PREServe PURge PUT PUTD Query QUIT\n" +\
|
||||
" READ RECover REFRESH RENum REPeat Replace CReplace RESet RESTore RGTLEFT\n" +\
|
||||
" RIght LEft SAVE SET SHift SI SORT SOS STAck STATus TOP TRAnsfer Type Up"
|
||||
|
||||
def countCaps(word)
|
||||
if len(word) < 1
|
||||
return 0
|
||||
end
|
||||
|
||||
numCaps = 0
|
||||
for i in range(0, len(word) - 1)
|
||||
if word[i] = upper(word[i])
|
||||
numCaps += 1
|
||||
end
|
||||
end
|
||||
return numCaps
|
||||
end
|
||||
|
||||
cmdTableArr = COMMAND_TABLE.split("\\s+")
|
||||
cmd_table = new(map)
|
||||
|
||||
for word in cmdTableArr
|
||||
cmd_table.put(word, countCaps(word))
|
||||
end
|
||||
|
||||
print "Please enter your command to verify: "
|
||||
user_input = input().split("\\s+")
|
||||
|
||||
for s in user_input
|
||||
match = false
|
||||
for i in range(0, len(cmd_table.keys) - 1)
|
||||
if (len(s) >= cmd_table.get(cmd_table.keys[i])) and (len(s) <= len(cmd_table.keys[i]))
|
||||
temp = upper(cmd_table.keys[i])
|
||||
if temp .startswith. upper(s)
|
||||
print temp + " "
|
||||
match = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if !match
|
||||
print "*error* "
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue