Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lowercase not work for variable #48

Open
UshakovVasilii opened this issue May 31, 2017 · 1 comment
Open

lowercase not work for variable #48

UshakovVasilii opened this issue May 31, 2017 · 1 comment
Assignees

Comments

@UshakovVasilii
Copy link

    RiveScript rs = new RiveScript();
    rs.stream(new String[] { //
        "! version = 2.0", //
        "+ a", //
        "- {lowercase}A{/lowercase}", //
        "+ b", //
        "- {lowercase}<get v>{/lowercase}"});
    rs.sortReplies();
    rs.setUservar("test", "v", "B");
    System.out.println(rs.reply("test", "a"));
    System.out.println(rs.reply("test", "b"));

output is:

a
B

It reproduced on 0.8.* and 0.9.* versions

@marceloverdijk marceloverdijk self-assigned this May 31, 2017
@marceloverdijk marceloverdijk added this to the 0.10.0 milestone May 31, 2017
@marceloverdijk
Copy link
Member

This is indeed an issue with current implementations of RiveScript (Java, JS, Go, ..).
The tag ordering, or better the ordering of processing the tags, has been picked carefully to support the common use cases. Processing the lowercase, formal etc formatting tags is done early, also to support e.g. <set name=<formal>>.

It would be better that RiveScript would parse/tokenize the whole message string so we are not dependent on the ordering, but this might be a quite big job to do.

In the short term I don't see this implemented to be honest (also mainly to keep consistence between the various RiveScript impls). However I will start look at e.g. ANTLR so we can make an actual grammar/lexer for RiveScript.

@marceloverdijk marceloverdijk removed this from the 0.10.0 milestone Aug 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants