Dołącz do BOT Libre projekt open source na BotLibre.org
Bot Libre Forum

how would i change fronm is to are

w bobred wysłany Jul 13 2018, 10:35

how would I change from is to are.if I say like apples instead of I like apple.using map to the map the foods in aiml.

here is my aiml script respond,question and learn.txt


by admin posted Jul 16 2018, 9:18
Not sure I understand. To change "is" to "are" change the "is" in the pattern to "are", or add a new pattern with "are".

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 2066, today: 0, week: 6, month: 41

by bobred posted Jul 16 2018, 12:34

 

if the person says I like apples.i would want the response to be what are apples?if the person says I like apple.i would want the response to be what is apple?

how would I use either is for a singular noun or are for a plural noun in the template?


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 2140, today: 0, week: 4, month: 49

by admin posted Jul 16 2018, 16:21
You cannot do that in AIML, but you could in a Self tag.
Something like:
<category>
<pattern>i like *</pattern>
<template>what <self>if (star.endsWith("s")) { "are"; } else { "is"; }</self> <star/>.
</template>

If your bot has Wiktionary enabled, you could also do more advanced things checking the word's #cardinality.

Note that "I like apple" is not valid grammar. "I like apples" would be correct.
For a singular you would use "I like the apple", in which case you can check for "the" in a pattern.
Trying to parse English or natural language in general is very advanced, there is an example in the Understanding Self script.
But you would need to understand programming for this.
Updated: Jul 17 2018, 9:33
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 2107, today: 0, week: 3, month: 46

by bobred posted Jul 17 2018, 10:19

sometimes people do not use good English.They may type it that way or do that on purpose to test how advanced the chatbot is.

there is a error on this blog page when you first enter it.I enter the blog page from somewhere else and it worked.that needs to be fixed. 


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 2134, today: 0, week: 4, month: 42

by bobred posted Jul 18 2018, 7:46

what if it asked what type of fruit juice do you like?you could say for a response I like apple.wouldn't that confuse it if i did not use a code like the aiml code you posted?


Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 2201, today: 0, week: 3, month: 56

by admin posted Jul 18 2018, 10:54
I suppose the grammar would be correct in that instance.
So you could check for plural.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 2125, today: 0, week: 3, month: 50

Identyfikator: 22796953
Tagi: aiml
Wysłany: Jul 13 2018, 10:35
Odpowiedzi: 6
Widok: 2970, dziś: 1, tydzień: 6, miesiąc: 105
0 0 0.0/5