Changes between Version 24 and Version 25 of en/ProgrammingRobotsCourse/PepperApi


Ignore:
Timestamp:
Mar 30, 2020, 2:55:10 PM (3 years ago)
Author:
Ales Horak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • en/ProgrammingRobotsCourse/PepperApi

    v24 v25  
    106106
    107107==== Using basic arithmetics
    108 https://nlp.fi.muni.cz/projekty/pepper/videos/pocitani.mp4
    109 
    110 See `dialog_counting` app for details.
     108
     109See 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
     111See https://gitlab.fi.muni.cz/nlp/dialog_counting/ app for details.
    111112Concepts for arithmetic operators and numbers are created. Not every number is defined, but rather decimal places and their combination, eg.
    112113
    113114{{{
    114115concept:(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]
     116concept:(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]
     119concept:(number) ["~number_hundreds {~number_tens} {~digits}"
     120    "~number_tens {~digits}" ~digits]
    117121}}}
    118122
     
    120124
    121125{{{
    122 u:(["kolik [je jsou]" spočítej spočti] _"~number ~operator [~number ~number2]")
     126u:(["kolik je" spočítej] _"~number ~operator [~number ~number2]")
    123127    $num_expression=$1
    124128    ^call(ALDialogCounting.compute($num_expression))
     
    128132}}}
    129133
    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 {{{
     134The 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
    133137m = re.match('(.*) (' + '|'.join(OPERATOR_WORDS) + ') (.*)', command)
    134138if m: