ChatScript 4 Memorization

https://github.com/bwilcox-1234/ChatScript/blob/master/WIKI/ChatScript-Memorization.md

4.1 User Memorization in Conversation

   This is easiest done by memorizing certain kinds of information and having a use for them later. Thing like what pet they have, whether they like coffee or not, their age, etc. 

   There are two places one can store longer term data variables and facts. Variables are the cheapest and most efficient thing to use, Here is an example of memorizing pets:

topic: ~introductions repeat keep []
t: Do you have any pets?
     #! dog
     a: (%tense!=past dog) Dogs make great pets. $pet = dog

     #! cat
     a: (%tense!=past cat) I prefer cats. $pet = cat

     #! elephant
     a: (_~animals) $pet = _0
s: ( %tense!=pass << I ~own _~animal >>) $pet = _0
   Consider that we know they own a dog and the conversation is currently on food. You might have a gambit inside ~food like this:

concept: ~table_pets (dog cat lion goat elephant)
t: ($pet?~table_pets) Do you ever feed your $pet table scraps during dinner?
    Note that $pet is a variable that, once set, lives forever with the user data unless you explicitly erase it. Therefore it can be used all over the place, and only gambits and responders using it that generate output will get erased, the variable remains for other rules to trigger on.


https://github.com/bwilcox-1234/ChatScript/blob/master/WIKI/ChatScript-Common-Beginner-Mistakes.md

Common Beginner Mistakes

   Failing to separate tokens with a space

       u:MYLABLE()

   Leading and trailing * in a pattern

       u: (* I go home *)    the *'s are superfluous

   Inadequate understanding of rejoinders

       t: How old are you?

            a: (~number<5) You are young.

            b: (~number<10) You are a growing child.

            c: (~number<100) You are old.

    Failing to use sample input comments

         Whenever you have a responder or rejoinder, you should have one or more sample inputs above it.

         When you write sample inputs, CS can be asked to :verify that the pattern does indeed work for the cases given and tell you.

#! december 2, 1980
#! december 2 in 1980
#! dec second of 1980
u: ( * _~month_names {, } _~number { in of } _{~yearnumber} )

    Omitting ^ from a function call 

  

    Transferring function values to variables

      outputmacro:  ^func( ^units ^time_value)

      if (^time_value == weeks)

     Fail to take advantage of canonical values of keywords

        u: ( _~number [second seconds ])

 ==> u: (_~number second)

      Excessive topic keywords

           topic: ~childhood ( my childhood young )

       Redundant { } choices

           u: ( I will love you {maybe} tomorrow )

       My pattern doesn't match the input I crafted it for!

           :prepare this is my special input

       Wrong understanding of scoping of variables

           outputmacro: ^myfunc(^myargument)

       Separating keywords with commas

           Topic: ~mytopic [keyword1, keyword2, keyword3]

       Listing phrases or titles in [] instead of quotes

            u: ([Doctor Zhivago])

       Being unaware of interjections in CS

           topic: ~introduction ( hi hello welcome)

           is wrong because hello is not a normal word like a noun, verb, adjective, or adverb, It is a special word that is a "dialog act" or an "interjection"

       Expectiing CS numeric assignment to mirror other languages

           $tmp = %hour + $tmp

       Thinking [] in a pattern will find the earliest match

            u: ( the * [bear raccoon] ate ) . It will try each in turn, and if a match is found, it will stop trying words in the [] immediately.

        Querying with the same value in 2 positions

            ^query(svo $_tmp $_tmp value)


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值