AI Zone Admin Forum Add your forum

Chatbot Conference in the Netherlands on Tue 24, 2018, with international line-up! Check it out

Don’t work when start word from uppercase
 
 

Please help me with situation below.
I have next code:

concept: ~business [farm work office business earn]
concept
: ~pleasure [pleasure fun vacation trip weekend "after work"]

outputmacro
: ^determine_type ($_param)
{
    $_param 
= ^substitute(character $_param " " "_"
    if(
$_param?~pleasure)
 
{
  pleasure
 }
 
else if($_param?~business)
 
{
  business
 } 
}

#! pleasure
#! for vacation
#! only for work
#! business
u: (< {[just only]} {for} _[~pleasure ~business]>) 
$_inputType = ^determine_type('_0)
Output: $_inputType 

In case: “pleasure” or “work”. All work fine
But in case “Pleasure” or “Work” don’t work :(
I thought CS should all translate to lowercase


Thanks!

 

 
  [ # 1 ]

I add next fix:
Add to function “determine type”.
Switch words to lowercase
$_param = ^pos(lowercase $_param)

 

 
  login or register to react