AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

^rhyme is returning a number, not a word
 
 

I’m new to ChatScript, so this is really unlikely to be a bug. I’m using ChatScript 6.6 on Linux (LinuxMint), and also had a similar problem in 6.5b.

I’m trying to do a simple rhyme just to play with the functions in ChatScript, and so I’ve got code that looks like this:

topic: ~cruddy []

$b 
= ^rhyme(boat)
t$b rhymes with boat

I’m forcing it to rhyme with boat because, well, there are a lot of words that do that, and I’ve got a version of this working fine that accepts user input.

However, when I try to run this, I get a response like,

216,075 rhymes with boat.

When I trace, I get output that looks like this:

System call ^rhyme( (boat), ) = create (1 word bloat x1000010Created 216020
............[lots more matches]
............create 1 word uncoat x1000010 Created 216075
............NOPROBLEM (^rhyme) =>
............
$b = ^rhyme(216075

I get why nothing rhymes with 216075, but why is it changing the word ‘boat’ to this number (which seems like a location, but maybe it’s a fact)? And how do I get the bot to display what I actually want it to display, which is a word that rhymes with boat?

Thanks!

 

 
  [ # 1 ]

topic: ~cruddy []

$b = ^rhyme(boat)
t: $b rhymes with boat.

Is not legal chatscript because $b= is not a rule.
Try
t: $b = ^rhyme(boat) $b rhymes with boat.

HOWEVER, ^rhyme returns facts (whose object is the rhyming word) so you need to do
t: @0 = ^rhyme(boat) @0object rhymes with boat.

 

 
  [ # 2 ]

Thank you Bruce! That works, and helps me understand how to work with facts much better!

 

 
  login or register to react