Skip Menu |

This queue is for tickets about the RiveScript CPAN distribution.

Report information
The Basics
Id: 93492
Status: open
Priority: 0/
Queue: RiveScript

People
Owner: Nobody in particular
Requestors: martin.gieretz [...] web.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: {formal} or <get> bug ?
Date: Mon, 03 Mar 2014 19:52:38 +0100
To: bug-RiveScript [...] rt.cpan.org
From: Martin Gieretz <martin.gieretz [...] web.de>
is this the correct behavior of the {formal} or <get> tag: if there is an <get> inside a {formal}, the <get> seems not working example: + tell me my name - you are <get name> - {formal} greetings, <get name>{/formal} results in: you are martin or Greetings, undefined can pleas check this? bye Martin
This happens because of the order in which tags are processed. Ideally, they'd be processed from left-to-right in the reply but I haven't come up with a very elegant way of doing this (if you have any ideas, let me know). So instead, it does full regexp search-and-replace operations for all the tags in a certain order. The relevant tags/orders are: 1. <bot *=*>, <env *=*> 2. <bot>, <env> 3. {formal}/{person}/{uppercase}/{lowercase} 4. <set> 5. <add>/<sub>/<mult>/<div> 6. <get> It happens this way so that things like this work: - <set name=<bot name>> - <set name={formal}<star2>{/formal}> - <set name=<formal>>Hello, <get name>! But as a consequence, {formal}<get>{/formal} doesn't work, and neither does <set copy=<get original>>, etc. On Mon Mar 03 13:52:47 2014, mgieretz wrote: Show quoted text
> is this the correct behavior of the {formal} or <get> tag: > if there is an <get> inside a {formal}, the <get> seems not working > > example: > + tell me my name > - you are <get name> > - {formal} greetings, <get name>{/formal} > > results in: > you are martin > or > Greetings, undefined > > can pleas check this? > > bye > Martin >
Subject: Re: [rt.cpan.org #93492] {formal} or <get> bug ?
Date: Tue, 04 Mar 2014 18:12:30 +0100
To: bug-RiveScript [...] rt.cpan.org
From: Martin Gieretz <martin.gieretz [...] web.de>
Am 04.03.2014 00:08, schrieb Casey Kirsle via RT: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=93492 > > > This happens because of the order in which tags are processed. Ideally, they'd be processed from left-to-right in the reply but I haven't come up with a very elegant way of doing this (if you have any ideas, let me know). So instead, it does full regexp search-and-replace operations for all the tags in a certain order. > > The relevant tags/orders are: > > 1. <bot *=*>, <env *=*> > 2. <bot>, <env> > 3. {formal}/{person}/{uppercase}/{lowercase} > 4. <set> > 5. <add>/<sub>/<mult>/<div> > 6. <get> > > It happens this way so that things like this work: > > - <set name=<bot name>> > - <set name={formal}<star2>{/formal}> > - <set name=<formal>>Hello, <get name>! > > But as a consequence, {formal}<get>{/formal} doesn't work, and neither does <set copy=<get original>>, etc. > >
Hi thx for the prompt reply ;-) First let my say, i'm very new to RiveScript - just playing around for a few days... i could make a workaround - i simple put the "<get..." processing *before* the "{formal..." tags of course the problem with '<get>' and '<set>' in the same reply persist; a second workaround (a object macro wich does a get user var) fixed that. as for now, everthing works as expected - lets see when the next problem arises ;-) btw: great work, your Rivescript implementation, espacially the rivescript application with tcp/json just what is needed in a web environment bye M