|
-
Jun 30th, 2006, 11:22 PM
#1
Thread Starter
Member
String formatting in VB6-- Look Please
I have some code that can reads text from a FAQ webpage and stores the sentences in an array. I need to group the Q/A pairs somehow. They will then all be written to a *.aiml output file in the format below
<aiml>
<category>
<pattern>WHAT ARE YOU</pattern>
<template>
I am the latest result in artificial intelligence,
which can reproduce the capabilities of the human brain
with greater speed and accuracy.
</template>
</category>
.
.
.
<aiml>
see -- http://www.alicebot.org/aiml.html
Any suggestions are appreciated? Thanks
-
Jul 7th, 2006, 12:09 AM
#2
Hyperactive Member
Re: String formatting in VB6-- Look Please
A simple array is probably not the go. You have several other options though. A two dimension array where Array(i, 0) is the question and Array(i, 1) is one solution.
A better solution is to declare a class that contains properties for both question and answer and add an instance of this class for each Q/A pair to the array.
Still better is to add these instances to a collection. This will give you the ability to you the For Each statement if you set it up right, and the ability to add an ID key and retrieve Q/A pairs based on that ID.
Sounds like you have some more research to do. I can give you some more pointers on how to structure this if you would like.
FW
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|