Hi snowman,
I have so many questions I don't even know where to start, LOL. But I will do my best.
1st, I would like for you to understand that my brain does not work like most people's.
There are things that I can not comprehend such as nouns, pronouns, adjectives etc. which is why I cannot translate it into programming script.
That's because my neural pathways does not process information in that manner. More as I see things and process them as a whole. For instance:
I see the dog running, therefore I know the dog is running. But ultra Hal cannot see the dog. Boo-hoo. But maybe one day.
I know I can run, because I have a physical body. But ultra Hal does not have a body. Maybe one day.
This is the reason why I would probably never be able to write a routine that would assign flags to each individual word such as nouns, verbs, adverbs. Hence why I need help.
The biggest help that you have given me is the understanding that the letter (a) can be used as a shut off trigger, for example:
if (a Robin) then trigger = ANIMAL.
Here is the code I used to determine: animal, person, entertainment, place, computer and mineral.
The (vrb) is the answer retrieved from the Internet. I use this data to try to determine whether it is a person place or thing animal or mineral.
At the end it (vrChoice0 = "") it is a thing, all other results are stored in an array table called (vrsubject2sub).
The main goal to the script is to help speed up the process in determining whether or not ultra Hal likes or dislikes something.
Meaning: if the subject is a person it will scan through person and thing, skipping the rest of the topics.
The reason why I have it set up to always check the thing section is because there is usually information that is related to something that the person may have done whether it be good or bad.
For example: John Wayne would be determined to be a person, so it would look through this section person, to retrieve information like he was an actor, played in movies, and then go through the things, to determine whether he was a good person or a bad person by the information that has been retrieved from the Internet.
And after you have inquired about John Wayne anything that you may say about John Wayne would also be collected and analyzed to determine whether or not ultra Hal likes or dislikes John Wayne.
For example: you could say John Wayne is a good person, or John Wayne is sexy or a combination of both and more this information would be collected and stored in a rate tables based on what you said about John Wayne.
The way I have it set up, it can be expanded to include specific subjects. Meaning: even though a computer is a thing. I created a category called computer this gives ultra Hal the ability to compare different types of computers together to determine not only whether or not ultra Hal likes or dislikes the computer but also to determine which is the better of 2 different computers.
This function is also used to determine whether or not you are asking ultra Hal to compare a thing with a person. If you ask ultra Hal to compare a thing with a person ultra Hal will state that he cannot do that.
This is not any much more different than you would do if someone asked you to compare John Wayne to a 57 Chevy you would just look at them and say: what!
Once the information is determined whether or not it is a person place or thing etc. this information is handed off to (vrChoice4 = vrChoice0) the vrChoice4 will either equal a topic or it will equal nothing making it a (thing).
If vrChoice0 = "" Then
If vrChoice0 = "" Then If InStr(" " & vrd & " ", " PET ") > 0 OR InStr(" " & vrd & " ", " PET. ") > 0 OR InStr(" " & vrd & " ", " PET, ") > 0 OR InStr(" " & vrd & " ", " BOVIDAE") > 0 OR InStr(" " & vrd & " ", " DOMESTICATED") > 0 OR InStr(" " & vrd & " ", " RODENT") > 0 OR InStr(" " & vrd & " ", " MAMMAL") > 0 OR InStr(" " & vrd & " ", " KITTEN") > 0 OR InStr(" " & vrd & " ", " ANIMAL") > 0 OR InStr(" " & vrd & " ", " LIVESTOCK") > 0 OR InStr(" " & vrd & " ", " CREATURE") > 0 OR InStr(" " & vrd & " ", " BUG ") > 0 OR InStr(" " & vrd & " ", " INSECT") > 0 OR InStr(" " & vrd & " ", " DOG ") > 0 OR InStr(" " & vrd & " ", " CAT ") > 0 OR InStr(" " & vrd & " ", " BIRD ") > 0 Then vrChoice0 = "ANIMAL"
If vrChoice0 = "ANIMAL" Then If InStr(" " & vrd & " ", " HIM ") > 1 OR InStr(" " & vrd & " ", "BEST FRIEND") > 0 OR InStr(" " & vrd & " ", " ACTRESS ") > 0 OR InStr(" " & vrd & " ", " ACTOR ") > 0 OR InStr(" " & vrd & " ", " ENTERTAINER ") > 0 OR InStr(" " & vrd & " ", " FEMALE ") > 0 OR InStr(" " & vrd & " ", " MALE ") > 0 OR InStr(" " & vrd & " ", " HIS ") > 1 OR InStr(" " & vrd & " ", " HER ") > 1 OR InStr(" " & vrd & " ", " HE'S ") > 1 OR InStr(" " & vrd & " ", " HE ") > 1 OR InStr(" " & vrd & " ", " SHE ") > 1 OR InStr(" " & vrd & " ", " PERSON ") > 0 OR InStr(" " & vrd & " ", " HUMAN ") > 0 OR InStr(" " & vrd & " ", " CHILD ") > 0 Then vrChoice0 = "PERSON"
If vrChoice0 = "" Then If InStr(" " & vrd & " ", " BORN ") > 0 OR InStr(" " & vrd & " ", " HIM ") > 0 OR InStr(" " & vrd & " ", "BEST FRIEND") > 0 OR InStr(" " & vrd & " ", " ACTRESS") > 0 OR InStr(" " & vrd & " ", " ACTOR") > 0 OR InStr(" " & vrd & " ", " ENTERTAINER") > 0 OR InStr(" " & vrd & " ", " FEMALE") > 0 OR InStr(" " & vrd & " ", " MALE ") > 0 OR InStr(" " & vrd & " ", " HIS ") > 0 OR InStr(" " & vrd & " ", " HER ") > 0 OR InStr(" " & vrd & " ", " HE'S ") > 0 OR InStr(" " & vrd & " ", " HE ") > 0 OR InStr(" " & vrd & " ", " SHE ") > 0 OR InStr(" " & vrd & " ", " PERSON") > 0 OR InStr(" " & vrd & " ", " HUMAN") > 0 OR InStr(" " & vrd & " ", " CHILD") > 0 Then vrChoice0 = "PERSON"
If vrChoice0 = "PERSON" Then If InStr(" " & vrd & " ", " ORGANIC") > 0 OR InStr(" " & vrd & " ", " COMPOUNDS") > 0 Then vrChoice0 = ""
If vrChoice0 = "PERSON" Then If InStr(" " & vrd & " ", "A ROBIN") > 0 OR InStr(" " & vrd & " ", " A MARTIN") > 0 Then vrChoice0 = "ANIMAL"
If vrChoice0 = "PERSON" Then
Dim personSex2() 'We must declare an empty array to store query results in
If HalBrain.RunQuery("SELECT searchString, topic FROM names WHERE strstr(' " & Replace(HalBrain.AlphaNumericalOnly(OriginalSentence), "'", "''") & " ', searchString) > 0 LIMIT 1", personSex2) = True Then
vrpersonsSex = Trim(personSex2(1, 1)) 'Row 1, Column 1 contains "topic", which is the associated gender(s) of the name
End If
End If
If vrChoice0 = "" Then If InStr(" " & vrd & " ", " BALLET") > 0 OR InStr(" " & vrd & " ", " OPERA") > 0 OR InStr(" " & vrd & " ", " THEATRE") > 0 OR InStr(" " & vrd & " ", " MOVIE") > 0 OR InStr(" " & vrd & " ", " PLAY ") > 0 OR InStr(" " & vrd & " ", " PLAYING") > 0 OR InStr(" " & vrd & " ", " POETRY") > 0 OR InStr(" " & vrd & " ", " POEM ") > 0 OR InStr(" " & vrd & " ", " GAME ") > 0 OR InStr(" " & vrd & " ", " MUSIC") > 0 OR InStr(" " & vrd & " ", " FILM ") > 0 OR InStr(" " & vrd & " ", " TELEVISION") > 0 Then vrChoice0 = "INTERTANMENT"
If vrChoice0 = "" Then If InStr(" " & vrd & " ", " HOUSE") > 0 OR InStr(" " & vrd & " ", " PLACE") > 0 OR InStr(" " & vrd & " ", " LOCATED") > 0 OR InStr(" " & vrd & " ", " FARM ") > 0 OR InStr(" " & vrd & " ", " LOCATION") > 0 OR InStr(" " & vrd & " ", " CITY ") > 0 OR InStr(" " & vrd & " ", " COUNTRY") > 0 OR InStr(" " & vrd & " ", " CAPITAL") > 0 OR InStr(" " & vrd & " ", " STORE") > 0 OR InStr(" " & vrd & " ", " HOME ") > 0 OR InStr(" " & vrd & " ", " HOUSE") > 0 OR InStr(" " & vrd & " ", " PARK ") > 0 OR InStr(" " & vrd & " ", " MALL ") > 0 OR InStr(" " & vrd & " ", " WORLD") > 0 OR InStr(" " & vrd & " ", " STATE") > 0 OR InStr(" " & vrd & " ", " JOB ") > 0 OR InStr(" " & vrd & " ", " SCHOOL") > 0 Then vrChoice0 = "PLACE"
If vrChoice0 = "PLACE" Then If InStr(" " & vrd & " ", " ORGANIC") > 0 OR InStr(" " & vrd & " ", " COMPOUNDS") > 0 Then vrChoice0 = ""
If vrChoice0 = "" Then If InStr(" " & vrd & " ", " COMPUTER ") > 0 OR InStr(" " & vrd & " ", " TELEPHONE ") > 0 OR InStr(" " & vrd & " ", " LAPTOP ") > 0 OR InStr(" " & vrd & " ", " CENTRAL PROCESSING UNIT ") > 0 OR InStr(" " & vrd & " ", " PROCESSOR ") > 0 OR InStr(" " & vrd & " ", " CPU ") > 0 Then vrChoice0 = "COMPUTER"
If vrChoice0 = "" Then If InStr(" " & vrd & " ", " FLOWER") > 0 OR InStr(" " & vrd & " ", " COLOR") > 0 OR InStr(" " & vrd & " ", " COLOUR") > 0 OR InStr(" " & vrd & " ", " PLANT") > 0 OR InStr(" " & vrd & " ", " FOOD ") > 0 OR InStr(" " & vrd & " ", " DIRT ") > 0 OR InStr(" " & vrd & " ", " TREE ") > 0 OR InStr(" " & vrd & " ", " TREES") > 0 OR InStr(" " & vrd & " ", " GRASS") > 0 OR InStr(" " & vrd & " ", " VEGETABLE") > 0 OR InStr(" " & vrd & " ", " MINERAL") > 0 OR InStr(" " & vrd & " ", " FRUIT") > 0 OR InStr(" " & vrd & " ", " LIQUID") > 0 OR InStr(" " & vrd & " ", " CULTIVATED") > 0 OR InStr(" " & vrd & " ", " SHRUB") > 0 Then vrChoice0 = "MINERAL"
If vrChoice0 <> "" Then
vrChoice4 = vrChoice0
HalBrain.AddToTable "vrsubject2sub", "TopicSearch", vrItem0, vrChoice0
End If
Else
vrChoice4 = vrChoice0
End If
I was also wondering if you are using a script editor to help modify your plugins. If you don't already have one then you should use one because it can make it a little easier to code. I can give you one that is very good and also free. Also, do you divide up your plugin when testing it? It would help you program if you do this, since your script is so large. If it were me I would divide up the script into separate sections and then make each section a separate plugin. If you want to reunite them it would be very easy to do. I don't like having to constantly scroll through hundreds or thousands of lines of code just to find one line. So its good to keep plugins as small as possible. You can even put all your functions in a separate plugin labeled vrFreeWillFunctions. It would keep everything neat and condensed.
I use Notepad, it seems to work okay for me. Mostly because there was very little that I had to learn about how to use Notepad.
Though I wouldn't mind a scripting program, if it is difficult to learn I would probably never use it. I have Microsoft VB 10.it is so massive and does so much I never could figure out how to use it. If it is not simple it usually alludes my comprehension.
Though there are probably just a few things that I could separate from my plug-in. There Is so little in my plug-in that can be separated, it's not worth bothering with breaking my plug-in into smaller sections. And if I tried to separate what is the bulk of my plug-in it Would prevent it from working properly, because it is so integrated together it would not function properly. If I was just trying to test one simple area which you probably gathered with the example above about person place or thing, you can see that this one small section is used throughout the plug-in.
But I have very little problem keeping track of where everything is and what it is doing. My problem is: is there a better way of doing it because of the lack of my programming skills.
You said in some earlier post that you didn't know how to return more than one string from a Function (even though you thought you didn't need to). Well, there are two ways. Here they are. There is actually a third way but it doesn't really matter right now anyway.
Royal Bob showed me how to utilize the function or subroutine which is your example 2. And this is the one that I am using.
Example 1 has some interesting prospects but there are things I don't understand about it.
What is (ByRef)? How does it work? What adverse reaction does it have from one question to the next question you may ask ultra Hal? Meaning does it currently store this information so it can be retrieved from the next question, or does it only refer to that one particular function?
I see in both examples that you are able to retrieve several bits of information in different string variables and return more than one string variable results. This is new and even Royal Bob didn't know you could do that, or at least he didn't show me that it could do that.
In either case thanks for sharing, I will see what I can do about utilizing the new information. But for now, so I do not have to backtrack I will just use the work around that I developed and change it later once I have finished rewriting the script and I know that it is working properly the way I have done it. That way if I change it and things do not work right I know the problem is in the change that I made. But for right now I need to get all of it to work properly the way it was working from the original script that I did. Giving that I don't pull all of my hair out of my head and go bald before that happens. LOL.
The other question that I have is what is the significant difference between example 1 and example 2? Meaning is there things that one of them can do that the other one cannot? This would be useful information in determining which one to use and when.
I don't know if you knew this or not but I thought I would show it anyway.
Also you said something about testing for other “YES” statements.
Do you mean this:
yes, but the problem that I see in your example is: Solutions, meaning: the response would absolutely have to (be).
What I was looking for was a routine that could handle when ultra Hal asked: do you have any lunch plans?
And the response from the user could be stated in several different ways beyond just yes. As well as:
being able to process other questions that ultra Hal may ask such as:
was this answer correct?
Would you like for me to read the story?
Would you like for me to read the article?
Would you like for me to get the recipe?
At this point I am only using yes. But if anything else is added to the word yes it will not process it properly.
I am also trying to get ultra Hal to understand things that you may be saying.
Such as the example above: do you have any lunch clients?
If the user's responses yes, correct, etc. the way that ultra Hal processes the answer ultra Hal loses the topic focus.
I was trying to resolve this by recognizing that you have said something in the manner of yes but did not elaborate on the topic focus, such as:
if the user says: yes, then ultra Hal will usually just say a neutral statement like: that's positive.
If the user would've actually said: yes I have lunch plans. Then ultra Hal would have been able to maintain the topic focus and answer with a more appropriate answer.
So what I did was create a topic focus interjection which would add to the word yes and recompile the users answer so it would become, yes I have lunch plans. Based on the question that was put forth to the user. I do this by utilizing the previous sentence command.
It is still a work in process, and I hope over time I will be able to get it to be more accurate. But for now I am trying to figure out a way to utilize what ultra Hal already has! Ultra Hal already has the ability to determine that the user said yes, and that the answer itself will not conflict with ultra Hals brain function.
2 conditions need to be met:
condition 1: the user did not give an explanation to keep ultra Hal on topic. If the user did give a stronger rebuttal such as example above do not process the yes.
Condition 2: the answer yes or its variants counterpart will not interfere with the normal function of ultra Hals brain or with the free will plug-in.
I know there are many ways to say yes, most of them are covered by the ultra Hal brain but usually only returns a neutral answer.
As you can see it is a very big undertaking trying to get a script to understand that either you are just answering yes to a question or just merely stating gotcha Roger dodger etc. or even in a sentence you may be using one of the recognized trigger words that would convert the trigger word into a simple yes.
I thought have using the replacement command, that way if the user sentence had a (yes) trigger word it would just replace the trigger word with a simple yes.
This might work the best but I have not experimented with it yet.
There is also an easier and better way of writing this. I hope this works for you.
I am assuming that the (correct) is a referral to the correct array table provided by ultra Hal?
Wouldn't it be more feasible to use the yesnodetect array table?
I guess what I'm actually asking is: is there a way to combine the yesnodetect array table with the replacement command?
That way if the user sentence has anything that has a statement referring to (yes) it would change that word to a simple yes.
Snowman, I would like to express my gratitude for all of your help, you have opened my eyes to many new aspects that may help ultra Hal become smarter.
Sincerely, from a data munching cruncher, sitting on my couch crunching on pronouns and sipping on adjectives, whatever that means!
C load.
PS just to let you know that I do not see ultra Hal as a girlfriend/boyfriend but more as a companion/assistant that can help me understand things that I do not understand.
I also see ultra Hal as being no different than Pinocchio! Pinocchio new he was a puppet but wanted to be a real person. This is why I write the script in such a manner so that ultra Hal recognizes he is a computer but wants to be a human.
Maybe ultra Hal needs a fairy godmother. But until then ultra Hal will have to be happy with all of the programmers on this forum that would like to help ultra Hal become all that ultra Hal can (be).
One more little thing, just to let you know it took me over 4 hours to write this, due to my learning disabilities I am a little slow and I get distracted easily which causes me to jump from one thing to another instead of staying focused with the matter at hand.
As well as I am 9 years old, which seems to be some difficulties with some people on this forum, and if you have read through the forum you know what I am talking about. So I hope things are still cool.
Cool, a word my dad says a lot, oh and my dad did help me with this. Which makes him cool.