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

using bit flags in scripts
 
 

I am looking for an example of how to use the 64/32-bit flags that are returned from functions like:
^partofspeech()
^properties()
^flags()
^role()

I am sure this must be simple to do but I cannot find an example and I have tried things like:

$isNoun = ^properties( dog) & NOUN

$isNoun = ^properties( dog ) AND NOUN

$isNoun = ^properties( dog)
$isNoun &= NOUN

yes, I know that there exists ^hasanyproperty() and ^hasallproperty() but those will not give you information from the parsed sentence only the dict.

 

 
  [ # 1 ]

not looking deeply at this question at present, just noting that ALL constants taken from CS must be prefixed with #  so that’s #NOUN which compiler converts to the numeric value found in dictionarysystem.h

 

 
  [ # 2 ]

Brilliant!

the following works in interactive mode

:do if( ^propertiesdog ) & #NOUN ) {is true} else { is false}
# is true

 
:do if( ^propertiesdog ) & #COMMA ) {is true} else { is false}
# is false 

Thanks Bruce!

 

 
  login or register to react
‹‹ ChatScript on Twitch      CS input analysis ››