-
Notifications
You must be signed in to change notification settings - Fork 135
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
Bug: <set> tag in <pattern> is deleting the multi-word input #274
Comments
I have the same problem, it seems to be a bug. I have narrowed it down to these two patterns:
The set question_starter contains the phrase 'show me', and when entering the query 'show me this', the reply is: where the 'show' has been removed. The log looks like this:
|
Yeah looks like a bug in the multi word pattern parser. I’ll take a look this week and get a fix pushed when I get time
K
…Sent from my iPhone
On 18 Oct 2020, at 17:12, EdvinJakobsson ***@***.***> wrote:
I have the same problem, it seems to be a bug.
I have narrowed it down to these two patterns:
<category>
<pattern>* THIS</pattern>
<template>
found THIS! star 1: <star index="1"/>
</template>
</category>
<category>
<pattern><set name="question_starter"/></pattern>
<template>
doesnt matter
</template>
</category>
The set question_starter contains the phrase 'show me', and when entering the query 'show me this', the reply is:
'Found THIS! star 1: me.'
where the 'show' has been removed. The log looks like this:
2020-10-18 16:06:27,559 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Question (flask): show me this 2020-10-18 16:06:27,559 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Pre Processed (3a91c0c2-8a0a-41dd-972b-06f30b03cf9f): show me this 2020-10-18 16:06:27,559 root INFO [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Creating new conversation for client 3a91c0c2-8a0a-41dd-972b-06f30b03cf9f 2020-10-18 16:06:27,559 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Event triggered [CONVERSATION_START] 2020-10-18 16:06:27,559 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Retrieving conversation for client 3a91c0c2-8a0a-41dd-972b-06f30b03cf9f 2020-10-18 16:06:27,559 root INFO [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Topic pattern = [*] 2020-10-18 16:06:27,560 root INFO [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No That pattern default to [*] 2020-10-18 16:06:27,560 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - AIML Parser matching sentence [show me this], topic=[*], that=[*] 2020-10-18 16:06:27,560 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Matching [show me this __TOPIC__ * __THAT__ *] 2020-10-18 16:06:27,560 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Wildcard _ matched show 2020-10-18 16:06:27,560 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Topic NOT matched me 2020-10-18 16:06:27,560 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No children, consume words until next break point 2020-10-18 16:06:27,560 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Topic NOT matched me 2020-10-18 16:06:27,560 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No match for me, trying another path 2020-10-18 16:06:27,560 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Wildcard _ matched me 2020-10-18 16:06:27,560 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Topic NOT matched this 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No match for this, trying another path 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Wildcard _ matched this 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Topic matched __TOPIC__ 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Wildcard * matched * 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - That matched __THAT__ 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No match for *, trying another path 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No children, consume words until next break point 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - That matched __THAT__ 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No match for *, trying another path 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Looking for a __THAT__, none give, no match found! 2020-10-18 16:06:27,561 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Found a that at the wrong place.... 2020-10-18 16:06:27,562 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No match for *, trying another path 2020-10-18 16:06:27,562 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Looking for a __TOPIC__, none give, no match found! 2020-10-18 16:06:27,562 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Found a topic at the wrong place.... 2020-10-18 16:06:27,562 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Found word [show] in set [QUESTION_STARTER] 2020-10-18 16:06:27,562 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Word matched show me 2020-10-18 16:06:27,562 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Topic NOT matched this 2020-10-18 16:06:27,562 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No match for this, trying another path 2020-10-18 16:06:27,562 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Wildcard ^ matched me 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No match for this, trying another path 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Wildcard ^ matched this 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No match for __TOPIC__, trying another path 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No children, consume words until next break point 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No match for __TOPIC__, trying another path 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Found a topic at the wrong place.... 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Wildcard * matched me 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Topic NOT matched this 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Wildcard child matched this 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Topic matched __TOPIC__ 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Wildcard * matched * 2020-10-18 16:06:27,563 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - That matched __THAT__ 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Wildcard * matched * 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - No more words 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Found a template, success! 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Matched 1 or more star, success! 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Matched that, success! 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Matched 1 or more star, success! 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Matched topic, success! 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Matched 1 or more star, success! 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Matches... 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - 1: Match=(Word) Node=(ONEORMORE [*]) Matched=(me) 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - 2: Match=(Word) Node=(WORD [THIS]) Matched=(this) 2020-10-18 16:06:27,564 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - 3: Match=(Topic) Node=(ONEORMORE [*]) Matched=(*) 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - 4: Match=(That) Node=(ONEORMORE [*]) Matched=(*) 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Match score 50.00 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - AIML Parser evaluating template [PTEMPLATE [*] [P(0)^(0)#(0)C(0)_(0)*(0)To(0)Th(0)Te(1)]] 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - [[WORD]found] resolved to [found] 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - [[WORD]THIS!] resolved to [THIS!] 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - [[WORD]star] resolved to [star] 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - [[WORD]1:] resolved to [1:] 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Retrieving conversation for client 3a91c0c2-8a0a-41dd-972b-06f30b03cf9f 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - [[WORD]1] resolved to [1] 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Star Node [[STAR[WORD]1]] resolved to [me] 2020-10-18 16:06:27,565 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - [[STAR[WORD]1]] resolved to [me] 2020-10-18 16:06:27,566 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - [[NODE]] resolved to [found THIS! star 1: me] 2020-10-18 16:06:27,566 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Raw Response (3a91c0c2-8a0a-41dd-972b-06f30b03cf9f): found THIS! star 1: me 2020-10-18 16:06:27,566 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Processed Response (3a91c0c2-8a0a-41dd-972b-06f30b03cf9f): found THIS! star 1: me 2020-10-18 16:06:27,566 root DEBUG Directory does not exist, creating ../../storage/conversations 2020-10-18 16:06:27,566 root DEBUG Writing conversation to [../../storage/conversations/flask_3a91c0c2-8a0a-41dd-972b-06f30b03cf9f.conv] 2020-10-18 16:06:27,566 root DEBUG [flask] [bot] [brain] [3a91c0c2-8a0a-41dd-972b-06f30b03cf9f] - Event triggered [QUESTION_ASKED] 2020-10-18 16:06:27,567 root DEBUG [flask] - {'response': {'query': 'show me this', 'userId': '3a91c0c2-8a0a-41dd-972b-06f30b03cf9f', 'timestamp': 1603037187.567025, 'text': 'Found THIS! star 1: me.'}, 'status': {'code': 200, 'message': 'success'}, 'meta': {'botName': 'Program-y', 'version': '1.0.0', 'copyright': 'Copyright 2016-2019 keithsterling.com', 'authors': ['Keith Sterling']}}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
Given the following AIML:
and
place.txt
as below, where entries with multiple words exist:By entering the query below:
It should output
Current Behavior
By entering the query below:
The program outputs:
note that the 'Rio de' is deleted for some reason. (Also reproducible with 'New York')
When the input does not match the first pattern, the system works perfectly, for example:
Steps to Reproduce
Context (Environment)
The text was updated successfully, but these errors were encountered: