AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

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