You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to writers not being able to get used to using lowercase for words like "I"
and triggers failing unless it's all lowercase,
add a startup option like
forcecase: true
similar to the utf8: true flag.
@dcsan: not sure where you last talked about this, but a solution to your problem with authors putting a capital "I" in triggers could be to just pre-process the scripts using sed or a perl one-liner (I'm more familiar with the latter) so here's an example:
% cat test.rive
+ do you know who I am
- You are <get name>.
+ i am called *
- <set name=<formal>>Nice to meet you, <get name>.
> topic test
+ another I trigger
- Indented.
< topic
% perl -pi -e 's/^(\s*)\+(.+)$/\1+\L\2\E/g' test.rive
% cat test.rive
+ do you know who i am
- You are <get name>.
+ i am called *
- <set name=<formal>>Nice to meet you, <get name>.
> topic test
+ another i trigger
- Indented.
< topic
[4:28]
the relevant bit being: perl -pi -e 's/^(\s*)\+(.+)$/\1+\L\2\E/g' test.rive
[4:29]
it matches zero+ spaces before a "+" and all the remaining text, and outputs the same number of space, the "+", and the lowercased version of the remainder
dcsan [4:53 PM]
thanks. i've mentioned it a few times, most recently in a ticket. it's a headache i deal with every day as our writers can never get used to lowercase "I" or non-capitals. they are writers after all.
[4:53]
i guess we could do a regex somewhere ideally inside Rivescript itself. (edited)
[4:54]
maybe if there was some way to pass that as an option like the utf8: true
kirsle [4:54 PM]
it'd be a pretty short fix (maybe 3 lines of code) to make it an option like that
dcsan [4:54 PM]
i can't recall why it is rive requires this, yet doesn't enforce it. something about utf8 characters?
[4:55]
if you can give me a pointer i can look at a PR
new messages
kirsle [4:55 PM]
something like that. also some of its AIML inspiration showing through, but in AIML the patterns are mandatory uppercase instead of lowercase
[4:55]
so you'd probably change the constructor in rivescript.coffee to accept/store the option, possibly pass it as an option to parser.coffee too, and then in parser.coffee when it handles the + command it can check that option and run it through a .toLowerCase()
I did notice the forceCase option but I guess it's affecting something else. All my inputs are forced to lowerCase by default according to the line showed in #245 and I do not want that because one of the arguments for my JS repl macro is Math.sin() and the likes which always get turned into math.sin() that gives an error
Due to writers not being able to get used to using lowercase for words like "I"
and triggers failing unless it's all lowercase,
add a startup option like
forcecase: true
similar to the
utf8: true
flag.@dcsan: not sure where you last talked about this, but a solution to your problem with authors putting a capital "I" in triggers could be to just pre-process the scripts using sed or a perl one-liner (I'm more familiar with the latter) so here's an example:
[4:28]
the relevant bit being:
perl -pi -e 's/^(\s*)\+(.+)$/\1+\L\2\E/g' test.rive
[4:29]
it matches zero+ spaces before a "+" and all the remaining text, and outputs the same number of space, the "+", and the lowercased version of the remainder
dcsan [4:53 PM]
thanks. i've mentioned it a few times, most recently in a ticket. it's a headache i deal with every day as our writers can never get used to lowercase "I" or non-capitals. they are writers after all.
[4:53]
i guess we could do a regex somewhere ideally inside Rivescript itself. (edited)
[4:54]
maybe if there was some way to pass that as an option like the
utf8: true
kirsle [4:54 PM]
it'd be a pretty short fix (maybe 3 lines of code) to make it an option like that
dcsan [4:54 PM]
i can't recall why it is rive requires this, yet doesn't enforce it. something about utf8 characters?
[4:55]
if you can give me a pointer i can look at a PR
new messages
kirsle [4:55 PM]
something like that. also some of its AIML inspiration showing through, but in AIML the patterns are mandatory uppercase instead of lowercase
[4:55]
so you'd probably change the constructor in rivescript.coffee to accept/store the option, possibly pass it as an option to parser.coffee too, and then in parser.coffee when it handles the + command it can check that option and run it through a .toLowerCase()
related to:
#140
The text was updated successfully, but these errors were encountered: