Thanks Tobias La, But it did not work. Maybe my problem is not clear. The following is a more detail explanation:
What I want to do:
User could input sentence without blank space separators, for example, input: IloveChatScriptVeryMuch. I want this sentence could math patterns such as, ( love ChatScript ).
What I have:
A function called ^cn_segment() for tokenizing input sentence. For example, ^cn_segment(IloveChatScriptVeryMuch) will output: I love ChatScript Very Much.
My Problem:
How can I use this function to tokenize each input before matching with patterns?
What I have tried:
I have tried to change the value of %originalsentence and %originalinput variables in control script. But it does not work.
outputmacro: test() # you get test by default
$cs_token = #DO_NUMBER_MERGE | #DO_DATE_MERGE | #DO_PROPERNAME_MERGE
^addtopic(~basic)
$cs_prepass = ~segmentation
$cs_control_main = ~control
# $cs_control_post = ~XPOSTPROCESS # uncomment to enable talk
$userprompt = ^”%user: >”
$botprompt = ^“Bot: “
table: defaultbot (^name)
^createfact(^name defaultbot defaultbot)
DATA:
test
topic: ~segmentation system ()
t: ( _* ) # memorize sentence to pass to Jieba segmentation
%originalinput = ^cn_segment(‘_0) # %originalsentence variable has also been tried
topic: ~control system ()
.....