Changes between Version 24 and Version 25 of en/ProgrammingRobotsCourse/PepperApi
- Timestamp:
- Mar 30, 2020, 2:55:10 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
en/ProgrammingRobotsCourse/PepperApi
v24 v25 106 106 107 107 ==== Using basic arithmetics 108 https://nlp.fi.muni.cz/projekty/pepper/videos/pocitani.mp4 109 110 See `dialog_counting` app for details. 108 109 See video [https://nlp.fi.muni.cz/trac/pepper/wiki/NlpPepperShows#IcandocomputationsinCzechUm%C3%ADmpo%C4%8D%C3%ADtatv%C4%8De%C5%A1tin%C4%9B "I can do computations " in Czech / "Umím počítat" v češtině]. 110 111 See https://gitlab.fi.muni.cz/nlp/dialog_counting/ app for details. 111 112 Concepts for arithmetic operators and numbers are created. Not every number is defined, but rather decimal places and their combination, eg. 112 113 113 114 {{{ 114 115 concept:(tens) [20 30 40 50 60 70 80 90] 115 concept:(number_hundreds) ["{[1 "jedno"]} sto" "dvě stě" "[3 4] sta" "[5 6 7 8 "osum" 9] set" dvěsta dvěstě pěcet šescet devěcet] 116 concept:(number) ["~number_hundreds {~number_tens} {~digits}" "~number_tens {~digits}" ~digits] 116 concept:(number_hundreds) ["{[1 "jedno"]} sto" 117 "dvě stě" dvěsta dvěstě 118 "[3 4] sta" "[5 6 7 8 "osum" 9] set" pěcet šescet devěcet] 119 concept:(number) ["~number_hundreds {~number_tens} {~digits}" 120 "~number_tens {~digits}" ~digits] 117 121 }}} 118 122 … … 120 124 121 125 {{{ 122 u:(["kolik [je jsou]" spočítej spočti] _"~number ~operator [~number ~number2]")126 u:(["kolik je" spočítej] _"~number ~operator [~number ~number2]") 123 127 $num_expression=$1 124 128 ^call(ALDialogCounting.compute($num_expression)) … … 128 132 }}} 129 133 130 Computing function receive recognized words as parameters and have to convert the words to numbers before producing the result.`command` parameter contains recognized sentence, eg. "dvacet dva plus třináct".131 132 {{{ 134 The computing function receives the recognized words as parameters and has to convert the words to numbers and operation before producing the result. The `command` parameter contains recognized sentence, eg. "dvacet dva plus třináct". 135 136 {{{#!python 133 137 m = re.match('(.*) (' + '|'.join(OPERATOR_WORDS) + ') (.*)', command) 134 138 if m: