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..

Question in accessing multi-word members in a concept
 
 

Say I have the following script:

CONCEPT: ~stuff(“the coffee” “the tea and cookies” )

t: Name your preference please.  ...  $s = ^pick(~stuff)
u: ( I prefer _~stuff ) ^if ( ‘_0 = $s ) { do something }

The ^if condition will never turn true because of different processing by CS:
:variables user
... $s = the_tea_and_cookies (underscored string)

:variables match
.... _0 = the tea and cookies

Am I right in the above? If yes, how could the matching be managed? Many thanks.

 

 
  [ # 1 ]

You can
1. use ^substitute to flip the underscores to spaces in $s
OR
2. with the latest CS version probably in your bot definition outputmacro, do $cs_wildcardseparator = _
to change the default building style of match variables to use underscores instead of spaces.

 

 
  [ # 2 ]

The advice came amazingly quick! Many thanks again Bruce.

 

 
  [ # 3 ]

I hit some surprises continuing the case.

First I picked the easier way using ^substitute. I got lots of build warnings (something like underscore is not a recognized word…).

First surprise - doing “:build mybot nospell” does NOT stop those warnings as indicated in the manual.

Later the increasing warnings forced me to take the 2nd advice, setting $cs_wildcardseparator. Then the 2nd surprise - it does not work as shown in the attached screen shot.

Did I missed anything? Thanks. (My CS version is 5.1.)

Image Attachments
cs_wildcardsep.png
 

 
  [ # 4 ]

5.1 does not have the $cs_wildcardseparator variable in it. I did say “with the latest CS version”

You’ll need to show me an example of your build warnings…

 

 
  [ # 5 ]

Right. I should have noticed you said “the” latest. I thought 5.1 is late enough.

Please refer to the attached screen shot for the warning message and source lines. Thanks.

Image Attachments
CS_underscore1.png
 

 
  [ # 6 ]

(Source line added in this post due to picture size limit.)

Image Attachments
CS_underscore3.jpg
 

 
  [ # 7 ]

Your warning messages are not spelling errors and thus NOSPELL has no effect. They are misinterpretation that you may have been trying to use rename:  to meaningfully name generally unmeaningful number variables of various kinds.  The compiler incorrectly interpreted those within the “_”  and I have fixed that. But you can in the meantime merely do
substitute(character ^pick(~st_stuff) _ ” “)

 

 
  [ # 8 ]

Yes I read about that “rename” thing in the message. But did not know what it was about. (Still don’t even now. grin )

Thank you for correcting me in specifying the literals in ^substitute. Those warnings never show now!

 

 
  [ # 9 ]

rename: can be used to provide a name for _n variables and @n sets. or name constants.  eg

rename: _holding _10

rename: @inputtopics @18
rename: ##NORMAL_ORDER 1

 

 
  [ # 10 ]

Thanks for the briefing Bruce. It looks like some advanced features for me to explore later.

 

 
  [ # 11 ]

I want to know the number of active clients from server in chatscripts. How to accomplish it in chatscript

 

 
  [ # 12 ]

a) there is no current way
b) there is no way to know the true current count of active clients, since no connection is maintained to a client. 
The only thing that can be done easily is count how many volleys have transpired in some time frame.  And that is not tracking how many different clients (though it would be possible, it is not worth it)

 

 
  [ # 13 ]

on an external basis, you could pick a time slice from the server to determine both how many volleys and how many different clients

 

 
  login or register to react