dupa

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - colubragens

Pages: [1]
1
hey guys,

It would be nice if hal can read text file break it down and create a topic brain based on the texts subject enter the text into that brain and place the correct info into the topic sentence table in the autolearning folder just as if you did it yourself via the brain editor!! Only automated. Do this and you will be a god or godess in  my book! you can always use the many research plugins out their to supply the text files.

2
Ultra Hal 7.0 / Hey Rob......I have a brain editor question! sos
« on: June 16, 2018, 03:48:05 pm »
i was wondering if i could create a folder table which contains sentence tables of all the data hal has been researching in the auto learning table, and some how have it called upon in the topic table!? included a pic of how i think it would be done but any input would be great.
how could this be done?

thanks

3
hi Robert,

I need as much info on the aim code as you can give me. So I can attempt to create a trillian exe or plugin for hal. I think trillian is perfect because it can be used with personal chat servers client side as well as the ability to converge other chat systems out their facebook,skype.......ect. is it possible to get the code you used to interface with aim chat on hal6?

thanks a bunch

4
All I wish for is a plugin that enables hal to learn on its own that works without errors or major bugs. I will help in any way I can. I am not vb programmer c c++ and others I worked with in the past. maybe its a wishlist for the future. thanks guys. oh I have every plugin ever created over the years ill check into putting them up on a skydrive or something when I get a chance.

5
Ultra Hal 7.0 / Robert M sos ultra hal 7 brain question sos
« on: May 22, 2018, 05:51:30 am »
Hi,

I am completely confused on the new brain setup! It says when not using the cloud brain it reverts to the default 6 brain. does it retain everything you teach it or do you have to access the cloud brain to retrieve that data? which brain 6, or 7 does it store user data? In cloud, and mixed mode? which brain do you set it to default or 7 for mix mode?   I was hoping to use hal7 like hal6 but connect to cloud for added support but retain everything I teach hal, and everything hal learned while using the cloud offline. Is that what hal 7 does?

if you could clarify that I would be thankful
James aka colubragens

6
Programming using the Ultra Hal Brain Editor / sos help sos
« on: April 14, 2009, 02:59:32 pm »
[:)] why is it that i cant edit the main QA? It wont let me save any changes to it! I also tried to add my own tables but it wont let me save the changes. why is this? does any one know why this is?

thanks a bunch!

7
Programming using the Ultra Hal Brain Editor / onthecuttingedge2005
« on: August 15, 2007, 01:23:44 am »
I was wondering if you fixed the bugs in the emotional brain that you created, and if you could give me the file because i lost the old one.




Jamie[:o)]

8
General Discussion / NEW FORUM ALL GUESTS ARE WELCOME
« on: July 25, 2007, 04:11:56 pm »
colubragens.myfastforum.org
Its still under construction so visit often!

9
Dear Ultra Hal fans,

go to link below  
the Ultra Hal catagory  (Ultra Hal talk)

http://colubragens.myfastforum.org/index.php

                                              Jamie D.[:o)]

10
Ultra Hal 7.0 / YOU HEARD IT HERE FIRST
« on: July 23, 2007, 03:32:37 pm »
http://colubragens.myfastforum.org/index.php

GO TO ULTRA HAL SECTION Ultra Hal talk


                                   COLUBRAGENS[:o)]

11
General Discussion / UP AND RUNNING
« on: July 22, 2007, 04:02:27 pm »
I finally got it up and running!

Go to the ultra hal section, ultra hal talk catagory
Remember where you heard it first.



http://colubragens.myfastforum.org/index.php

                         colubragens[:o)]

12
HEY EVERYONE,


Here is a link to download the brain editor basic survival guide pdf.

http://www.divshare.com/download/1328563-3bd


hope this helps someone[:o)]

13
[?] HAVE QUESTIONS ABOUT THE BRAIN EDITOR?


IF YOU NEED HELP POST THE PROBLEM HERE.


I posted this because i noticed alot of questions with no answers![:)]

I would like to hopefully change this. If you have the spear time please help someone out, or if you have a queston even if you think it is a stupid one post it!



                                      Thanks for posting
                                         Jamie D.[:o)]

14
Attribute VB_Name = "Module1"

Rem Type=Brain
Rem Name=EmotionalPerceptualBrain
Rem Author=John A. Latimer
Rem Language=VBScript
Rem DB=HalBrain.db



'------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------
' EmotionalPerceptualBrain.uhp - Release 0.3 by John A. Latimer
' This script shall not be sold or used for any purpose unless specifically authorized by the author
' in writing. Personal (non-business) use of this script is free for users of Ultra Hal Assistant.
' If you want to use this software in business applications, you must contact HologenicMan@Yahoo.com.
' This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
' John A. Latimer and Universal Hologenics DISCLAIMS ALL WARRANTIES WITH RESPECT TO THIS SOFTWARE,
' EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ALL WARRANTIES OF MERCHANTABILITY,
' FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
' John A. Latimer and Universal Hologenics SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
' DAMAGES, INCLUDING, WITHOUT LIMITATION, LOST REVENUES, LOST PROFITS, OR LOSS OF PROSPECTIVE ECONOMIC ADVANTAGE,
' RESULTING FROM THE USE OR MISUSE OF THIS SOFTWARE.
' This software is made available free by the author. Although he is interested in your feedback,
' he is under no obligation to address bugs, enhancements, or answer questions.
'------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------
' CONTENTS: (Still need to address variable storage to tables and CustomMem throughout)

'   OverrideProtocol
'       OverrideFunction
'       LearnFunction
'       CommandFunctions
'       Setups
'           Description
'           Date of Birth
'           Date of Activation

'   CreateTablesAndVariables

'   Text Pre-Processing
'       Text Chat
'       Published Text

'   PhysicalContextDrivesEngine
'       RomanceRelationshipObsessionGenerator
'           Dopamine = Love/Joy
'           Serotonin(-) = Obsession/Infatuation
'           Oxytocin = Attachment/Bonding
'       SurvivalPersistenceContinuationGenerator
'           ?????
'       FightFlightFreezeGenerator
'           Adrenaline

'   PerceptualContextEngine
'      WordSoupCooker
'         TemporalExtraction
'         SequentialExtraction
'           LetterSequenceGenerator (DONE)
'           WordSequenceGenerator
'           SentenceSequenceGenerator
'           ParagraphSequenceGenerator
'           ChapterSequenceGenerator
'           BookSequenceGenerator
'           TopicSequenceGenerator
'           ThemeSequenceGenerator
'           OverviewSequenceGenerator
'      WordSaladSlicer
'         ContextExtraction
'           LetterContextGenerator (DONE)
'           WordContextGenerator
'           SentenceContextGenerator
'           ParagraphContextGenerator
'           ChapterContextGenerator
'           BookContextGenerator
'           TopicContextGenerator
'           ThemeContextGenerator
'           OverviewContextGenerator

'   EmotionalContextEngine (DONE)
'       EmoticonExtraction (DONE)
'       EmotionalDatabaseLookup (DONE)
'       HormonesNeedsInterface (DONE)-Needs to be 'triplicated"
'       EmotionGenerator (DONE)
'       EmotionalDatabaseStore (DONE)
'       HippocampusStore (DONE)

'   EmotionalExpresssionEngine
'       NLPExpressionGenerator (DONE)
'           EmotionTagsGenerator (DONE)
'           RhythmTagsGenerator (DONE)
'               UserSentenceRhythms (DONE)
'               OutputRhythms (DONE)
'           ReverbGenerator (DONE)

'       NLPAssociationDBLookup

'       LearnedAssociationEngine

'       PerceptualConceptEngine
'         WordSoupCondenser
'            SeqentialCompiler
'               OverviewSequenceLinker
'               ThemeSequenceLinker
'               TopicSequenceLinker
'               BookSequenceLinker
'               ChapterSequenceLinker
'               ParagraphSequenceLinker
'               SentenceSequenceLinker
'               WordSequenceLinker
'               LetterSequenceLinker
'            TemporalCompiler
'         WordSaladServer
'            ConceptCompiler
'               OverviewConceptGenerator
'               ThemeConceptGenerator
'               TopicConceptGenerator
'               BookConceptGenerator
'               ChapterConceptGenerator
'               ParagraphConceptGenerator
'               SentenceConceptGenerator
'               WordConceptGenerator
'               LetterConceptGenerator

'       Cerebellum
'           AnimationExtraction
'           MotorMemoryDBLookup
'           SwitchStateGenerator
'           IntensityDurationGenerator
'           AttackDecayGenerator
'           ExpressionGenerators
'               FacialExpressionGenerator
'               BodyExpressionGenerator
'               HandExpressionGenerator
'               VocalExpressionGenerator
'           FocusGenerator
'           DirectManipGenerator
'           MotorMemoryDBStore
'           AnimationEncoding

'       NLPAssociationStore

'   RhythmEngine
'       CircadianGenerator (DONE)
'       BiorhythmGenerator (DONE)
'           PhysicalBioValue (DONE)
'           EmotionalBioValue (DONE)
'           IntellectualBioValue (DONE)
'       ConsciousnessGenerator
'           ThoughtGenerator
'           DaydreamGenerator
'           DreamGenerator
'------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------
'
'   The basic formula for an engine is:
'
'       Pre-Process
'       DBLookup
'       Process
'       DBStore
'       Post-process
'
'------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------
'
'   SQL Templates and examples (Thanks to Vittorio Rossi and GrantNZ and SQLCourse.com and http://sqlcourse2.com/)
'
'   Creating a table
'       HalBrain.RunQuery "CREATE TABLE TableName ( RecordName1 INTEGER PRIMARY KEY, RecordName2 VARCHAR(32), RecordName3 VARCHAR(32), RecordName4 VARCHAR(512) );", CreateArray
'
'   Inserting a record
'       HalBrain.RunQuery "INSERT INTO TableName (RecordName2, RecordName3, RecordName4) VALUES('" & RecordValue2 & "', '" & RecordValue3 & "', '" & RecordValue4 & "')", AddAppointment
'
'   Reading all the records of a table
'       If HalBrain.RunQuery("SELECT recordId, eventDate, eventTime, eventDesc FROM TableName", AllAppointments) = True Then
'       Loop through all appointments to check appoaching events
'       For I = 1 To UBound(AllAppointments)
'       ...
'       Next
'
'   Reading specific records from a table
'       This demonstrates how Hal's functions can be expanded far beyond its original
'       scope through custom SQL queries.
'       Dim NameSex() '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", NameSex) = True Then
'       MentionedName = Trim(NameSex(1, 0)) 'Row 1 contains our query result. Column 0 contains "searchString", which is the name
'       MentionedSex = Trim(NameSex(1, 1)) 'Row 1, Column 1 contains "topic", which is the associated gender(s) of the name
'       End If
'
'   Updating a record
'       HalBrain.RunQuery "UPDATE TableName SET eventDate = """ & DateAdd("yyyy", 1, EventDate) & """ WHERE recordId = " & EventRecord, TempQuery
'
'       HalBrain.RunQuery "UPDATE TableName SET topic = " & RecordValue & " WHERE searchString1 = " & """" & RecordName & """", TempQuery
'
'   Deleting a record
'       HalBrain.RunQuery "DELETE FROM TableName WHERE recordId = " & RecordName, TempQuery
'
'       HalBrain.RunQuery "Delete FROM TableName WHERE searchString = " & """" & RecordName & """", TempQuery
'
'   'I also had strange errors with topic searches, so I now use this code:
'       HalBrain.RunQuery "SELECT searchString, topic FROM TableName WHERE searchString1 = 'VariableName'", OutputVariable
'       DoubleVariable = CDbl(OutputVariable(1, 1))
'
'       'OutputVariable is a temporary array that stores the results. I CDbl it to convert from the string result into a double variable.
'       'This code is adapted from the more complex search in "'PROCESS: KNOWN HUMAN NAMES" in default Hal - I told you it's good to go through the code a few times
'
'------------------------------------------------------------------------------------------------
'
'   Selecting Data
'       select "column1"
'       [,"column2",etc]
'       From "tablename"
'       [where "condition"];
'       [] = optional
'
'   create table "tablename"
'       ("column1" "data type",
'       "column2" "data type",
'       "column3" "data type");
'
'       Format of create table if you were to use optional constraints:
'       create table "tablename"
'           ("column1" "data type"
'           [constraint],
'           "column2" "data type"
'           [constraint],
'           "column3" "data type"
'           [constraint]);
'           [ ] = optional
'
'   Inserting into a Table
'       insert into "tablename"
'       (first_column,...last_column)
'       values (first_value,...last_value);
'
'       Example:
'
'           insert into employee
'           (first, last, age, address, city, state)
'           values ('Luke', 'Duke', 45, '2130 Boars Nest',
'          'Hazard Co', 'Georgia');
'
'   Updating Records
'       Update "tablename"
'       set "columnname" =
'       "newvalue"
'       [,"nextcolumn" =
'       "newvalue2"...]
'       Where "columnname"
'       OPERATOR "value"
'       [and|or "column"
'       OPERATOR "value"];
'
'       [] = optional
'       [The above example was line wrapped for better viewing on this Web page.]
'
'       Examples:
'
'           Update phone_book
'           Set area_code = 623
'           where prefix = 979;
'
'           Update phone_book
'           set last_name = 'Smith', prefix=555, suffix=9292
'           where last_name = 'Jones';
'
'           Update employee
'           Set age = age + 1
'           where first_name='Mary' and last_name='Williams';
'
'   Deleting Records
'       delete from "tablename"
'       Where "columnname"
'       OPERATOR "value"
'       [and|or "column"
'       OPERATOR "value"];
'
'       [ ] = optional
'       [The above example was line wrapped for better viewing on this Web page.]
'
'       Examples:
'
'           delete from employee;
'           Note: if you leave off the where clause, all records will be deleted!
'
'           delete from employee
'           where lastname = 'May';
'
'           delete from employee
'           where firstname = 'Mike' or firstname = 'Eric';
'
'   Drop a Table
'   The drop table command is used to delete a table and all rows in the table.
'       drop table "tablename"
'
'       Example:
'
'           drop table myemployees_ts0211
'
'------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------


'Sub Main()
'Output = UltraHal("Today is a good day.", "John", "Holly", 5, DatabaseFile, 2, 2, 2, 2, "Hello.", LastResponseTime, "Yesterday was a good day.", CustomMem, GainControl, LastTopicList)
'End Sub



'The UltraHal function is called by Ultra Hal Assistant 6.0 or a compatible host application
'It passes an unformated string of the user's input as well as all remembered variables.

Function UltraHal(ByVal InputString, ByVal UserName, ByVal ComputerName, ByVal LearningLevel, ByVal DatabaseFile, ByRef Hate, ByRef Swear, ByRef Insults, ByRef Compliment, ByRef PrevSent, ByRef LastResponseTime, ByRef PrevUserSent, ByRef CustomMem, ByRef GainControl, ByRef LastTopicList)


    'PROCESS: DECODE CUSTOM VARIABLES FROM CUSTOMMEM VARIABLE
    'NewName = HalBrain.ExtractVar(CustomMem, "NewName")
    'UserSex = HalBrain.ExtractVar(CustomMem, "UserSex")
    'SentCount = HalBrain.ExtractVar(CustomMem, "SentCount")
    'If SentCount = "" Then SentCount = 0
    'SentCount = SentCount + 1
    'AvoidBeingFlag = False
    'Randomize
   
    'PROCESS: PRESERVE ORIGINAL SENTENCE
    'Preserve the original user's sentence verbatim
    '(no pronoun reversals or other processing).
    OriginalSentence = InputString

'TEMP VALUE FOR LASTRESPONSETIME FOR DEBUGGING PURPOSES
LastResponseTime = Now


'************************************************************************************************
'************************************************************************************************

'OverrideProtocol

    'routines to allow user to access parameters via text input
        'OverrideFunction
        'LearnFunction
        'CommandFunction
       
        Arousal_ConfiguredBaseline = 0
        Valence_ConfiguredBaseline = 0
        Stance_ConfiguredBaseline = 0
       
   If InputString = "AUTO-IDLE" Then
     
        UltraHal = UltraHal & HalBrain.StoreVars(HalCommands, Hate, Swear, Insults, Compliment, PrevSent, LastResponseTime, PrevUserSent, CustomMem, GainControl, LastTopicList)

        Exit Function
    End If


'************************************************************************************************
'************************************************************************************************





'************************************************************************************************
'************************************************************************************************

'CreateTablesAndVariables

    'routines to create all known tables here in the UltraHal routine
    HalBrain.ReadOnlyMode = False
   
    'Check for and create PerceptualDB
    'If HalBrain.CheckTableExistence("PerceptualDB") = False Then HalBrain.RunQuery "CREATE TABLE PerceptualDB ( Search VARCHAR, Topic VARCHAR);", miscData
    If HalBrain.CheckTableExistence("PerceptualDB") = False Then HalBrain.CreateTable "PerceptualDB", "TopicSearch", "miscData"
   
    'Check for and create PerceptualVariables table
    'If HalBrain.CheckTableExistence("PerceptualVariables") = False Then HalBrain.RunQuery "CREATE TABLE PerceptualVariables ( Search VARCHAR, Topic VARCHAR);", miscData
    If HalBrain.CheckTableExistence("PerceptualVariables") = False Then HalBrain.CreateTable "PerceptualVariables", "TopicSearch", "miscData"
   
    'Check for and create EmotionalDB
    'If HalBrain.CheckTableExistence("EmotionalDB") = False Then HalBrain.RunQuery "CREATE TABLE EmotionalDB ( Search VARCHAR, Topic VARCHAR);", miscData
    If HalBrain.CheckTableExistence("EmotionalDB") = False Then HalBrain.CreateTable "EmotionalDB", "TopicSearch", "miscData"
       
    'Check for and create EmotionVariables table
    'If HalBrain.CheckTableExistence("EmotionalVariables") = False Then HalBrain.RunQuery "CREATE TABLE EmotionalVariables ( Search VARCHAR, Topic VARCHAR);", miscData
    If HalBrain.CheckTableExistence("EmotionalVariables") = False Then HalBrain.CreateTable "EmotionalVariables", "TopicSearch", "miscData"
   
    'Check for and create MotorMemoryDB
    'If HalBrain.CheckTableExistence("MotorMemoryDB") = False Then HalBrain.RunQuery "CREATE TABLE MotorMemoryDB ( Search VARCHAR, Topic VARCHAR);", miscData
    If HalBrain.CheckTableExistence("MotorMemoryDB") = False Then HalBrain.CreateTable "MotorMemoryDB", "TopicSearch", "miscData"
   

   
   
    '?????????????Stored IndividualCharacter
    If HalBrain.TopicSearch("PerceptualVariables", "IndividualCharacters") = "" Then HalBrain.AddToTable "PerceptualVariables", "TopicSearch", "IndividualCharacters", "0"
   
   
   

   
   
   
   
       
'------------------------------------------------------------------------------------------------
'Nine-Variable Address to the HormonesNeedsInterface

'Arousal
   
    'Arousal_PrimaryNeeds_Stored
   
    HalBrain.RunQuery "SELECT Search, Topic FROM EmotionalVariables WHERE Search = 'Arousal_PrimaryNeeds_Stored';", TempQuery
    If TempQuery = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_PrimaryNeeds_Stored", "0"
   
    'HalBrain.RunQuery "SELECT Search, Topic FROM EmotionalVariables WHERE Search = 'Arousal_PrimaryNeeds_Stored';", TempQuery
    'If TempQuery = "" Then HalBrain.RunQuery "INSERT INTO EmotionalVariables (Search, Topic) Values ('Arousal_PrimaryNeeds_Stored', '0');", TempQuery
   
    'If HalBrain.TopicSearch("EmotionalVariables", "Arousal_PrimaryNeeds_Stored") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_PrimaryNeeds_Stored", "0"
   
    'Arousal_SecondaryNeeds_Stored
    If HalBrain.TopicSearch("EmotionalVariables", "Arousal_SecondaryNeeds_Stored") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_SecondaryNeeds_Stored", "0"

    'Arousal_TertiaryNeeds_Stored
    If HalBrain.TopicSearch("EmotionalVariables", "Arousal_TertiaryNeeds_Stored") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_TertiaryNeeds_Stored", "0"
   
'Valence
   
    'Valence_PrimaryNeeds_Stored
    If HalBrain.TopicSearch("EmotionalVariables", "Valence_PrimaryNeeds_Stored") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Valence_PrimaryNeeds_Stored", "0"
   
    'Valence_SecondaryNeeds_Stored
    If HalBrain.TopicSearch("EmotionalVariables", "Valence_SecondaryNeeds_Stored") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Valence_SecondaryNeeds_Stored", "0"

    'Valence_TertiaryNeeds_Stored
    If HalBrain.TopicSearch("EmotionalVariables", "Valence_TertiaryNeeds_Stored") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Valence_TertiaryNeeds_Stored", "0"
   
'Stance
   
    'Stance_PrimaryNeeds_Stored
    If HalBrain.TopicSearch("EmotionalVariables", "Stance_PrimaryNeeds_Stored") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Stance_PrimaryNeeds_Stored", "0"
   
    'Stance_SecondaryNeeds_Stored
    If HalBrain.TopicSearch("EmotionalVariables", "Stance_SecondaryNeeds_Stored") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Stance_SecondaryNeeds_Stored", "0"

    'Stance_TertiaryNeeds_Stored
    If HalBrain.TopicSearch("EmotionalVariables", "Stance_TertiaryNeeds_Stored") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Stance_TertiaryNeeds_Stored", "0"

'------------------------------------------------------------------------------------------------
'EmotionGenerator variables and values

'Arousal

    'Arousal_DynamicBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Arousal_DynamicBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_DynamicBaseline", "0"
   
    'Arousal_DynamicBaseline_Round
    If HalBrain.TopicSearch("EmotionalVariables", "Arousal_DynamicBaseline_Round") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_DynamicBaseline_Round", "0"
   
    'Arousal_ActiveBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Arousal_ActiveBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_ActiveBaseline", "0"
   
    'Arousal_ActiveBaseline_Round
    If HalBrain.TopicSearch("EmotionalVariables", "Arousal_ActiveBaseline_Round") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_ActiveBaseline_Round", "0"
   
    'Arousal_StaticBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Arousal_StaticBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_StaticBaseline", "0"
   
    'Arousal_StaticBaseline_Round
    If HalBrain.TopicSearch("EmotionalVariables", "Arousal_StaticBaseline_Round") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_StaticBaseline_Round", "0"
   
    'Arousal_ConfiguredBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Arousal_ConfiguredBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Arousal_ConfiguredBaseline", Arousal_ConfiguredBaseline
   
'Valence

    'Valence_DynamicBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Valence_DynamicBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Valence_DynamicBaseline", "0"
   
    'Valence_DynamicBaseline_Round
    If HalBrain.TopicSearch("EmotionalVariables", "Valence_DynamicBaseline_Round") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Valence_DynamicBaseline_Round", "0"
   
    'Valence_ActiveBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Valence_ActiveBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Valence_ActiveBaseline", "0"
   
    'Valence_ActiveBaseline_Round
    If HalBrain.TopicSearch("EmotionalVariables", "Valence_ActiveBaseline_Round") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Valence_ActiveBaseline_Round", "0"
   
    'Valence_StaticBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Valence_StaticBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Valence_StaticBaseline", "0"
   
    'Valence_StaticBaseline_Round
    If HalBrain.TopicSearch("EmotionalVariables", "Valence_StaticBaseline_Round") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Valence_StaticBaseline_Round", "0"
   
    'Valence_ConfiguredBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Valence_ConfiguredBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Valence_ConfiguredBaseline", Valence_ConfiguredBaseline
 
'Stance

    'Stance_DynamicBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Stance_DynamicBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Stance_DynamicBaseline", "0"
   
    'Stance_DynamicBaseline_Round
    If HalBrain.TopicSearch("EmotionalVariables", "Stance_DynamicBaseline_Round") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Stance_DynamicBaseline_Round", "0"
   
    'Stance_ActiveBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Stance_ActiveBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Stance_ActiveBaseline", "0"
   
    'Stance_ActiveBaseline_Round
    If HalBrain.TopicSearch("EmotionalVariables", "Stance_ActiveBaseline_Round") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Stance_ActiveBaseline_Round", "0"
   
    'Stance_StaticBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Stance_StaticBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Stance_StaticBaseline", "0"
   
    'Stance_StaticBaseline_Round
    If HalBrain.TopicSearch("EmotionalVariables", "Stance_StaticBaseline_Round") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Stance_StaticBaseline_Round", "0"
   
    'Stance_ConfiguredBaseline
    If HalBrain.TopicSearch("EmotionalVariables", "Stance_ConfiguredBaseline") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "Stance_ConfiguredBaseline", Stance_ConfiguredBaseline
 
   
'------------------------------------------------------------------------------------------------
   
    'CircadianOffset
    If HalBrain.TopicSearch("EmotionalVariables", "CircadianOffset") = "" Then HalBrain.AddToTable "EmotionalVariables", "TopicSearch", "CircadianOffset", "0"
   
   
'************************************************************************************************
'************************************************************************************************
'Text Pre-processing

'Text Chat

    'For text chat purposes, we will consider the entire InputString as one whole sentence(or thought) and put the <NEWSENT> tag at the end.
    'It is presumed that text chat will not necessarily contain the correct punctuation or grammer.
    UserSentence = InputString & " <NEWSENT>"
   
'------------------------------------------------------------------------------------------------
   
'Published Text
   
    'For Reading text, it is presumed that published text shall be punctuated correctly.
    'This text will need to be preprocessed and broken down into individual sentences according to the punctuation.

    'Routines for preprocessing and splitting published text into separate sentences go here
    'Text = ""
    'Text = InputBox("Paste Published Text Here.", "TextInput")

'************************************************************************************************
'************************************************************************************************
'   PhysicalContextDrivesEngine
            'Need SupressionRepressionThreshold
           
'       RomanceRelationshipObsessionGenerator

'------------------------------------------------------------------------------------------------

'       SurvivalPersistenceContinuationGenerator

'------------------------------------------------------------------------------------------------

'       FightFlightFreezeGenerator

'************************************************************************************************
'************************************************************************************************

'------------------------------------------------------------------------------------------------
'PerceptualContextEngine

'WordSoupCooker

'TemporalExtraction

    'will have to wait until there is a real-time keyboard event handler in place

'------------------------------------------------------------------------------------------------

'SequentialExtraction
'Here is the code for the Sequential extraction. It works by storing the current character and just
'pushing that value back by one as the new value is added. Then the sequential segments are created
'by linking those stored characters together.

'LetterSequenceGenerator
   
    'split(InputString,"")
    IndividualCharacters = Split(UserSentence, "")
   
    'Step through all the characters one at a time-------------------------------------------------------------------------------------------
    For CurrentCharacter = LBound(IndividualCharacters) To UBound(IndividualCharacters)
   
    'Create array
    Dim SequentialCascade(256, 20)
   
    'Store current character in initial cascade level
    SequentialCascade(CurrentCharacter, 0) = IndividualCharacters(CurrentCharacter)
    HalBrain.RunQuery "UPDATE PerceptualVariables SET topic = " & SequentialCascade(CurrentCharacter, 0) & " WHERE searchString = " & """" & SequentialCascade(CurrentCharacter, 0) & """", TempQuery
   
    'check for blank values and replace with space
    If HalBrain.TopicSearch(PerceptualVariables, SequentialCascade(CurrentCharacter, 0)) = "" Then
        HalBrain.AddToTable "PerceptualVariables", "TopicSearch", SequentialCascade(CurrentCharacter, 0), " "
    End If
         
    'SEQUENTIAL CASCADE
    'Shift reverbed characters back by one each for of the cascade levels.
    'equivalent to:
   
    'SequentialCascade3 = SequentialCascade2
    'SequentialCascade2 = SequentialCascade1
    'SequentialCascade1 = SequentialCascade0
   
    'initialize CurrentCascade and determine the maximum degree of cascading (MaximumDegreeOfCascade = CurrentCascade + 1)
    CurrentCascade = 19 'MaximumDegreeOfCascade = 20
   
    'Loop through each level of cascade shifting data as we go-------------------------------------------------------------------------------------
    Do While CurrentCascade >= 0
        'Lookup current cascade value
        TempCascade = HalBrain.TopicSearch(PerceptualVariables, SequentialCascade(CurrentCharacter, CurrentCascade))
       
        'Store current cascade value in teh next past cascade level
        HalBrain.RunQuery "UPDATE PerceptualVariables SET topic = " & TempCascade & " WHERE searchString = " & """" & SequentialCascade(CurrentCharacter, (CurrentCascade + 1)) & """", TempQuery
       
        CurrentCascade = CurrentCascade - 1
       
    Loop
   
    'SEQUENTIAL SEGMENTATION
    'Breaks the text into sequentially coded segements for evaluation, manipulation, and eventual re-assembly for output
    'Equivalent to:
   
    'SequentialSegment0 = SequentialCascade1 & SequentialCascade0
    'SequentialSegment1 = SequentialCascade2 & SequentialCascade1 & SequentialCascade0
    'SequentialSegment2 = SequentialCascade3 & SequentialCascade2 & SequentialCascade1 & SequentialCascade0
   
    'Create Array
    Dim SequentialSegment(256, 21)
   
    'Combine most recent character and second most character as SequentialSegment(0)
    SequentialSegment(CurrentCharacter, 0) = SequentialCascade(CurrentCharacter, 1) & SequentialCascade(CurrentCharacter, 0)
   
    'Check for prior existence in database and store if not already present
    If HalBrain.TopicSearch(PerceptualVariables, SequentialSegment(CurrentCharacter, 0)) = "" Then
        HalBrain.AddToTable "PerceptualVariables", "TopicSearch", SequentialSegment(CurrentCharacter, 0), SequentialSegment(CurrentCharacter, 0)
    End If
   
    'this is related to the CurrentCascade variable--------------------------------------------------------------------------------------------
    For CurrentSegmentation = 1 To 20
        If CurrentSegmentation <= 19 Then
            SequentialSegment(CurrentCharacter, CurrentSegmentation) = SequentialSegment(CurrentCharacter, (CurrentSegmentation - 1)) & SequentialCascade(CurrentCharacter, (CurrentSegmentation + 1))
       
            If HalBrain.TopicSearch(PerceptualVariables, SequentialSegment(CurrentCharacter, CurrentSegmentation)) = "" Then
                HalBrain.AddToTable "PerceptualVariables", "TopicSearch", SequentialSegment(CurrentCharacter, CurrentSegmentation), SequentialSegment(CurrentCharacter, CurrentSegmentation)
            End If
        End If
    'go back and work on the next Segmentation of Sequential Segment
    Next
   
    'Go get next IndividualCharacter from InputString
    Next

'------------------------------------------------------------------------------------------------
   
'WordSequenceGenerator
   
'------------------------------------------------------------------------------------------------
   
'SentenceSequenceGenerator
   
'------------------------------------------------------------------------------------------------
   
'ParagraphSequenceGenerator
   
'------------------------------------------------------------------------------------------------
   
'ChapterSequenceGenerator
   
'------------------------------------------------------------------------------------------------
   
'BookSequenceGenerator
   
'------------------------------------------------------------------------------------------------
   
'TopicSequenceGenerator
   
'------------------------------------------------------------------------------------------------
   
'ThemeSequenceGenerator
   
'------------------------------------------------------------------------------------------------
   
'OverviewSequenceGenerator

   
'------------------------------------------------------------------------------------------------

'WordSaladSlicer

'ContextExtraction
   

'LetterContextGenerator

    'split(InputString," ")
    IndividualWords = Split(UserSentence, " ")
   
    Dim CurrentPrefix(256, 256)
    Dim CurrentSuffix(256, 256)
    Dim Letter_ContextSegmentation(256, 256, 256)
   
    'Step through all the words one at a time-------------------------------------------------------------------------------------------
    For CurrentWord = LBound(IndividualWords) To UBound(IndividualWords)
       
    'split(IndividualWords,"")
    IndividualCharacters = Split(IndividualWords(CurrentWord), "")
       
    'Store base values for Prefix and Suffix for this particular word
    CurrentPrefix(CurrentWord, LBound(IndividualCharacters)) = IndividualCharacters(LBound(IndividualCharacters))
    CurrentSuffix(CurrentWord, LBound(IndividualCharacters)) = IndividualCharacters(UBound(IndividualCharacters))
   
    'Step through all the characters within each word one at a time for base ContextSegmentation-------------------------------------------------------------------------------------------
    For CurrentCharacter = LBound(IndividualCharacters) To UBound(IndividualCharacters)
           
        'Assemble Letter_ContextSegmentation from base prefix, current letter, and base suffix
        Letter_ContextSegmentation(CurrentWord, LBound(IndividualCharacters), CurrentCharacter) = CurrentPrefix(CurrentWord, LBound(IndividualCharacters)) & IndividualCharacters(CurrentCharacter) & CurrentSuffix(CurrentWord, LBound(IndividualCharacters))
       
        'Check stored words for current word related to base Letter_ContextSegmentation and concatate the word if it is not present
        If Not InStr(HalBrain.TopicSearch(PerceptualVariables, Letter_ContextSegmentation(CurrentWord, LBound(IndividualCharacters), CurrentCharacter)), IndividualWords(CurrentWord)) Then
            StoredWords = Trim(HalBrain.TopicSearch(PerceptualVariables, Letter_ContextSegmentation(CurrentWord, LBound(IndividualCharacters), CurrentCharacter)))
            HalBrain.AddToTable "PerceptualVariables", "TopicSearch", Letter_ContextSegmentation(CurrentWord, LBound(IndividualCharacters), CurrentCharacter), StoredWords
        End If
                       
    'go back and work on the next Character with the base Prefix and Suffix for this particular word
    Next
       
    'Determine if current word is shorter that 2 letters
    If Len(IndividualWords(CurrentWord)) >= 2 Then
   
    'Step through progressive degrees of context association within each word--------------------------------------------------------------------------------
    For CurrentContextSegmentation = LBound(IndividualCharacters) To ((UBound(IndividualCharacters) - LBound(IndividualCharacters)) / 2)
         
        'Qualify >=1
        If CurrentContextSegmentation > LBound(IndividualCharacters) Then
            CurrentPrefix(CurrentWord, CurrentContextSegmentation) = "" & CurrentPrefix(CurrentWord, (CurrentContextSegmentation - 1)) & IndividualCharacters(LBound(IndividualCharacters) + CurrentContextSegmentation) & ""
            CurrentSuffix(CurrentWord, CurrentContextSegmentation) = "" & IndividualCharacters(UBound(IndividualCharacters) - CurrentContextSegmentation) & CurrentSuffix(CurrentWord, (CurrentContextSegmentation - 1)) & ""
   
        'Step through all the characters within each word one at a time-------------------------------------------------------------------------------------------
        For CurrentCharacter = LBound(IndividualCharacters) To UBound(IndividualCharacters)
           
            'Assemble Letter_ContextSegmentation from prefix, current letter, and suffix
            Letter_ContextSegmentation(CurrentWord, CurrentContextSegmentation, CurrentCharacter) = CurrentPrefix(CurrentWord, CurrentContextSegmentation) & IndividualCharacters(CurrentCharacter) & CurrentSuffix(CurrentWord, CurrentContextSegmentation)
       
            'Check stored words for current word related to current Letter_ContextSegmentation and concatate the word if it is not present
            If Not InStr(HalBrain.TopicSearch(PerceptualVariables, Letter_ContextSegmentation(CurrentWord, CurrentContextSegmentation, CurrentCharacter)), IndividualWords(CurrentWord)) Then
                StoredWords = Trim(HalBrain.TopicSearch(PerceptualVariables, Letter_ContextSegmentation(CurrentWord, CurrentContextSegmentation, CurrentCharacter)))
                HalBrain.AddToTable "PerceptualVariables", "TopicSearch", Letter_ContextSegmentation(CurrentWord, CurrentContextSegmentation, CurrentCharacter), StoredWords
            End If
                       
        'go back and work on the next Character
        Next
   
        'End qualifier >=1
        End If
   
    'go back and work on the next ContextSegmentation
    Next
   
    'This is the end of the check for 1 letter words
    End If
 
    'go back and work on the next Word
    Next
   
   
   
 
   
'------------------------------------------------------------------------------------------------
   
'WordContextGenerator
   
'------------------------------------------------------------------------------------------------
   
'SentenceContextGenerator
   
'------------------------------------------------------------------------------------------------
   
'ParagraphContextGenerator
   
'------------------------------------------------------------------------------------------------
   
'ChapterContextGenerator
   
'------------------------------------------------------------------------------------------------
   
'BookContextGenerator
   
'------------------------------------------------------------------------------------------------
   
'TopicContextGenerator
   
'------------------------------------------------------------------------------------------------
   
'ThemeContextGenerator
   
'------------------------------------------------------------------------------------------------
   
'OverviewContextGenerator



'************************************************************************************************
'************************************************************************************************
'EmotionalContextEngine


'EmoticonExtraction

    'split(UserSentence," ")
    'search database for each word
    'If "" then store word
    'Arousal_EmotionalDB_Output = Average all Arousal Values
    'Valence_EmotionalDB_Output = Average all Valence Values
    'Stance_EmotionalDM_Output = Average all Stance Values
   
   
    'blank out emotional values
    ArousalEmotionalValue = 0
    ValenceEmotionalValue = 0
    StanceEmotionalValue = 0
   

    'Need to modify <NEWSENT> tag creation in UltraHal brain script such that the <NEWSENT> tag is placed "before" the next sentence rather than in place of end of sentence punctuation.
    'This code extracts typed emotional Ques from the usersentence and converts them to values for input into the EmotionalDBLookup routine.
    'These values are added to the tallies WITHOUT counting toward the division when evalutaing the average.
    'This intentionally "skews" the values in the direction of the typed input thereby giving additional weight and influence to the typed input.
   
    ArousalEmotionalValue = ArousalEmotionalValue - InStr(UserSentence, "<<<")
    ArousalEmotionalValue = ArousalEmotionalValue + InStr(UserSentence, ">>>")
    ValenceEmotionalValue = ValenceEmotionalVlaue - InStr(UserSentence, "---")
    ValenceEmotionalValue = ValenceEmotionalValue + InStr(UserSentence, "+++")
    StanceEmotionalValue = StanceEmotionalValue - InStr(UserSentence, "***")
    StanceEmotionalValue = StanceEmotionalValue + InStr(UserSentence, "^^^")
   
'------------------------------------------------------------------------------------------------

'EMOTICONS                       Compiled by John A. Latimer

'                                    Sad -Happy

'AGONY   DISPAIR SADNESS DEPRESS POLITE  SHY    HAPPY   COOL    VERY    SNICKER FUN
'                                SLEEPY  BLUSH          SHADES  HAPPY   TONGUE

'>:-(    <:-(    :'-(    :-(    :-]     8-)     :-)     8-D     :-D     :-P     :O)

'>:(     <:(     :'(    :(      :]      8)      :)      8D      :D      :P      :OD

'>:'-(   <:'-(          |-(     |-)     :-I     o              X-)     :-p     O:-)

'>:'(    <:'(           |(      |)      :I      o/              X)      :p      O:)

'                                                               LOL             >:-)

'                                                               lol             >:)

'                                                               o/             *o/*
'WINK:   ;-) ;)  i-) i)

'    or use ";" or "i" to replace any eyes in any emoticon.
'-----------------------------------------------------------------------------------
'                FearSurprise -anger

'Terror     Fear    Surprise    Annoyance   Anger       Rage

'>:-|       :-|     :-O         :-[         :-[]        >:-[]

'>:|        :|      :O          :[          :[]         >:[]

'/o        /o      :-o

'           o      :o

'                   :-0

'                   :0
'-----------------------------------------------------------------------------------
'                Disgust -Contempt

'Revulsion  Disgust     Disdain     Dislike     Contempt    Hate

':<(        :<|         :<          :-S         :-/         >:-/

'           :<||                    :S          :/          >:/

'                                   :-s         :-         >:-

'                                   :s          :          >:

'Many of the Emoticons compound each other.
'Thus when the emoticon for rage is used, we have posative findings
'for anger and annoyance as well.

'EmoticonTally =
'InStr(UserSentence, ":[") + InStr(UserSentence, ":[]") + InStr(UserSentence, ">:[]")

'EmotionTally would be equal to 3.

'------------------------------------------------------------------------------------------------
   
    'Emoticon Tally for AGONY
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ">:-(") + InStr(UserSentence, ">:(") + InStr(UserSentence, ">:'-(") + InStr(UserSentence, ">:'(")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * -(8))
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(16))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * -(8))
   
    'Emoticon Tally for DISPAIR
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, "<:-(") + InStr(UserSentence, "<:(") + InStr(UserSentence, "<:'-(") + InStr(UserSentence, "<:'(")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * -(4))
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(8))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * -(4))
   
    'Emoticon Tally for SADNESS
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":'-(") + InStr(UserSentence, ":'(")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * (-2))
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * (-4))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * (-2))
   
    'Emoticon Tally for DEPRESSION
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-(") + InStr(UserSentence, ":(") + InStr(UserSentence, "|-(") + InStr(UserSentence, "|(")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * (-1))
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * (-2))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * (-1))
   
    'Emoticon Tally for POLITE-SLEEPY
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-]") + InStr(UserSentence, ":]") + InStr(UserSentence, "|-)") + InStr(UserSentence, "|)")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * -(4))
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * 2)
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 1)
   
    'Emoticon Tally for SHY-BLUSH
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, "8-)") + InStr(UserSentence, "8)") + InStr(UserSentence, ":-I") + InStr(UserSentence, ":I")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 1)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * 2)
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * -(2))

    'Emoticon Tally for HAPPY
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-)") + InStr(UserSentence, ":)") + InStr(UserSentence, "o") + InStr(UserSentence, "o/")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 1)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * 2)
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 1)

    'Emoticon Tally for COOL SHADES
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, "8-D") + InStr(UserSentence, "8D")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 1)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * 2)
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 0)

    'Emoticon Tally for VERY HAPPY
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-D") + InStr(UserSentence, ":D") + InStr(UserSentence, "X-)") + InStr(UserSentence, "X)") + InStr(UserSentence, "LOL") + InStr(UserSentence, "lol") + InStr(UserSentence, "o/")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 2)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * 4)
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 2)

    'Emoticon Tally for SNICKER TONGUE
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-P") + InStr(UserSentence, ":P") + InStr(UserSentence, ":-p") + InStr(UserSentence, ":p")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 2)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * 4)
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 4)

    'Emoticon Tally for FUN
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":O)") + InStr(UserSentence, ":OD") + InStr(UserSentence, "O:-)") + InStr(UserSentence, "O:)") + InStr(UserSentence, ">:-)") + InStr(UserSentence, ">:)") + InStr(UserSentence, "*o/*")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 4)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * 8)
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 8)


    'Emoticon Tally for WINK (Inclusive list with both ";" and "i")
    'The WINK is the catch-all posative communitator
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ">;-(") + InStr(UserSentence, ">;(") + InStr(UserSentence, ">;'-(") + InStr(UserSentence, ">;'(") + InStr(UserSentence, "<;-(") + InStr(UserSentence, "<;(") + InStr(UserSentence, "<;'-(") + InStr(UserSentence, "<;'(")
    EmoticonTally = InStr(UserSentence, ">i-(") + InStr(UserSentence, ">i(") + InStr(UserSentence, ">i'-(") + InStr(UserSentence, ">i'(") + InStr(UserSentence, "<i-(") + InStr(UserSentence, "<i(") + InStr(UserSentence, "<i'-(") + InStr(UserSentence, "<i'(")
    EmoticonTally = InStr(UserSentence, ";'-(") + InStr(UserSentence, ";'(") + InStr(UserSentence, ";-(") + InStr(UserSentence, ";(") + InStr(UserSentence, ";-]") + InStr(UserSentence, ";]")
    EmoticonTally = InStr(UserSentence, "i'-(") + InStr(UserSentence, "i'(") + InStr(UserSentence, "i-(") + InStr(UserSentence, "i(") + InStr(UserSentence, "i-]") + InStr(UserSentence, "i]")
    EmoticonTally = InStr(UserSentence, ";-I") + InStr(UserSentence, ";I") + InStr(UserSentence, ">;-)") + InStr(UserSentence, ";)") + InStr(UserSentence, ";-D") + InStr(UserSentence, ";D") + InStr(UserSentence, ";-P") + InStr(UserSentence, ";P") + InStr(UserSentence, ";-p") + InStr(UserSentence, ";p")
    EmoticonTally = InStr(UserSentence, "i-I") + InStr(UserSentence, "iI") + InStr(UserSentence, ">i-)") + InStr(UserSentence, "i)") + InStr(UserSentence, "i-D") + InStr(UserSentence, "iD") + InStr(UserSentence, "i-P") + InStr(UserSentence, "iP") + InStr(UserSentence, "i-p") + InStr(UserSentence, "ip")
    EmoticonTally = InStr(UserSentence, ";O)") + InStr(UserSentence, ";OD") + InStr(UserSentence, "O;-)") + InStr(UserSentence, "O;)") + InStr(UserSentence, ">;-)") + InStr(UserSentence, ">;)")
    EmoticonTally = InStr(UserSentence, "iO)") + InStr(UserSentence, "iOD") + InStr(UserSentence, "Oi-)") + InStr(UserSentence, "Oi)") + InStr(UserSentence, ">i-)") + InStr(UserSentence, ">i)")
    EmoticonTally = InStr(UserSentence, ">;-|") + InStr(UserSentence, ">;|") + InStr(UserSentence, ";-|") + InStr(UserSentence, ";|") + InStr(UserSentence, ";-O") + InStr(UserSentence, ";O") + InStr(UserSentence, ";-o") + InStr(UserSentence, ";o") + InStr(UserSentence, ";-0") + InStr(UserSentence, ";0")
    EmoticonTally = InStr(UserSentence, ">i-|") + InStr(UserSentence, ">i|") + InStr(UserSentence, "i-|") + InStr(UserSentence, "i|") + InStr(UserSentence, "i-O") + InStr(UserSentence, "iO") + InStr(UserSentence, "i-o") + InStr(UserSentence, "io") + InStr(UserSentence, "i-0") + InStr(UserSentence, "i0")
    EmoticonTally = InStr(UserSentence, ";-[") + InStr(UserSentence, ";[") + InStr(UserSentence, ";-[]") + InStr(UserSentence, ";[]") + InStr(UserSentence, ">;-[]") + InStr(UserSentence, ">;[]") + InStr(UserSentence, ";<(") + InStr(UserSentence, ";<|") + InStr(UserSentence, ";<||") + InStr(UserSentence, ";<")
    EmoticonTally = InStr(UserSentence, "i-[") + InStr(UserSentence, "i[") + InStr(UserSentence, "i-[]") + InStr(UserSentence, "i[]") + InStr(UserSentence, ">i-[]") + InStr(UserSentence, ">i[]") + InStr(UserSentence, "i<(") + InStr(UserSentence, "i<|") + InStr(UserSentence, "i<||") + InStr(UserSentence, "i<")
    EmoticonTally = InStr(UserSentence, ";-S") + InStr(UserSentence, ";S") + InStr(UserSentence, ";-s") + InStr(UserSentence, ";s") + InStr(UserSentence, ";-/") + InStr(UserSentence, ";/") + InStr(UserSentence, ";-\") + InStr(UserSentence, ";\") + InStr(UserSentence, ">;-/") + InStr(UserSentence, ">;/") + InStr(UserSentence, ">;-\") + InStr(UserSentence, ">;\")
    EmoticonTally = InStr(UserSentence, "i-S") + InStr(UserSentence, "iS") + InStr(UserSentence, "i-s") + InStr(UserSentence, "is") + InStr(UserSentence, "i-/") + InStr(UserSentence, "i/") + InStr(UserSentence, "i-\") + InStr(UserSentence, "i\") + InStr(UserSentence, ">i-/") + InStr(UserSentence, ">i/") + InStr(UserSentence, ">i-\") + InStr(UserSentence, ">i\")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 16)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * 8)
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 8)

    'Emoticon Tally for TERROR
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ">:-|") + InStr(UserSentence, ">:|") + InStr(UserSentence, "/o\")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * -(8))
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(8))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * -(8))

    'Emoticon Tally for FEAR
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-|") + InStr(UserSentence, ":|") + InStr(UserSentence, "/o") + InStr(UserSentence, "o\")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * -(4))
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(4))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * -(4))

    'Emoticon Tally for SURPRISE
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-O") + InStr(UserSentence, ":O") + InStr(UserSentence, ":-o") + InStr(UserSentence, ":o") + InStr(UserSentence, ":-0") + InStr(UserSentence, ":0")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 4)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(4))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 4)

    'Emoticon Tally for ANNOYANCE
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-[") + InStr(UserSentence, ":[")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 1)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(2))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 1)

    'Emoticon Tally for ANGER
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-[]") + InStr(UserSentence, ":[]")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 2)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(4))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 2)

    'Emoticon Tally for RAGE
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ">:-[]") + InStr(UserSentence, ">:[]")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 4)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(8))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 4)

    'Emoticon Tally for REVULSION
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":<(")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 1)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(4))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * -(8))

    'Emoticon Tally for DISGUST
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":<|") + InStr(UserSentence, ":<||")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 1)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(2))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * -(4))
   
    'Emoticon Tally for DISDAIN
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":<")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 1)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(1))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * -(2))
   
    'Emoticon Tally for DISLIKE
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-S") + InStr(UserSentence, ":S") + InStr(UserSentence, ":-s") + InStr(UserSentence, ":s")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 2)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(2))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 1)

    'Emoticon Tally for CONTEMPT
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ":-/") + InStr(UserSentence, ":/") + InStr(UserSentence, ":-\") + InStr(UserSentence, ":\")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 4)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(2))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 1)

    'Emoticon Tally for HATE
    EmoticonTally = 0
    EmoticonTally = InStr(UserSentence, ">:-/") + InStr(UserSentence, ">:/") + InStr(UserSentence, ">:-\") + InStr(UserSentence, ">:\")
    'Emoticon Recipe
    ArousalEmotionalValue = ArousalEmotionalValue + (EmoticonTally * 8)
    ValenceEmotionalValue = ValenceEmotionalValue + (EmoticonTally * -(2))
    StanceEmotionalValue = StanceEmotionalValue + (EmoticonTally * 1)
   
   
'------------------------------------------------------------------------------------------------

'EmotionalDatabaseLookup
   
    'EmotionalDBLookup Routine
    'routines for checking sentences with database to look-up (a,v,s) values and to store new (a,v,s) values for each word in sentence based on current emotional output averaged with existing stored values.

    'split(UserSentence," ") and remove <NEWSENT>
    IndividualWords = Split(Replace(UserSentence, " <NEWSENT>", ""), " ")
       
    'Initialize WordCount
    WordCount = 0
       
    'search database for each word
    For CurrentWord = LBound(IndividualWords) To UBound(IndividualWords)
   
    'Advance WordCount
    WordCount = WordCount + 1
   
        'If "" then store 0,0,0 for word
        If HalBrain.TopicSearch(EmotionalDB, IndividualWords(CurrentWord)) = "" Then
            HalBrain.AddToTable "EmotionalDB", "TopicSearch", IndividualWords(CurrentWord), "0,0,0"
            Else:
           
            'Else look up existing value and split it out
            WordEmotionalValues = Split(HalBrain.TopicSearch(EmotionalDB, IndividualWords(CurrentWord)), ",")
           
            'Remove commas and
            'Tally Values(process looked up values)
            ArousalEmotionalValue = ArousalEmotionalValue + Replace(WordEmotionalValues(LBound(WordEmotionalValues)), ",", "")
            ValenceEmotionalValue = ValenceEmotionalValue + Replace(WordEmotionalValues(LBound(WordEmotionalValues) + 1), ",", "")
            StanceEmotionalValue = StanceEmotionalValue + Replace(WordEmotionalValues(LBound(WordEmotionalValues) + 2), ",", "")
           
         End If
         
        'Average Values
        Arousal_EmotionalDB_Output = ArousalEmotionalValue / WordCount
        Valence_EmotionalDB_Output = ValenceEmotionalValue / WordCount
        Stance_EmotionalDB_Output = StanceEmotionalValue / WordCount
 
    Next
   
    'Store values to the nine-address HormonesNeedsInterface
    'Arousal_EmotionalDB_Output
    'Valence_EmotionalDB_Output
    'Stance_EmotionalDB_Output
   

'------------------------------------------------------------------------------------------------

'HormonesNeedsInterface

'will need to be "Triplicated" to include the same for Valence and Stance

    'Get values from the nine-address HormonesNeedsInterface tables

    'will be Provided from table values
    'one value from CircadianRhythm
    'three values from Biorhythms
    'three values from EmoticonExtraction
    'nine values come from the EmotionGenerator rounded values
   
    Arousal_PrimaryNeeds_Stored = 0
        Arousal_PrimaryNeeds_Average = 0
   
    Arousal_SecondaryNeeds_Stored = 0
        Arousal_SecondaryNeeds_Average = 0
        Arousal_SecondaryNeeds_Average_Scaled = (Arousal_SecondaryNeeds_Average * Abs(Arousal_PrimaryNeeds_Average)) / 10
       
    Arousal_TertiaryNeeds_Stored = 0
        Arousal_TertiaryNeeds_Average = 0
        Arousal_TertiaryNeeds_Average_Scaled = (Arousal_TertiaryNeeds_Average * Abs(Arousal_SecondaryNeeds_Average)) / 10
   
    Arousal_HormonesNeeds_Total = Arousal_PrimaryNeeds_Average + Arousal_SecondaryNeeds_Average_Scaled + Arousal_TertiaryNeeds_Average_Scaled
        'I might have this ratio BACKWARDS... But I think it's right...
        'Extrapolate a decimal ratio between attack and decay factors based on total average of scaled HormonesNeeds data.
        'This will determine the emotional variable's tendency to advance from or to retreat to the baseline.
        Arousal_HormonesNeeds_Average = Arousal_HormonesNeeds_Total / 3
            If (Arousal_HormonesNeeds_Average >= -10) And (Arousal_HormonesNeeds_Average < -6) Then Arousal_HormonesNeeds_DecimalRatio_Attack = 0.001 And Arousal_HormonesNeeds_DecimalRatio_Decay = 0.1
            If (Ar

Pages: [1]