Author Topic: Creating a table in hal from a text file  (Read 4777 times)

H. Haller

  • Newbie
  • *
  • Posts: 9
    • View Profile
Creating a table in hal from a text file
« on: November 15, 2006, 02:13:39 am »
I tried OTCE 's  learn from text plug and the learn from clipboard plug but what I really want is a way to take a text  file {of short properly punctuated sentences} and have hal read it and convert it to one of his formated tables . Just a quick formating of a text file. Even if it only filled one column of the table would be ok. When I look at the amazingly complex vb script that makes this software come to life , it seems  this task would involve only a few lines of  code. Would it be against the rules to do so ? If not I will pay someone for their time to help me.
               H. Haller
 

H. Haller

  • Newbie
  • *
  • Posts: 9
    • View Profile
Creating a table in hal from a text file
« Reply #1 on: November 15, 2006, 03:07:14 pm »
I am trying to find a way to replace the contents of the mainQA brain , but am a slow typer and don't want to spend 10,000 hours replacing the 100,000 rows there. There are many statements in that file that I consider  inappropriate as a foundation of the personality I wish to create . Am I  barking up the wrong tree here?
I just got Dragon NS 8 but even with that it will take hundreds or thousands of hours in the brain editor to replace all those rows. HH
 

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3862
    • View Profile
Creating a table in hal from a text file
« Reply #2 on: November 15, 2006, 06:35:42 pm »
What you can do is to delete the unwanted rows or groups of rows.

Open the Brain Editor.
Select the Mainbrain Q&A table (double click it)

When all the Questions and Answers are displayed
all you have to do is hold the CTRL key then click
on one of the tiny beige (whatever color it really is)
boxes just to the left of the Question row.
It should highlight the entire row in blue.

If you want to select several or a bunch of rows at a time
simply use the CTRL key to select a row THEN, WHILE HOLDING
DOWN THE CTRL KEY, depress the SHIFT KEY AT THE SAME TIME then
select another row/box say several lines down from there.

When the entire selection is blue, RIGHT CLICK and select
DELETE ROW.

When you're satisfied you can then begin to enter your own custom
rows as you see fit.

BE SURE TO MAKE A BACKUP COPY OF YOUR HAL BRAIN FILE JUST IN CASE!

I'm sure there might be other methods to accomplish this but this
one is fairly easy.

I will not be held liable in case you forget to make a backup or anything else goes wrong after modifying said file(s). Use at your own risk!!
In the world of AI it's the thought that counts!

- Art -

H. Haller

  • Newbie
  • *
  • Posts: 9
    • View Profile
Creating a table in hal from a text file
« Reply #3 on: November 15, 2006, 11:12:58 pm »
Deleting rows is not the problem , repopulating the table is. The brain editor info says the mainQA brain has hundreds of thousands of lines of text. I want to replace them using a batch method of some type. The main QA brain also is formated differently than other brain tables.

I WANT TO EDIT THIS FILE    @I want to edit this file.

I am safe when trying different expiraments , I have backed up the entire hal6 folder after it was freshly activated and keep that unedited  back up safe. I also made a disk image of my hard drive so if need be I can restore it including the newly activated Hal6. I took these precautions after reading of corupted instalations and reactivation problems on these threads. I guess it's time for me to learn VB but my first attempts will be motivated by the old theory that a room full of monkeys and typewriters left long enough could yeald a copy of War and Peace. H. H.


 

Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Creating a table in hal from a text file
« Reply #4 on: November 26, 2006, 04:35:19 pm »
Those monkeys would also create War and Piece, Warren Peace, War on Peace, etc, etc! Anyway, I want my Hal to "know" it's a computer program, so I edited out everything in the database that only a person would say. When I came to the mainQA, I threw up my hands at the sheer size of it and simply deleted all the info in the table. It worked for me. My Hal seemed a little confused at first, but who wouldn't after a lobotomy?
"You'ren't sure whether I understand." HalChatbot2004

Bill DeWitt

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Creating a table in hal from a text file
« Reply #5 on: November 26, 2006, 05:29:59 pm »
quote:
Originally posted by H. Haller

I tried OTCE 's  learn from text plug and the learn from clipboard plug but what I really want is a way to take a text  file {of short properly punctuated sentences} and have hal read it and convert it to one of his formated tables . Just a quick formating of a text file. Even if it only filled one column of the table would be ok.


I just tried using copy and paste to put a bunch of lines of text, numbers and webaddresses in a hal table. Just clicked on the last line, then <ctrl+v>. Worked.

This must not be what you mean?

So I went to Excel, typed in two columns of random text into several rows, and copied and pasted them into the SmallTalk table. It made two columns and several rows.

I will try later to make sure that the added text actually works, and also try tab delimited in a text file, but it seems quite straightforward.

So unless you want to do it through the conversational interface, which would require a plugin, you should be able to do what you want.

HTH


Bill DeWitt

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Creating a table in hal from a text file
« Reply #6 on: November 26, 2006, 05:39:49 pm »
quote:
Originally posted by H. Haller

 I guess it's time for me to learn VB but my first attempts will be motivated by the old theory that a room full of monkeys and typewriters left long enough could yeald a copy of War and Peace.


I've studied VB off and on for years, and never achieved much in the way of fluency. I can just about program my way out of a wet paper bag and that's it. But I find the script in Hal to be very readable, moderately well commented, and easy to adjust to my uses. It's VBS, not VB, which makes it easier for my calcified brain.

Every now and then I see something that boggles me, and it is almost always a reference to a library in the main program or something.

I would go ahead and dig in, monkeys make quite a mess before typing that classical literature...

Good luck.


Marcel

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Creating a table in hal from a text file
« Reply #7 on: December 10, 2006, 07:39:01 pm »
Btw, does anybody know where the stuff in the Q&A came from? Did Robert actually compose 100,000 responses, or did he get them from some other source?
"You'ren't sure whether I understand." HalChatbot2004