1 from __future__ 
import print_function
 
    3 from robocup_knowledge 
import knowledge_loader
 
    4 common = knowledge_loader.load_knowledge(
"common")
 
    6 not_understood_sentences = [
 
    7         "I'm so sorry! Can you please speak louder and slower? And wait for the ping!",
 
    8         "I am deeply sorry. Please try again, but wait for the ping!",
 
    9         "You and I have communication issues. Speak up!",
 
   10         "All this noise is messing with my audio. Try again" 
   21 T[{actions : <A1>}] -> C[A1] 
   34 DET -> the | a | an | some 
   35 MANIPULATION_AREA_DESCRIPTIONS -> on top of | at | in | on 
   38 for room 
in common.location_rooms:
 
   39     grammar += 
'\nROOMS[%s] -> %s' % (room, room)
 
   41     grammar += 
'\nLOCATIONS[%s] -> %s' % (loc, loc)
 
   42 grammar += 
'\n ROOMS_AND_LOCATIONS[X] -> ROOMS[X] | LOCATIONS[X]' 
   43 for obj 
in common.object_names:
 
   44     grammar += 
'\nOBJECT_NAMES[%s] -> %s' % (obj, obj)
 
   46     grammar += 
'\nMANIPULATION_AREA_LOCATIONS[%s] -> MANIPULATION_AREA_DESCRIPTIONS the %s' % (loc, loc)
 
   47 for cat 
in common.object_categories:
 
   48     grammar += 
'\nOBJECT_CATEGORIES[%s] -> %s' % (cat, cat)
 
   49 for place 
in common.location_names:
 
   50     grammar += 
'\n PLACEMENTS_AND_BEACONS[%s] -> %s' % (place, place)
 
   61 Q["action" : "answer", "solution": "the scientific study of robot"] -> what is robotics 
   62 Q["action" : "answer", "solution": "joseph engelberger"] -> who is considered as the father of industrial robot 
   63 Q["action" : "answer", "solution": "a m l a manufacturing language"] -> give one example for a computer programming language that can be used for robot programming 
   64 Q["action" : "answer", "solution": "heavy investment"] -> what is the major disadvantage of using a robot 
   65 Q["action" : "answer", "solution": "lisp and prolog"] -> name the language used in expert system 
   66 Q["action" : "answer", "solution": "knowledge base"] -> name one of the most important parts in expert system 
   67 Q["action" : "answer", "solution": "mycin"] -> which system was designed for diagnosis and therapy recommendation for infectious disease 
   68 Q["action" : "answer", "solution": "human intelligence have certain limit in speed and accuracy it is interrupted due to the lack of presence of mind mood etc but a i systems have their own superb abilities"] -> what is the importance of a i 
   69 Q["action" : "answer", "solution": "tim burners lee"] -> weaving the web was written by 
   70 Q["action" : "answer", "solution": "trial test of a computer or software before the commercial launch"] -> what is beta test 
   71 Q["action" : "answer", "solution": "portable document format"] -> what is the extension of pdf 
   72 Q["action" : "answer", "solution": "relational data base management system"] -> expand rdbms 
   73 Q["action" : "answer", "solution": "charles babbage"] -> difference engine was developed by 
   74 Q["action" : "answer", "solution": "google"] -> orkut dot com is now owned by 
   75 Q["action" : "answer", "solution": "google"] -> orkut com is now owned by 
   76 Q["action" : "answer", "solution": "intel 4004"] -> worlds first microprocessor is 
   77 Q["action" : "answer", "solution": "structured query language"] -> what is sql 
   78 Q["action" : "answer", "solution": "short message service"] -> what is the expansion of sms 
   79 Q["action" : "answer", "solution": "i b m"] -> which it companys nickname is the big blue 
   80 Q["action" : "answer", "solution": "institute of electric and electronic engineers"] -> what is the full form of ieee 
   81 Q["action" : "answer", "solution": "raymond samuel tomlinson"] -> email was developed by 
   82 Q["action" : "answer", "solution": "net citizen citizen who uses internet"] -> who is netizen 
   83 Q["action" : "answer", "solution": "fake antivirus softwares"] -> what is scareware 
   85 WHATWHICH -> what | which 
   96 Q["action" : "count", "entity" : P] -> how many PEOPLE[P] are in the crowd | tell me the number of PEOPLE[P] in the crowd 
  106 SEARCH -> where is located | in WHATWHICH room is 
  108 Q["action" : "find_placement", "entity" : Y] -> SEARCH the PLACEMENTS_AND_BEACONS[Y] 
  109 Q["action" : "count_placement", "entity" : Y, "location" : R] -> how many PLACEMENTS_AND_BEACONS[Y] are in the ROOMS[R] 
  110 Q["action" : "answer", "solution": "0"] -> how many doors has the living room 
  111 Q["action" : "answer", "solution": "2"] -> how many doors has the dining room 
  112 Q["action" : "answer", "solution": "2"] -> how many doors has the bed room 
  113 Q["action" : "answer", "solution": "0"] -> how many doors has the kitchen 
  123 ADJR -> smaller | bigger 
  126 Q["action" : "find_object", "entity" : O] -> where can i find DET OBJECT_NAMES[O] 
  127 Q["action" : "find_category", "entity" : C] -> where can i find DET OBJECT_CATEGORIES[C] 
  128 Q["action" : "return_category", "entity" : O] -> to WHATWHICH category belong the OBJECT_NAMES[O] 
  129 Q["action" : "return_color", "entity" : O] -> whats the color of the OBJECT_NAMES[O] 
  130 Q["action" : "compare_category", "entity_a" : O, "entity_b" : A] -> do the OBJECT_NAMES[O] and OBJECT_NAMES[A] belong to the same category 
  131 Q["action" : "count_object", "entity" : C] -> how many OBJECT_CATEGORIES[C] there are 
  133 NQ["action" : "count_placement", "entity" : C, "location" : Y] -> how many OBJECT_CATEGORIES[C] are in the PLACEMENTS_AND_BEACONS[Y] 
  134 Q["action" : "count_objects_placement", "entity" : O, "location" : Y] -> how many OBJECT_NAMES[O] are in the PLACEMENTS_AND_BEACONS[Y] 
  137 NQ["action" : "category_at_loc", "location" : Y] -> what objects are stored in the PLACEMENTS_AND_BEACONS[Y] 
  138 NQ["action" : "compare", "entity_a" : O, "entity_b" : A] -> between the OBJECT_NAMES[O] and OBJECT_NAMES[A] which one is ADJR 
  149 PEOPLE['people'] -> people 
  150 PEOPLE['children'] -> children 
  151 PEOPLE['adults'] -> adults 
  152 PEOPLE['elders'] -> elders 
  153 PEOPLE['males'] -> males 
  154 PEOPLE['females'] -> females 
  156 PEOPLE['women'] -> women 
  157 PEOPLE['boys'] -> boys 
  158 PEOPLE['girls'] -> girls 
  160 GENDER['male'] -> male 
  161 GENDER['female'] -> female 
  163 GENDER['woman'] -> woman 
  165 GENDER['girl'] -> girl 
  167 POSITION['standing'] -> standing 
  168 POSITION['sitting'] -> sitting 
  169 POSITION['lying'] -> lying 
  171 GESTURE['waving'] -> waving 
  172 GESTURE['rise_l_arm'] -> rising left arm 
  173 GESTURE['rise_r_arm'] -> rising right arm 
  174 GESTURE['left'] -> pointing left 
  175 GESTURE['right'] -> pointing right 
  178 COLOR['blue'] -> blue 
  179 COLOR['white'] -> white 
  180 COLOR['black'] -> black 
  181 COLOR['green'] -> green 
  182 COLOR['yellow'] -> yellow 
  185 if __name__ == 
"__main__":