-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchanges.txt
More file actions
2464 lines (2128 loc) · 144 KB
/
changes.txt
File metadata and controls
2464 lines (2128 loc) · 144 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Version 13.4 October 15, 2023
1. For users who have the TreeTagger add-in, the latest code supports reading a file which enumerates
supplemental foreign vocabulary. Write me for a copy of the library files. See Esoterica manual on TreeTagger.
Version 13.3 August 13, 2023
1. Support for Filipino
2. potential phone numbers are marked
~phonenumber, ~uslocal_phonenumber,
~usinternational,~usinternal_phonenumber,~ukinternal_phonenumber
~ukinternational,~deinternational
~jpinternational,~esinternational, ~mxinternational
Version 13.2 June 13, 2023
Note- you will be forced to recompile your bot when you run this version initially.
Formats for compiled data have changed.
0. ^load() removed
1. JSON autoindirects a get or assign expression of a variable whose value is itself a variable.
if $x = '$y' and $y points to a json structure, then $x is auto and $x.val means $y.val .
2. Advanced replace substitution- you can name a pattern (which can extend over multiple lines)
that can conditionally change the
matched word into any other word or remove it or do nothing.
Matching starts with _0 having been assigned to the location of the word/phrase to replace.
e.g.:
replace: bubble_tea ([
(is $$cs_replace:=2)
(has $$cs_replace:=null)
(@_0- *~2 my $$cs_replace:=1)
])
"bubble tea is" -> 2 is
"bubble tea has" -> has
"my green bubble tea loves" -> my green 1 loves
You cannot use concepts in these patterns, nor the canonical forms of words.
Version 13.1 May 9, 2023
1. New command line parameers
a. legacymatch=0/1 (default if not given is legacymatch=1)
redefinition of match variable contents when matching a concept.
canonical is the concept member NOT the canonical form of the words
and original is what user typed (after corrections)
eg: concept: ~food ("baked potato") with input "baked potatoes"
legacy=1 : (_~food) => '_0 - baked_potatoes _0 - bake_potato
legacy=0 : (_~food) => '_0 - baked_potatoes _0 - baked_potato
If you don't have code that depends on legacy, you are better off adding legacy=0 to your init file
b. filecache= allocates a buffer to cache max n files.
A server might want to cache common files across volleys and users.
eg. filecache=5000x100 means allocate a 5M buffer for caching 100 files.
c. nophrases - suppresses marking ~prep_phrase, ~verb_phrase, ~noun_phrase
this is a minor speedup if you don't have a use for them.
d. nopatterndata - disables pattern data gathering that supports ^MatchesCode
this is a minor speedup if you don't use ^MatchesCode
e. websocketbot=xxx - names bot to be used for websocket communcation
2. New functions
a. ^jsonreusekill($jsonstruct)
Kills the facts of this struct and makes them immediately available for reuse as free facts
3. Function changes
^pos(uppercase/capitalize xxx) no longer capitalizes all in a phrase now follows title de capitalization rules regarding short conjunctions, prepositions, determiners
^pos(mixcase ... ) lowercase all letters except first one and first ones after space, underscore, hyphen
^setrejoinderO - simplied use, no longer need to use "copy" in some circumstances
^pos (substitute xxx)
^stats - removed wordaccess and averagehashdepth
^readfile (aka ^jsonreadcsv) now supports using :trace all and :trace none as input lines so
you can observe the behavior of specific lines of the file. also :quit, :exit, :pause, :resume
Note that the use of :trace and :quit are generally supported on any function which is reading data,
including :source, table compilation, ^readfile.
3. New debug functions
:respondonly - Take serverlog named and replicate in tmp but without serverpre or separator lines
:dumpcache - dumps data about files currently cached by server
:splitfile - reads huge file line by line, writing 20mb pieces into TMP
:mergelines file {all} - now documented in Finalizing a bot
It reads in lines and for adjacent exact matches, it outputs the line just once, with a count in front.
Useful for finding how often a rule triggers in server log or finding unique user inputs to go
add to your bot.
4. New marks
~verb_phrase, ~noun_phrase, ~prep_phrase enable easy grabs of sentence fragments
5. Command line parameter removed:
nl_save - no longer cache nl analysis in testpattern
6. new cs interchange variables
$cs_jid - number to start with when starting indexing of new json structure ids
$cs_directfromoob, if set to true, tells cs to convert any incoming oob directly into a json structure
7. additional engine hook funcions
EndChat, PosTag, CheckRoles
MarkWord, SequenceMark, AdditionalMarks, BugLog,
DatabaseOperationStart (mongo), DatabaseOperationStop (mongo)
8. Additional %httpresponse codes from jsonopen (see system variables manual for %httpresponse)
9. Modified JSON behavior:
JSON is case sensitive in field names. CS is not. If you offer a new case field name and it already has a field
with a different case, it will use the preexisting one.
You can name fields to ignore returning from ^parsejson and ^jsonopen by passing in a concept set
of names. If you have given an ignoreconcept, then whenver a field name is encountered in the incoming data
matches the name of a member of that concept set, that field and all data below it are discarded.
If you have given an underscore concept, then any field name encountered in the incoming data
that matches a member of that concept, that field's string value will have any spaces in it
replaced with underscores.
Version 12.31 October 23, 2022
1. Any nonjson loop limit given as a positive number will locally override whatever limits normally would
exist for a std non-json loop. eg Loop (20000) will make the limit be 20000 whereas Loop(^length(...))
would limit to whatever the current limit it even if ^length returned a greater value.
2. ^jsonopen optionally takes 2 additional arguments. First is the name of a concept whose
members are names of fields which if seen should be discarded. Second is the name of a
concept whose members are names of fields which are presumed to be string values, and
all blanks in the string should be converted to underscores.
2. ^jsonparse optionally takes 2 additional arguments. (see #2)
3. %httpresponse has been extended with additional negative code values specific to curl failing to connect.
4. New void rule kind `v: LABEL ()` which is faster and clearer than writing `s: LABEL (?)`.
It is used as the target of ^reuse or ^refine.
Version 12.3 October 16, 2022
WARNING- You will need to recompile your script files!
Erase TOPIC folder and then run CS and rebuild.
0. Dictionary size now can be doubled, to allow 4M words instead of 2M.
Enabled one to load english, french, spanish, and german all at once.
1. With extra multi-language abilities, when you use the replace: command
be sure it is done under the correct language. You can do something like:
language: english
replace: "my word" mina_worda
Setting language lasts until you next change it.
2. documenting existing ^setresponse which is merely a rename of ^reviseoutput.
changes a queued message
3. You can synthesize a function name and then call it, eg
$_fn = ^join( ^testing _ en_us)
$_text = ^$_fn($_tmp)
Previously ^join would complain about a bad function call.
4. CS has inbuilt support for spanish lemma and possible pos-tags detection and manages words with and without their appropriate accenting.
It has concepts to represent object plurality and gender.
5. CS now allows you to name 7 language instead of 4 in cs_init files for what languages should be loaded.
In build files, you can designate what language is compiling what files, and include the language UNIVERSAL, which means a word
is visible to ALL languages and has the union of all its facts and properties from each language.
With an appropriate level 0 build file, you can load translated std cs concepts for multiple languages.
See Esoteric foreign language support LEVEL 0
6 :ingestlog reads a cs log file, repeats its calls and reports differences in the results and outputs errors to tmp/ingesterr.txt
7. The japanese mecab tagger and in-built nlp system will be applied to chinese if that is a named language.
Japanese requires installation of additional software and building executable without DISCARD_JAPANESE
8. ^jsonopen header value correlation-id: %s
If you have a variable $correlation_id, this value will be passed to remote call from jsonopen.
See Json manual.
9 :splitlog takes a cs log file and creates tmp/log.csv, whose columns are:
input, output, whyname, botname. See ChatScript Analytics manual.
10 ^incontext takes optional 2nd arg, an integer with how from the volley to not fail
Default returning how far from volley we are is changed when this param is used to how far or fail.
11 :verifylist, :verifyrun :verifymatch and associated #! VERIFY comments
A regression system that reads special comments in scripts, executes them always in the context
of coming from the top level initially outside of any topic. Arrival at the correct rule is a match
regardless of what the output text is. See Finalizing a Bot manual.
12 :translatetop - Reads a chatscript source file and outputs a corresponding one in the language you
request, using microsoft translate. See Esoteric ChatScript Foreign languages.
13. :fact - similar to :word, display all facts with given word or meaning or in named fact set"
14. :word - now accepts optional 2nd argument which is the limit limit on number of facts to display
15 :language sets current language or if given no language returns the current language.
See also CS command line parameters language= parameter.
16 :ingestlog reads a cs log file, repeats its calls and reports differences in the results and outputs errors to tmp/ingesterr.txt
Version 12.2 June 20, 2022
1. added more about keywords in ChatScript Coding Standards
2. for people with various treetagger licenses: CS now supports loading
english, spanish, german pos-tagging and chunking. Requires you get new library modules from me.
See Esoteric: ChatScript-Foreign-Languages
3. CS now supports japanese with a native 3rd party library. See Esoteric: ChatScript-Foreign-Languages
4. new debugging tool for ^testpattern and ^testoutput. If input contains the serverauthorizationcode
you supply in cs_initmore.txt, followed immediately by 2, then if there is a double quoted string as the next
token, and the first token of that string is the label of the currently executing testpattern node, the
rest of the string will be compiled, executed, and its output returned as a debug field. If no testpattern nodes
match that name, then the first testoutput node that is invoked will execute the debug string.
See ChatScript-Debugging-Manual : ^testpattern
5. if language is japanese, testoutput will remove all spaces not within doublequotes. ^testpattern
will change bits of japanese-written punctuation in a pattern to english to be compatible with pattern matching.
This includes japanese ( ) [ ] { } space. All variables need . - _ letters and digits converted from japanese to ascii.
6. param random= will force a specific value to be returned from %random
7. New automated script testing functions :verifylist, :verifyrun, :verifymatch will see if your verification comments
can be reached. See ChatScript-Finalizing-a-bot Generic :verify
Version 12.1 4/24/2022
1. Support for emoji (see Esotheric-ChatScript/ChatScript-Foreign-Languages)
2. Support for Spanish- (see Esotheric-ChatScript/ChatScript-Foreign-Languages)
detect verbs in simple past, present, and future tense.
detect gender and plurality of adjectives and nouns
detect plurality of pronouns
3. You can use multiple treetaggers (if you are licensed) including
english, german, and spanish. (see Esotheric-ChatScript/ChatScript-Foreign-Languages)
but you need a new copy of treetagger library from me.
4. If you explicitly create a json array, it will remember whether it should
use duplicates or unique.
5. :tsvsource switches input to a special conversation-oriented file.
See chatscript-debugging
6. controls over cs level of effort (see ChatScript-System-Variables-and-Engine-defined-Concepts)
$cs_badspellLimit
$cs_analyzelimit
$cs_analyzelimitlog
$fakeTimeOffset
7. mongo db control variables (see Esoteric-chatscript/ChatScript-database-access)
$mongo_enable_ssl
$mongosslcafile
$mongosslpemfile
$mongosslpempwd
$mongo_timeexcess
$mongovalidatessl
$$mongo_error
8. ^testpattern control variables
$testpatternpretopic - execute this topic to preprocess input before matchines
$$cs_testpatterninput -- a copy of user input created by engine for $testpatternpretopic
to change if it wants to act as actual user input
$testpattern_posttopic - execute this topic after testpattern to monitor and adjust variable changes
9. misc control variables
$cs_beforereset if set to a topic, will be executed before :reset is executed
$cs_sequence How many words in sequence to check as a composite (default: 5)
10. serverlogauthcode in input- using that value in user input used to
enable pattern tracing. concatening 2 onto that value will enable
full tracing in ^testpattern. Full tracing is automatic in ^testoutput.
11. %starttimems - Start of user request time/date in milliseconds
12 %tsvsource (1 if in progress Null otherwise)
13. %heapsize how many bytes of heap are left
14. ^print now has arguments stdout (send to console) and log (the previous default)
15. given an jsonarray treated as an object (using dot)
$array.value returns the index of the element that has that value
16. :concat -- read from file and merge lines into one input line
17 bwinfo, if stated in user input to ^testpattern, will return
a changed variable bwinfo which lists all words and the concepts marked for them
A concept ~bwinfo_ignore will list concepts NOT to show here.
Version 11.6 11/21/2021 THANKSGIVING SPECIAL
1. Support for multiple language dictionaries at once (+ japanese)
a. command line parameter - eg - "language=english,german"
b. :language to change language in local mode during conversation
c. :word(word) lists what language dictionaries word is in
d. top level "language: german" to scriptcompiler
e. $cs_language when set will change to that language
f. ^Setlanguage(spanish) to change from script
g. API top level field "language" whose value is the language to use for ^testpattern, ^testoutput, ^compilepattern, ^compileoutput
h. Special spellchecking support exists for german, spanish, french
i. tokenization- Japanese major sentence end punctuation converts to US std
2. topic flag TOPIC_SAFE documented (when topic revision is "safe" so any saved state of user in topic is not destroyed)
3. :build flag echorule -- displays what rule you are currently compiling (useful if you dont know where you were if you died)
4. %curlversion %dbversion - version information for curl and current database connection
5. %crosstalk2 and %crosstalk3 - additionaly crosstalk variables (used to communicate across users via server)
6 :trace to scriptcompiler - see debugging manual "Tracing during compilation"
7. serverlog entry shows linux pending requests q size at time of entry into q when using evserver mode
8. TOPRULE param for use when inside rejoinder areas (a:, b: etc) ^fail(TOPRULE) ^end(toprule) ^nofail(toprule)
9 ^setposition modified to accept ^setposition ( _var1 _var2 original ) which sets range from original user input
10 ^spellcheck accepts 3rd argument, tolerance for number changes that can be made or % of changes
11 jsonmerge optional 3rd argument
SUM When the keys in the two objects are the same then the values are added together.
SUMIF will only do that if the key actually exists in both objects being merged.
12 :restart redo_boot will, at end of volley, unwind the boot layer and reexecute boot functions to repopulate the server
with new boot data visible to all bots and users.
13 parselimit tells the system to not bother parsing, postagging or spellchecking inputs greater than this limit (speed optimization).
14 command line params
a. stdlogging and noserverprelog removed
b. deployloggingdelay - enable serverlogging on deploy automatically for n minutes (when normally logging would be off)
c. nl_save=1 -- caches nl processing on $cs_nldata for api calls to ^testpattern to pass along to future calls. saves processing time
`nl-save` in user input will override to force nl saving (sets $bwnlsave to do the same thing)
d. file traceboot.txt to set param trace_boot dynamically on startup
15. ^compilepattern/testpattern/testoutput support for script function definitions assigned to variables
see ^compilepattern ""Compiling script functions"
16. ^testpattern changes
a. style=tfdif in patterns for ^testpattern to match patterns in a manner to tf/dif
b. testpatterninput cheat cs info - returns variable $cs_info with when scripts and engine were compiled
c. if ^testpattern pattern calls ^jsonopen and fails (eg timeout or bad url), and extra field will be returned jsonopen-status field
d. $$cs_sentencecount- the number of the current sentence being used in ^testpattern - can be used with ^restoresentence
e. ^testpattern accepts a label field on each pattern, and using ^getrule(~ label) will retrieve this
f. %testpattern-prescan in the first n patterns to ^testpattern will cause all input sentences to be run against those patterns
before running the rest of the patterns in unison against each sentence sequentially
g. %testpattern - the index of the current pattern being testsed by ^testpattern
h. %originalinput - in testpattern its the input to it, otherwises its the non-oob input per normal
i. %testpattern-nosave in pattern will override any nlsave=1 command line parameter for this call to cs
Version 11.5 7/18/2021
1. Documented existing ^JsonKind(item) function, which returns object, array or fails, depending on what is passed to it.
2. ^wordinfo(word) provides dictionary data about word properties, system flags, and substitution values.
3. ^testpattern now accepts concepts named ~noun, ~verb, ~adjective and ~adverb,
allowing you to augment the dictionary remotely.
4. if ^purgeboot is called to remove the contents of a json variable,
then if that variable is not a user variable, it will be allowed to be reassigned to
later, without it automatically reverting to pre-user values (which is normally what
happens to changes to bot variables)
5. command line param 'pseudoserver' tells cs that this DLL or sharedobject
version of CS is actually incorporated into a server and should require the same
authorizations as a server before allowing debug commands.
6. :source now accepts a line :exit to abort executing more lines from it
And :source can accept a log file and will execute the log entry data
appropriate (and skip non-useful lines).
7. command line parameter parselimit=n if input is larger than n characters, disable intense spellchecking, pos-tagging, and parsing for speed
8. privatecode handler: MongoGotDocument invoked if mongo successfully retrieves document
9. in ^testpattern %trace_on normally enables tracing data to be sent back that only does pattern trace.
but `%trace_on all` turns on full tracing.
10. ESOTERIC-CHATSCRIPT/ChatScript-Foreign-languages doc updated to give info on
inbuilt support for Japanese, German, and Spanish.
Version 11.4 6/6/2021
MAC version in BINARIES is up-to-date
1. if $tokenControl has been set to include JSON_DIRECT_FROM_OOB
then a user input that contains the word "json" followed immediately by an
obvious json structure (start with [ or { and ending with }]), the
tokenizer will convert all the json into a transient structure consisting of facts with
universal bot access and all that json will instead become a single token of the JSON name
of the structure. This allows you to bypass the normal 254 token limit on an input
sentence and provide lots of data in a single sentence.
2. if $cs_token has #TOKENIZE_BY_CHARACTER
good for ideographic languages (chinese, etc). Automatically sets canonical to same as original
?3. "exist" in fact
4. %trace_on and %trace_off - these can be used in a pattern of ^testpattern
or an output of ^testouput to enable tracing data be returned from the call
in the range between those tokens.
5. command line param blockapitrace - disables any tracing in ^testpattern and ^testouput that
might have accidentally been left in the code
6. cheat cs info - if given in input to ^testpattern, it will return newglobal variable
$cs_info, and any subsequent ^testoutput call will append that to its normal output.
7. ^msqlinit($_params) ^msqlclose()
^msqlread($_username) ^msqlwrite($_username $_value)
These routines allow you to access a Microsoft SQL Db from script.
Init Params are the same as for using such a db for a filesystem.
8. ^jsonmerge({transient/permanent} key/key-value $_arg1 $_arg2) take two json structures and perform a top level merge.
The result is a copy of the first argument, with top level fields augmented with fields
from arg2 not found in arg1. Optional first argument is the standard one for
many Json creation functions.
9. incoming messages containing \uxxxx characters (utf16 representations)
are to utf8 (or regular ascii) except m-dashes and n-dashes, which are left unchanged.
10. some html& constants are converted to utf8 except underscores, since
CS often changes underscores to spaces on output.
11 param noretrybackup disables cs saving prior volley data
for :retry when in standalone mode
12 param traceboot - turn on tracing when cs boot starts up
13. serverlog and userlog used to refer to logging done when in
acting as a server or when running standalone. No more. Now it
refers to where the log is saved. serverlogging is saved in the LOGS folder
in a file named by the port id (serverlog1024.txt). User logging is
saved in the USER folder in files named by user and bot involved.
14 restart.txt - when added to the top level folder, will force cs to
reload itself on the next volley (and it erases the file)
15. prelogging.txt - when added to the top level folder, will turn on
prelogging (message in log before cs begins processing). This is
usually only useful to show what input crashed a server and thus you
don't get a normal Respond log entry.
15. PerformChatArguments engine hook function
16 %forkcount - number of forks requested in linux evserver environment
17 %servertype - parent or fork in linux evserver environment, server or null otherwise
18 %dbparams - copy of the server params given to db used as fileserver (pg or mysql or mssql or mongo)
19 %botid - bot id number in use
Version 11.3 4/18/2021
1. Uniform conversion of inputs and jsonopen results into simple ascii for important
characters (quotes, double quotes, hyphens, etc) from \unnnn unicode, html
characters, and utf8 characters. Can be suppressed with $cs_token |= #no_fix_utf
although this does not block \unnnn conversion to utf8, since utf8 is the system
internal coding. Utf8 to \unnnn coding on any ^jsonwrite call is performed
since JSON does not use utf8 characters.
Inbound recoding is important for pattern matching and is suppressed automatically if you are
using ^testoutput and ^compileoutput calls (because you want to use them to user).
You can manually suppress by changing $cs_token to have #NO_FIX_UTF
2. Additional choices to ^stats and optional 2nd argument ECHO
FACTS: Returns how many free facts remain.
DICT: Returns how many empty dictionary entries remain.
TEXT: Returns how much space for both stack and heap remain.
HASHBUCKETS: shows how many words are in each bucket size
UNUSEDHASHBUCKETS: how many buckets are wasted (empty)
WORDACCESS: How many calls to look up a word in the dictionary happened
AVERAGEHASHDEPTH: how long is the average word lookup (words scanned)
PATTERNEVALUATION: how many calls to pattern matcher happened
TIMESUMMARY: create facts of how many ms cpu spend in functions called
3. ^JsonCount(jsonstructure depth)
show number of elements in json arrays
4. ^Jsonmerge(primaryjsonstructure secondaryjsonstructure)
Takes two json objects or two json arrays and augments the first with the second.
Any conflicts are resolved by using the primary structure.
5. Values of command line parameter `serverlogging` and `userlogging` now include
`prelog` which writes the `ServerPre` log entry (before cs starts work)
6. autorestartdelay=n will, after a crash forces autorestart by cs on the next volley, wait
n milliseconds before accepting any input. Allows faulty input retries to peter out before
resuming on this server.
7. command line parameter `crnl_safe` tells CS it does not need to test inputs for carriage
returns or newlines (which it needs to remove to keep logs ok). A performance optimization.
E.g. if your input to cs is purely json oob, this will be true.
8. additional privatecode hooks for Tokenize, IsValidToken, SpellCheckWord
9. %logging - status about what logging is enabled for servers and users (and hostname)
10. %volley mirrors %input
11. :comparelog - reads to log files and prints out differences in values (to see if something changed between versions)
12. :testpatterninfo - reads source file of calls to CS api functions and shows information
about them
13. $variable.flags - assuming $variable is a fact number, shows the flags value for that
fact
14. naming bot to talk to- and whether to initiate or not - e.g. #!Rosette#my message
15. Command Line parameter: cs_new_user="text" says if we see the given text string
in the input, treat the user as a new user always (dont try to read their topic file).
Different from erasename parameter in that it does not remove this text from input
Version 11.2 3/21/2021
1. WARNING- Change to JSON assignments representation
To create Json primitive NULL, use json_null, not "". "" now is the json empty string.
JSON manual revised to be clear on this.
2. Websocket support. You can create a websocket or make CS be Wa websocket client
command line param websocket= (where to link socket) and websocketmessage= (if you want cs to speak first on connecting)
^websocketinit, ^websocketclose, ^websocketsend, ^websocketend
3. Matching using fundamental sentence now tracks where the Subject/verb/object locations
are in matchvariables, rather than just the verb. ^position now accepts subject, verb, object to return positions of
those given a fundamental meaning match
4. like 'word which means match only with original and not canonical, ''word means
raw-case keyword. Only if the user typed this word (not spellfixed to it) and only if he typed it in this case
(excluding 1st word in sentence). Good for ambigous upper case codes like states (HI, ME), airport codes
etc. where we expect user will capitalize them for clarity.
5. Javascript function `native_log` to record data to the user log.
6. Privatecode hooks to gain control in private code space for particular situations:
a) PerformChatArguments call at start of PerformChat
b) SignalHandler on linux exception
c) MongoQueryParams adjustments for document query
d) MongoUpsertKeyvalues adds additional params for upsert
7. Mongodb can accept additional key values from a JSON object to add to a document query
from $cs_mongoqueryparams
8. if %trace_on is seen in output execution, it turns on trace all
and if %trace_off is seen, to clears trace.
9. Warnings for deprecated $bot, $token, $response have been remove
10. %inputsize gives how many characters were passed in input
11. %inputlimited is 1 if too many characters were given (relative to fullinputlimit)
12. :canonize some sentence, will show the canonicals (analogous to :tokenize)
13. :logging user {file,none,stdout,stderr} and
:logging servertrace {on, off}
:logging server {file,none,stdout,stderr} dynamically override whatever
current settings are.
14. ^removeinternalflag has been removed.
Version 11.1 2/8/2021
1. chatscript client accepts command :dllchat filename to test using dll compile of cs
2. ^jsonstorage( jsonname ) returns permanent, transient, boot or fails, depending on argument
3. ^pos(isfunction word) - returns true or fails depending on whether the word is a known function
4. word: newword NOUN -- defines words and properties. Can define the word and conjugations of it
as well as properties and systemflags and parsebits
5. source directory RAWDICT now included, is all the source used automatically by :builddict command which rebuilds english dictionary
Version 11.0 1/1/2021
1. `%fullmstime` overlooked variable documented - Numeric full time/date in milliseconds (Unix epoch time)
2. private.mk in makefile - standard cs makefile allows you to include your own additional make files and settings
3. serverlogauthcode - dynamically turns on server log for the current volley that contains this code
4. plurals.txt - supplemental livedata file that defines the plural form of singular words not known in dictionary
Additionally other livedata files not previously described are described under Dictionary Augmentation Files
5. api ~replacespelling format addition - ## CS External API- ^TestPattern ### ~replace_spelling
6. ^log (SERVERLOG/USERLOG) - ^log function can, instead of routing to a named file, route to the existing log files
7. ^synset(synsetmaster word~n) - returns the synset master of word
^synset(synsetup word~n) - if word is a master, returns the word it is a refinement of
^synset(word~n) - return a list of facts naming synonyms of the meaning
^synset(word) - return a list of facts naming all the meanings this word has.
8. :word now also shows synset parents (generalization) of a meaning and the children (refinements) of that meaning
9. ^define (word~3)
0. ^isnormalword (word) ^isnormalword(letteronly word)
11- userlogging, buglogging, serverlogging are alternatives to userlog, buglog, and serverlog and
accept: none, file, stdout, stderr or comma separated combinations
12. continuation lines '^' - file or user input ending in ^ will be joined to the next line
13 ?_word in singular will do singular or plural as appropriate (note plurals.txt)
Version 10.8 11/26/2020
1. CURRENTLY you can enable/disable using data in various LIVEDATA substition files. In particular you can enable and disable
the private substitutions you have in your scripts. And interjections dont actually replace their words, but merely
mark them. If your private substitutions contain interjection remapping, NOW those interjections also merely mark them
instead of replacing them AND will claim to come from the interjections file, so disabling your private remaps will not
disable your interjections.
2.^JSONWRITE now takes optional first argument plain, which makes it write out less noisy JSON that CS already accepts,
ie field names and string values dont need double quotes around them unless they have certain characters in them (like
spaces and semi-colons). This makes data output from CS and intended to be read back into CS easier to read. So
jo-5 which is {"value":"color"} prints as {value:color}
3. ^delete can now delete a file if given its name
4. in ^testpattern api, if pattern contains $cs_tracepattern, tracing will be turned on until the end of the call
5. new commandline param buildflags=xxx can set flags for future builds. buildflags=quiet is the same as :build harry quiet.
New choice buildflags=nomixedcase will suppress all warnings about words spelled in various cases, but leave all other
warnings intact. nomixedcase can be specified on the local build command as well. :build harry nomixedcase
6. new commandline param syslogstr= for microsoft sql use to store trace data in syslog in linux. default value is "chatscript"
7. CS detected fatal error conditions now log message in syslog (linux) before exiting.
8. \r is now automatically converted to \n when seen for output
9. user input normally is limited to 254 tokens AFTER oob is seen. To be able to pass complex JSON data as part of the user
message (because the oob is often controlled by host system so not available per user message), you can now put
in user input the word JSON and follow that with a JSON structure of arbitrary size. That structure will be completely converted to
the corresponding JSON internal fact structures and the simple JSON structure name returned. So
"my input value is JSON {x:y,b:z} here" will become "my input value is JSON jo-3 here"
10. %myip system variable returns the ip address of the CS server talking to you
11. :restart normally immediately forces a system restart, never completing the current volley. Using the optional argument
:restart completevolley will make the system finish out the response to the user and then restart at the start of
the next input.
12. debug command :fuse filename will read in the file, replace new lines with spaces, and write to TMP/tmp.txt.
this makes a multiple line file into a single file. This is handy if you are trying to create a large json structure
to be passed as user input, which is easy to read in multiple lines, but then must be reformatted to single line
for input.
Version 10.7 10/20/2020
1. ^testpattern api now accepts concepts where entries are pairs, separated by |. The left side is stored
as the concept member and a fact is created ( left-side api-remap right-side) which allows you to write
scripts that remap found entries on output to the right side value. testoutput accepts concepts so that the remap ability can be instantiated (see #1)
2. ^testpattern api accepts both pattern strings "(...)" and direct patterns (...) which will be tested
and mark the concepts (normal cs accepts concept patterns and api does too).
3. Microsoft SQL db supported as networked file system (like mysql, postresql, mongo). Not currently supported
for script use. Param mssql="xxxxx" sets server etc (see )
4. Separate documents in Esoteric ChatScript documentation replaced with ChatScript-Database_Access which covers
Postgres, Mongo, MySQL and the new Microsoft SQL connectors.
5. parameter "fullinputlimit=n" sets size of input buffer separately from buffer size parameter
6. new cs variable $cs_new_user=1 when set as bot variable (from compilation of script or from init file) forces cs to always create
user. This means if using a db as file system and making api calls like ^testpattern/^testoutput/
^compilepattern/^compileoutput which do not need to save context, no read call will be performed
on the db
7. pattern assignment operator := now allows the numeric assignments :+= :-= :*= :\= etc that normal
assignment does
8. :variablereference will list all user variable assignments and uses into TMP/reference.txt . If you sort that file, you
may detect places where you misspelled a variable, assigned but didnt use, or used but didnt assign. Normally it only shows mismatches but ":variablereference full"
will list all variables. See documentation in Finalize a bot
9. new livedata systemfolder file topleveldomains.txt read to help recognize web addressing.
10. CS ProperNameMerge function no longer mistakenly merges German uppercase pronouns.
11. VS2015 has been deleted. All Windows compiles now use VS2019 (free version)
Version 10.61 8/23/2020
1. :notrace ^query will disable most query tracing then :trace query is on, leaving you
with just startup and results. Saves seeing trace on finding lots of values
2. additional param formats
userlog=0 or 1
serverlog=0 or 1
3. new param stdlogging=0 or 1. when 1, server logging messages go to stdout and bug messages go to stderror.
good for use with Docker.
4. :topicstats labels or :topicstats labels ~mytopic will list the rule labels of a topic
with appropriate indenting based on depth of rule
5. ^recordDictionaryChanges- starts tracking changes to property and systemflags on words being modified during this volley
^revertDictionaryChanges- Undoes those changes (turning recording off as well)
^replayDictionaryChanges- Restores changes done by a record and later reverted (allowing you to insert changes not recorded)
Version 10.5 7/18/2020
1. Implied_Subject tokenflag and %impliedsubject system variable is 1 if sentence has implied subject, 0 otherwise
This is analogous to command sentences having implied YOU as subject.
An implied subject is either "I" or the prior subject, as in the sentences "I went to the market. Walked home. Ate dinner."
3. timelog= param
Will log in LOGS/time.txt volleys that exceed the given millisecond limit. Useful for analysis of slow behavior.
4. autoreload param
In event of crash of CS, and in conjunction with $cs_crash= set in bot macro... CS will execute the topic
named by $cs_crash in gambit mode. This topic can generate an appropriate dummy output and CS completes
that volley but does not save an updated user file. The NEXT volley coming in will force cs to completely
reload itself before processing. Making a dummy output hopefully means the same fatal input will not be
sent back into CS to crash it again (due to external retry when no answer is received from CS). E.g.,
topic: ~crashtopic system ()
t: Huh?
5. windowsbuglog= names a WINDOWS directory to replicate the BUGS.txt log file outside of the CS directory area
6. linuxbuglog= names a LINUX directory to replicate the BUGS.txt log file outside of the cs directory area
A full redeploy of chatscript might destroy the existing directory and its bug log. This allows one to
keep a replicated copy safe from deploys.
7. $cs_inputlimit (x:y) - for excessively long user input (excluding oob portion), the input will be truncated
by keeping the first x characters and the last y characters.
8: :alldict (fact)
Lists all words in dictionary, and if called with :alldict fact, lists the facts for which word is subject.
9. nofastload param
A full reload of ChatScript has been sped up. But if you suspect a bug in that code, a param of nofastload
will disable it to allow you to confirm
10: ^addword renamed ^addwordat
11: :allfacts all writes all facts, not just current bot facts
12. $cs_crashmsg - if set and system crashs and you dont have a crash topic, will display this message as output
Version 10.4 5/30/2020
1. MySQL now supported both as filesystem and for script access. BINARIES now has ChatscriptMysql.exe
See Esoteric-ChatScript/ChatScript-mysql manual.
^mysqlinit, ^mysqlclose, ^mysqlquery and command line parameter mysql=
2. !-word !!-word supported for backwords not
3. $$cs_badspell is set if NLP partially shut down after too many spelling mistakes (if you set $cs_badspellLimit )
4. ~replace_spelling instead of ~replace~ in ^testpattern call.
5. $cs_showtime if set will print to terminal time taken for volley
6: $cs_summary - shows ms spend in preparation vs rule process vs cleanup in current volley (to terminal)
7. %badspell - how many severe bad spellings happened in what size current sentence "15-40" means 15 in 40 word sentence.
8. :timelog shows size of largest message as well
9. replace: ?_da now also changes units even when no separation is needed because word follows number
e.g. replace: ?_km kilometer will change both 50km and 50 km to 50 kilometer
10. ^reportbug(text) puts text into LOGS/bugs.txt (std bug log) thus allowing scripts to message bugs
in addition to the engine's messaging.
11. $cs_outputlimit if set will generate a bug message if cs wants to output messaging larger than that
When recording cs output into a db, a field might be limited to 4K bytes and fail if message is bigger.
This will record the attempt as a bug so you can find out why your script did that.
12. $cs_sentences_limit, if set, will cause CS to not process remaining sentences above that limit in
a volley. Internal default was 50. Presumed that any user saying that much will not be well
handled by bot and not worth investment of further time by bot.
13. upgrades to engine manual documentation
Version 10.3 5/2/2020
1. :timelog now reports both engine NLU time and separately q wait time to get to engine (Linux)
2. canon: x y now supports 3rd argument MORE_FORM or MOST_FORM for marking adjectives and adverbs
3. German adverb/adjective MORE and MOST form flags now done by engine (when in german language mode)
4. ^spell now actually pays attention to its 2nd argument (factset id)
5. $cs_indentlevel controls indenting when tracing in ^testpattern.
6. $cs_tracetestoutput - set to 1 to force tracing in ^testoutput
7. updated to Duktape 2.5 Javascript embedded engine
8. cs_initmore.txt config file (if present) will load additional params and override cs_init.txt
and corresponding run time parameter config2= filename
9. cs_initenglish.txt (based on the current language being english - or can be any other language)
useful because foreign languages tend to require higher dictionary entry counts - reads AFTER cs_initmore
10. if language is set to "ideographic" then spellcheck is disabled and tokenization will be each character
is its own token (japanese, korean, chinese, etc)
11 %crosstalk1 - second communicator variable across users in engine
12. you can force a server to begin server logging w/o restarting it by creating top level file
serverlogging.txt with arbitrary content. remove file to restore prior state of server logging.
This is also done by :serverlog 1 and :serverlog 0 to force logging by script
13. documentation in Esoteric Chatscript - ChatScript Engine expanded
Version 10.2 4/19/2020
1. concept intersect now allows 3 in a row instead of just 2.
2. Practicum on spelling and interjections has additional writeup at end about handling marking
without changing a word permanently or dedicating a rule to performing marking.
3. Builtin support for emojis provided, words starting and ending in : will be in the concept
~emoji and are easy to pattern match, eg: in script have:
replace: 🤲 :palms_up_together:
replace: 😄 :grinning_face_with_smiling_eyes:
or add just the pairs to the implied replace: files in the substitution files in LIVEDATA
Thanks to Andy Heydon of Kore.AI for this.
4. BINARIES has a Mac compiled executable for 10.1+ version and NON-WINDOWS Non-C has
updated XCODE project (thanks Andy)
5. ^pos(grade $_word) shows the system's knowledge of grade word is learned in:
0 = kindergarten 2 = grades 1-2 4 = grades 3-4 6 = grades 5-6 8 = beyond grade 6
6. engine compile flag FNVHASH, when used, replaces hash algorithm DJB2 with FNV1a, which seems to have
fewer collisions with utf8 emoji characters (if you have a lot of them)
Version 10.1 3/29/2020
1. ^original(rawuser)
2. #! comment #! inside a pattern sent to compilepattern function
is %crosstalk documented?
3. ^addwordafter
4. ChatScript-ClientServer-Manual at end documents client commands.
5. CS Spellcheck can accept german nouns in lower case (singular or plural) and make them
upper case. Common pluralizations are handled that involve suffixes, but not yet ones that
change accent marks on vowels.
6. factset limit raised from 20 to 30, so @29 is legal.
7. ^addwordAfter(word _0) - inserts word into sentence after the position of given match variable.
_0 designates a position, and can be a match variable name or something that evaluates into a
word index. Does not alter pos-tagging or parsing and does not mark itself.
8: ^original(rawuser) returns exactly what user sent in, before any adjustments are made to it.
9. ^pos(xref wordindex kind)
This returns the index of the word in sentence cross-referenced by some parser data found
at the designated in wordindex. Kind includes: crossreference, indirectobject, object,
complement, phrase, verbal, clause. Returns 0 if no xref found.
10. Commandline paramenter debuglevel=n to enhance or reduce server log with more data.
11. Commandline paramenter buglog and nobuglog to enable or disable bug logging. Order dependent
with serverlog and noserverlog
12. %lastcurltime shows statistics on the last call to jsonopen
13. :labelremap for a topic builds an xref of internal tags to their labels (if they have one) into TMP/labels.txt
14. keyword concept intersection supported in patterns. E.g.
~animals~tasty will reference all animals considered tasty.
Version 10.0 1/26/2020
1. $$cs_tracepattern for returning trace from ^testpattern in addition to results.
2. $cs_addresponse holds name of ^fn(message ruletag) to tap CS user output queue
usage: 1. multiple reacts for different speech to text interpretations
2. detect already given answer and tell user: I already told you.
Version 9.8 11/10/2019
1. ^MemoryFree($data) - now takes optional argument whose data is to be available after freeing up everything. Can be string or can be JSON object (in which case a new transient json structure will be created to hold it).
2. :variables takes more arguments
3. You can call ^memorymark multiple times and free one by one
4. ^testpattern accepts trace field and ~replace~ concept to be equivalent to replace: in script
5. :clearlog to erase current user log file
6. ^trace() turns on all trace for the duration of this call, even if within ^notrace code
Version 9.7 8-31-2019
1. New manual Advanced Layers explains layering in cs and the boot layer.
2. Patterns are now allowed as concept members.
concept: ~leaving( sayonara "(going *~2 now)" exiting)
Version 9.62 8/18/2019
1. :listvariables
reports all references (set and get) of variables - see finalizing a bot manual
2. :build xxx quiet -- says nothing if compile works except done.
does not issue warning. If compile doesnt work, summarized the fails.
3. ^counttopics - new choices "responders" "availableresponders", renamed argument
"available" to "availablegambits" but system still accepts "available" to mean that
4. ^purgeboot(what) - what is either a factset id or a bot id.
All facts stored in the boot layer from that factset or owned by that botid are
erased from the boot layer. This enables one to revise facts in the boot layer by
removing old ones and making new ones with flag FACTBOOT
Version 9.61 7/28/2019
1. @retry in pattern allows pattern to self retry without output execution of
^retry(rule)
2. :regress batch
if your 1st argument to :regress is "batch", then CS will quit with return
code 0 when it passes or return code 1 when fail. Good for batch file autotesting.
3. ^delete now allows 2nd argument BOOT to authorize killing system facts
4 ^setFactOwner(fact idbits)
Changes ownership bits on a fact.
5 1st argument to ^format deprecated. No longer need to say INTEGER or FLOAT
6 ^csboot allowed to be multiply defined without error message
because Multibot deploys
Version 9.6 7/14/2019
1. unmark(@ _0) changed to unmark the width of the match, not just the start position
2. JSONLOOP (x y z OLD/NEW)
choose which way to walk a json object/array either newest first or oldest first
3. TAB macro flag
Be able to treat table data using tabs to mean * for that tab
4. ^bug()
be able to report a bug to system bug log (or script compiler) for runtime code (particularly in a table being compiled)
5. %tableinput - current input line to table processing
6. ^mark(word _0 ALL/ONE) when marking, either propogate marks to all encompassing concept sets or just mark this one word
Version 9.5 6/26/2019
1. Testoutput now returns field error: true if code execution failed.
2. you can force ^testpattern to trace user regardless of whether tracing is on or not or whether nouserlog is set. Just prepend to your input ":tracepattern"
3. unmark(@ _0) unmark everything starting there (but only at that 1 start spot, not range implied. This include sthe concepts and topics list and marks themslelf.s
4. Serious bug fixed if you have topics in both level 0 and level 1. CS shipping of level 0 does not have topics so almost no one noticed this bug til now.
Version 9.41 - EMERGENCY RELEASE 6/4/2019
9.4 has a bug wherein it inadvertently writes logging data to the user log file while processing
json parse data. This can blow out disk space in a heavily used server. This has been fixed.
Other changes:
1. ~filename - words with file suffixes
2. crashpath= names where to write about fatal signal handers in linux... writing in the cs directory might be erased by an auto redeploy
3 %zulutime adds elapsed time at end
4. ^jsonloop($jsonstruct $var1 $var2)
similar to loop but runs thru json members and is the most
efficient and compact way to do so
version - 9.4 5/27/2019
1. You can treat a json object as an array of fields.
$data = ^jsoncreate(transient object)
$data.tablet.testit = 1
$cx = 0
$_field $data.tablet[$cx]
returns field name of object after which you can do
$data.tablet.$_field to get the value
2. $data.something[-1] is the opposite end from [0], applies to object or arrays
For arrays it's the highest index value. For objects its the first field name.
3. ^pos(preexists word) -- was word in dictionary BEFORE this volley?
4. to use a variable name AS a field name, escape it
$data.\$varname = hello uses $varname as field name and not indirecting via $varname
5. full := assign in pattern
6. data format for testpattern simplified, now patterns is array of strings not array of objects
7. Rule-based spellchecking added to spelling practicum
8. ^changebot(botname botid) change identity on the fly, allowing this bot to see facts, functions,
and topics of botname instead of itself.
9. updated documentation to note that RESPONSE_NOCONVERTSPECIAL on $cs_ response is default.
version 9.31 4/30/2019
0. pattern assignment now allowed with system variables also (_0:=%time)
1. changes to the ^testoutput function. it does NOT erase its changes. It may return null
for variable assignments. It will return a text string representing the json data if
a returned variable is a json structure name.
2. for both ^testinput and ^testoutput, if the value of an incoming variable looks like
a json structure, it will be converted into the std internal json data structure and
the variable set to its json name.
3. ^testpattern matchvar returns the original text, not the canonical
version 9.3 4/26/2019
0. new practicum document: Practicum-Concepts-and_meaning
1. %factexhaustion , which can take assignment to false to turn off the flag
2. assignment in patterns _0:= var or matchvar or 'matchvar- eg
3. ^compilepattern
4. ^testpattern
5. ^compileoutput
6. ^testoutput
The above 4 functions allow you to synthesize a rule from its component parts. This allows some other dialog system to use CS capabilities as an external API (e.g. web-based scriptwriting). It also means you can store compiled patterns and outputs in a database and mix and match rules in synthetic topics on the fly. #2 supports ^testpattern by allowing a pattern to glean data and return values.
version 9.2 3/24/2019
1. replace: blackdecker \BLACK+DECKER now allowed to prevent +
from interpreting to space
2. ChatScript Advanced Manual has been split so that main areas of cs like concepts, topics, etc
have their own advanced manuals and the Advanced manual itself is just a grab-bag of unique
capabilities
3. ^pos(ismixedcase $_word) returns 1 if word is has both
upper and lowercase letters. Fails otherwise.
4. $cs_json_array_defaults
Normal syntax: $data.array[] = data1
This will store data1 non-uniquely (you can get repeats).
You can use ^jsonarrayinsert(UNIQUE $data.array data1) to
avoid this, but its clumsy. So now you can define for your
bot $cs_json_array_defaults = #JSON_ARRAY_UNIQUE to default
all such assigns to be unique unless specified otherwise
5. %serverlogfolder %userlogfolder %tmpfolder give the current
paths to those folders
version 9.12 2/20/2019
1. bug fixes
version 9.11 2/13/2019
1. bug fixes
version 9.1 2/12/2019
1. restored USER_FLAG4 for facts
2. command line parameter "trustpos" allows things like
concept: ~all(feel~n)
to work. By default we dont trust pos-tagger and CS will tolerate
all forms.
3. ^responsepattern(responseid)
part of the ^response.. world, returns the pattern that matched inside []
of rule generating output (if it is matched that way)
For a rule like:
u: ([ (pattern 1) (pattern 2) ([try 3])])
It will tell you which piece of the pattern matched.
Handy for debugging why a pattern matches incorrectly w/o
having to read a trace log and analyzing each + and -.
4: replace: 'xxx yyy
allows you to split during tokenization any word followed by 'xxx into two words,
original sans 'xxx and yyy. eg
replace: 've have
gives "companies've => "companies have"
version 9.0 1/1/2019
1. param inputlimit=n truncates user input to this size.
On a server, users have a default limit of 80K per volley
but malicious users abuse this. You can set this to explicitly limit
how much input users can actually provide. Consequences of excess
input are, for example, sluggish performance because it may try to spell correct junk input.
2. ^eval1(arg)
like ^eval(x) but evaluates its argument before passing into ^eval.
3. mark ~PASSIVE_VERB on such.
4. !~set in concept declaration - see advanced concepts: exclusion.
e.g., concept: ~wildanimals (!~pet_animals ~animals)
5. "fundamental meanings" can now be used as keywords in concepts, topics, and patterns.
see advanced cs: advanced concepts: fundamental meaning (quoted below)
Fundamental meaning consists of an actor, an action, and an optional actee.
In the active voice sentence "I love you", the actor is "I", the action is "love",
and the actee is "you". In the passive voice sentence "I was arrested", there is no actor,
the verb is "arrested", and the actee is "I". Wherease in the passive voice sentence
"I was arrested by the police", the actor is "police".
Fundamental meaning patterns always have a verb, which as a keyword is designated as
"|arrest|" or whatever word or concept you want to detect.
A pattern which includes a fundamental actor is shown as
"~pronoun|arrest|". One that includes an actee is
"|arrest|~police", whereas one that has both actor and actee is
"~pronoun|arrest|~police".
Version 8.8 11/26/2018
1. ^spellcheck(input dictionary)
input is tokenized words separated by spaces
dictionary is json array of words
It outputs the input words adjusted by any spelling correction.
Useful if you read dynamic menus from an API endpoint and then want
to match user input against that menu, whose elements may not be
in the main CS dictionary
2. Interjections from LIVEDATA now also mark their words as a normal
concept set entries, so you can suppress changing the words to an
interjection and yet still match on the interjection concept. This
make writing scripts for interjections significantly easier. See new
document below.
3. new document Practicum- spelling and interjections
4. you cannot use { or ( immediately after a bidirectional wildcard
and *~0b is now legal
Version 8.7 11/11/2018
1. $cs_userfactlimit = * means keep all facts
2. documented #SPLIT_QUOTE tokencontrol (removes double quotes from input)
3. ^stats(TEXT) bytes of heap left, ^stats(DICT) dictionary entries left
4. ^jsontext(FactId) adds quotes if object of fact is a json text
FAILS if not a json fact. CS represents json text as ordinary
unquoted text, but text that looks like float numbers would be
subject to possible float truncations or expansion of digits.
5. ^replaceword(word location) arguments are like ^mark and ^unmark, except this changes the
actual original word at the position (which is just 1 word of the sentence). This changes no concept
markings (which you can do yourself with mark and unmark). With this, for example, you could unrevise a spellfix
like this:
u: (_~emosad) $_tmp = ^original(_0) ^replaceword($_tmp _0)
6. Parameter: repeatLimit=n
Servers are subject to malicious inputs, often generated as repeated words over and over.
This detects repeated input and if the number of sequential repeats is non-zero and equal or
greater to this parameter, such inputs will be truncated to just the initial repeats. All
other input in this volley will be discarded.
Version 8.6 10/4/2018
1. configurl=http://xxx as a command line or config file parameter allows you to
request additional parameters from a url. This would be important if for security reasons
you didn't want some parameters visible in a text file or on the run command of CS.
2. Normally facts created by user script only impact that user (saved in their topic file).
Now you can create facts that can affect all users. Maybe you want to write a bot that
learns from users like Microsoft's Tay did.
a) (secondary) When you modify some pre-user fact (layer 0, layer 1, boot layer) the change
will move into the boot layer and thereafter be visible to all users.
b) (primary) When you create JSON data in a special way, it will migrate to the boot layer at the
end of the user's turn and not be saved in the user topic file. To do this,
merely use BOOT instead of PERMANENT or TRANSIENT on the initial args to a
json structure creator, eg ^jsoncreate(BOOT OBJECT).
Facts moved to boot will be lost if the server restarts or you call the boot
function. A command line argument of "recordboot" will direct CS to write the
these facts into a top level file "bootfacts.txt" as they are migrated to boot. You would be responsible
for writing a boot function that reads it on execution to recover these facts on startup. Direct modification of
system facts in (a) are not saved. You would have to write your own scripts to track
those changes.
There is no way of collecting garbage from abandoned pre-user data, so do the
above too often and the server may run out of memory and die.
3. ^stats(FACTS) returns how many free facts are left.
Version 8.5 8/23/2018
1. ^walktopics('^func) finds the topics current bot can access
and calls ^func with topic name, iteratively.
2. ^walkvariables('^func)
3. ^reset(VARIABLES) - sets all global user variables to NULL
4. ^reset(FACTS) - kills all permanent user facts
5. ^reset(HISTORY) forget what was said previously
6. not new but now documented %input = n sets that system variable
Other system variables can be set as well, sometimes locking them
into that value until you do %xxx = .
7. indirect function call ^$_xx() if $_xx holds a function name
version 8.4 8/12/2018
1. ^findrule(label) finds a rule with that label (not tag) anywhere in all topics
and returns the tag for it (presumes unique label)
2. in filesxxx build file, if you name a directory with two tailing slashes,
then the system will compile all files recursively within and below that folder.
3. $cs_responseControl RESPONSE_NOFACTUALIZE to suppress fact creation of bots output
4. script compiler directive ignorespell: to block some kinds of spelling warnings
ignorespell: word1 word2 ... (use lower case form of word, will not warn about upper and lower case mixtures)
ignorespell: * turn off all spelling warnings on casing
ignorespell: !* turn on all spell warnings on casing
version 8.31 6/18/2018
1. ^readfile(line filename 'function) will read lines from the file and pass them untouched
as the sole argument of function. This is formerly called: ^jsonreadcvs which is legal but
deprecated.
2. max match variable is now _30 instead of _20
version 8.3 6/9/2018
1. new manual Practicum - Messaging
2. loop now allows function call as argument: loop( ^length(@0)) {...}
3. new manual Practicum-ControlFlow
4. may now use match variables and quoted match variables in json indirections:
$_x[_5] = 4
$_x._5 = 5
$_x['_5) = 5
$_x.'_5 = 5
$_tmp = $_x._5
etc
5. :allmembers ~concept ~nonconcept ~nonconcept dumps the members of ~concept into TMP/tmp.txt, one per line,
but excludes any that are member of the ~nonconcept sets.
6. command line param "authorize" allows all server users to use : commands, regardless of authorized.txt.
7. new manual Practicum - Gleaning
version 8.2 4/1/2018
1. debugger has autosizing to your screen and save/restore for size/location adjustments you make
2. ^query(exact_svrange x y ? -1 ? ? lowvalue highvalue) Finds facts whose object is x<=object<=y numeric
3. ^query(exact_vrange ? y ? -1 ? ? lowvalue highvalue) see Predefined queries section in Facts Manual
version 8.1 2-18-2018
1.CS Debugger now has been released in Release mode, so maybe it works for you, and has new features-- read the manual again.
2. new manuals: Practicum- Rejoinders and Practicum- Patterns
3. $cs_sequence wins over default sequence limit of 5 words in a row
4. !<< >> is now legal
version 8.0 1/31/2018
1. files to compile by script compiler must now end with suffix .top or .tbl so you can
allow other files in same directories (like readme.txt, etc).
2. :timelog computes avg/min/max of a server log response times
3. for json arrays can now do: $_array1 += $_array2 and $_array1 += value
4. Windows GUI debugger for CS. See ChatScript debugger manual.
version 7.73 12/7/2017
1. several fixes to pattern matcher
version 7.72 IMPORTANT FIX FOR BUG INTRODUCTION IN 7.6 -- KNOWLEDGE of adverbs in dictionary lost
1. param traceuser=username to make a server trace that user only
version 7.71 11/29/2017
1. :spellit some sentence, tells you what spellcheck found to modify it
version 7.7 11/19/2017
1. DLL version of ChatScript now part of std release (untested)
2. $cs_outputchoice to force random output choice
3. :trace treetagger
4. Spellcheck will fix words with excessive repeated letters will be adjust. 3 or more in a row truncated to 2. If not recognized, each single pair of