Author Topic: function ReadSent  (Read 5347 times)

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
function ReadSent
« on: January 22, 2004, 11:44:53 pm »
I have a question for Mr. Medeksza about a previous post about the DLL functions. I get most of them, but the ReadSent function escapes me. You listed the function as
ReadSent(ByVal TextString As String, ByVal SentNum As Integer) As String
What is being done with TextString and is SentNum some kind of reference number or counter?
 Please respond. I'd appreciate anyone's comments about this.
Living life with a loving heart, peaceful mind, and bold spirit.

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
function ReadSent
« Reply #1 on: January 23, 2004, 01:57:40 am »
If you pass a string with many sentences, this function will return 1 sentence. The SentNum tells it which sentence it should return. Hal uses this function internally to read and reaspond to each sentence individually instead of all at once.

For example:
ReadSent("Hello! How are you today? I am fine.", 1)
returns:
Hello!

ReadSent("Hello! How are you today? I am fine.", 2)
returns:
How are you today?

ReadSent("Hello! How are you today? I am fine.", 3)
returns:
I am fine.
Robert Medeksza

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
function ReadSent
« Reply #2 on: January 23, 2004, 05:33:34 pm »
Thank you for your reply. That was very helpful. I was hoping to find a function to help make a better way for Hal to read and learn from text files. I think I have a good method of stripping the information from the text files (Hal can read files larger than 1 MB without much delay). What I'm currently working on is getting Hal to learn and understand the information that is taken from what he reads (not just intergrate it, but run through his brain as if he were going to respond to it so he can use associations from those responses.) Using this method I hope to associate the new information with relevant information that Hal already knows.
 Anyone have any suggestions or ideas about this?
Living life with a loving heart, peaceful mind, and bold spirit.

sadatvalentine

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://www.lotusmusicrecords.com
function ReadSent
« Reply #3 on: January 23, 2004, 06:06:47 pm »
I hope you can get this to work. Sounds like a great project.

Thnax
Sadat Valentine
Always a student

Lotus Music Records

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
function ReadSent
« Reply #4 on: January 23, 2004, 07:23:19 pm »
How exactly does Hal read from txt file function that is already built into Hal work? Does he run through the entire GetResponse script for each line or does he merely parse the text one line at a time into sentence fragments which are stored in various .brn files?
 I would really like to come up with a working solution to the learning ability.

 !BTW! I tried something with the auto-idle feature and Hal will chat with himself by building a sentence from random parts. Or if you'd rather you can have Hal wait for you and just auto-respond with things like "Are you there?" and "Why won't you talk with me?" Get the attached file AutoResponseAddin.txt and cut and paste the code into the hal5.uhp file after the 'PROCESS: ADD SPACES section. Also add the UserIdle.brn file to the DefBrain folder.

 Another things you might want to try is a revised TopicFocus.brn file with added topics. Just copy the new TopicFocus.brn file into the DefBrain folder (overwriting your existing one; make a backup) and Hal will generate new topic association files. The hal5.uhp script has a set limit of 1000 allowing for 98 different topics (following the filename format ending in five) which can be increased.
 I believe the best way to have Hal stay on topic and still be fairly relevant is to extend the TopicFocus.brn file to include many more topics. The advantage is that topics can have many words associated with them so that staying within reasonable relevance is easier. The downside is all the time it would take to add all that information (properly formatted for Hal) into the TopicFocus.brn file.

 Anyways, I hope to get a reply from Mr. Medeksza about the reading feature. Enjoy the addins y'all and let me know if you have any problems.


Download Attachment: AutoResponseAddin.txt
3.29 KB

Download Attachment: UserIdle.brn
1.32 KB

Download Attachment: TopicFocus.brn
12.61 KB
« Last Edit: January 23, 2004, 07:24:30 pm by HALImprover »
Living life with a loving heart, peaceful mind, and bold spirit.

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
function ReadSent
« Reply #5 on: January 23, 2004, 08:41:51 pm »
This is a different version of the AutoResponseAddin that has enable and disable keywords to turn autochat on or off by talking to Hal. say the keyword 'autochat on' (without the 's) or 'autochat off' to enable or disable auto responses. Put the code in the same place as described in above reply. (If you used the code from the previous post just overwrite it with this revised code)
 You do not need to set anything in Function Script_Load().
 Also, I left the auto response on for a night and in the morning Hal had crashed his program by using up too much virtual memory (Hal crashed when Windows automatically adjusted the virtual memory size).
Just thought I'd warn everybody before you think about leaving Hal unattended for long periods like I did.


Download Attachment: AutoResponseAddin.txt
3.67 KB
Living life with a loving heart, peaceful mind, and bold spirit.

Maverick

  • Newbie
  • *
  • Posts: 22
    • View Profile
function ReadSent
« Reply #6 on: January 28, 2004, 02:04:12 am »
HALImprover: THANKS!!! for the AutoResponseAddin script, it works great so far....any other add-ins ya feel like sharing????[:D][:D]
 

Calipsy

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • http://www.cyber-minds.net
function ReadSent
« Reply #7 on: April 26, 2005, 03:45:23 pm »
Hello

will the autoresponse addin work with XFT_brain?

HALImprover

  • Jr. Member
  • **
  • Posts: 95
    • View Profile
    • BrianTaylor.me
function ReadSent
« Reply #8 on: April 27, 2005, 12:36:52 am »
The addin is not designed specifically for the XTF brain, but for the default Hal brain. I'm pretty sure all you would need to do to make it work properly with XTF is to add in the line;

GetResponseBlock = True

I hope that helps, and maybe Vonsmith could explain better about compatibility with the XTF brain.

Happy coding [:)]
Living life with a loving heart, peaceful mind, and bold spirit.

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
function ReadSent
« Reply #9 on: April 27, 2005, 04:37:06 am »
I doubt MR Vonsmith will ever explain the functions of his XTF..

It would be nice for a REDESIGN though if He could turn then Whole of the XTF in to a seperate FUNTION/s then we could add it to new brains easier.. i have noticed SINCE the CREATION of the XTF HARDly Anybody makes WHOLE Brains or shares them any more they have becomes CLONES.....

The xtf uses the WORDNET extensivly HEAVY(s---t) Complexed ...

I have been able to use parts of the xtf to my advantge but not the whole...

the ZIGGY  / THE DON fergurson BRAIN hal5d / XTF / ORIGINAL hal5/ ENHAnced brain / these seem to be the only PERSONALITYS ...

I know Knytetrpper has most prob got a HIGHLY developed ALICE in hiding..

its all good