26
26
27
27
28
28
; Changes by Rainer Joswig, [email protected] , 2012:
29
- ; fixed: dprox-plan1, ptrans only if the actor knows the new loc
29
+ ; fixed: dprox-plan1, ptrans only if the actor knows the new loc
30
+ ; hacked: Output sentence starts with an uppercase letter and then lowercase letters follow.
30
31
; Changes by Rainer Joswig, [email protected] , 2008:
31
- ; fixed: persuade and not peruade
32
- ; fixed: three args to persuade
33
- ; fixed: changed implementation of PCVar from Structure to Symbol (symbol with leading ?)
34
- ; fixed: correct spaces in output
35
- ; fixed: put symbols instead of functions, makes tracing easier
32
+ ; fixed: persuade and not peruade
33
+ ; fixed: three args to persuade
34
+ ; fixed: changed implementation of PCVar from Structure to Symbol (symbol with leading ?)
35
+ ; fixed: correct spaces in output
36
+ ; fixed: put symbols instead of functions, makes tracing easier
36
37
37
38
38
39
; Standard definition of put.
@@ -138,7 +139,7 @@ the other person."
138
139
(and (doit (propel ' ,actor ' hand ' ,agent))
139
140
(is-true ' ,action)))))
140
141
141
- (defvar *default-tense* ' past
142
+ (defvar *default-tense* ' past ; or present
142
143
" Set the storytelling in the past tense." )
143
144
144
145
; micro-talespin-demo variables for sample stories
@@ -1023,6 +1024,12 @@ then he's in a loop and has failed. Otherwise, set up the goal and go."
1023
1024
cd
1024
1025
(cdpath (cdr rolelist) (filler-role (car rolelist) cd))))
1025
1026
1027
+ ; each string should start with a capital letter and then be lower case.
1028
+ (defun beautify-string (string )
1029
+ (when (plusp (length string ))
1030
+ (nstring-downcase string )
1031
+ (setf (aref string 0 ) (char-upcase (aref string 0 ))))
1032
+ string )
1026
1033
1027
1034
; micro-mumble: micro English generator
1028
1035
@@ -1036,11 +1043,14 @@ then he's in a loop and has failed. Otherwise, set up the goal and go."
1036
1043
cd)))
1037
1044
(flet ((say-it ()
1038
1045
(format t " ~% " )
1039
- (say1 cd-to-be-said
1040
- (or (cdpath ' (time ) cd-to-be-said)
1041
- *default-tense* )
1042
- nil
1043
- t )
1046
+ (write-string
1047
+ (beautify-string
1048
+ (with-output-to-string (*standard-output* )
1049
+ (say1 cd-to-be-said
1050
+ (or (cdpath ' (time ) cd-to-be-said)
1051
+ *default-tense* )
1052
+ nil
1053
+ t ))))
1044
1054
(format t " ." )))
1045
1055
(say-it))
1046
1056
cd))
0 commit comments