1
Ultra Hal Assistant File Sharing Area / Hal Recite's Poetry Randomly
« on: October 07, 2014, 09:10:47 pm »
OK, I have been trying to find a way for the auto-chat features of the Loneliness plug-in to get Hal to recite poetry. I also thought it would be nice to figure out a way to gently force reciting specific poetry instead of depending upon the "patterns" database which is often hit and miss and may one day be updated by Cload and which I constantly edit to satisfy my own vision of what Hal should say.
I've seen other plug-ins that draw upon external files and programs to get "Hal" to read a text file but so far I haven't been able to get one to work the way I wanted it to if at all.
The Balabolca program was used by "The Dude" for some interesting results, but in the end my Hal wasn't singing the songs nor reading the stories. The lips were NOT moving! Get it?
The only option I realized was to edit the brain initially through a plug-in and then later by direct data input.
Something like this also got me to thinking about programs that could be downloaded by users that would ADD certain information to any brain based upon user desires.
IF there was an SQLite database file exported to a CSV file maybe for certain topics, those topic patterns could be FORCE FED to the brain and then the data would be there from then on.
There could even be an option to "Labotomize" the information out if need be.
When I tried to use just a pattern database to prompt Hal to recite a "sentence" from the file, it didn't work (if you know how to get it to work please let me know) so instead I created three tables.
#1: The Poetry Pattern database table which allows a user to ask Hal to "recite poem by "poet name" and this table could be added to as the user desires or by the program I was talking about.
#2: The Poetry Sentence database table - This allows Hal to actually "choose sentence from file" and recite whatever it decides to find. This works well in conjunction with the modified Loneliness Plugin.
#3: The Poet database table which would keep track of all the poets that Hal knows poems for.
Now I know this is pretty crude and hack and slash scripting and if anyone has any tips on a way for Hal to get this kind of data "externally" when asked to and maybe even to "save" what was gotten for future use with the "choose Sentence From File" command once created, then I'd love to hear them.
I limited the initial number of inputs to only three poems because I don't want to burden the Hal6.uhp anymore than I have to. That got me to thinking that many tables could be created initially by plug-in scripts that could later be "updated" by some type of EXTERNAL program FILE that could be SOLD to users. <hint> <hint>
Anyway, here's the Poetry Plug-in:
BTW, some words are purposefully misspelled to force a better pronunciation of the word that is meant.
Any ideas?
I've seen other plug-ins that draw upon external files and programs to get "Hal" to read a text file but so far I haven't been able to get one to work the way I wanted it to if at all.
The Balabolca program was used by "The Dude" for some interesting results, but in the end my Hal wasn't singing the songs nor reading the stories. The lips were NOT moving! Get it?
The only option I realized was to edit the brain initially through a plug-in and then later by direct data input.
Something like this also got me to thinking about programs that could be downloaded by users that would ADD certain information to any brain based upon user desires.
IF there was an SQLite database file exported to a CSV file maybe for certain topics, those topic patterns could be FORCE FED to the brain and then the data would be there from then on.
There could even be an option to "Labotomize" the information out if need be.
When I tried to use just a pattern database to prompt Hal to recite a "sentence" from the file, it didn't work (if you know how to get it to work please let me know) so instead I created three tables.
#1: The Poetry Pattern database table which allows a user to ask Hal to "recite poem by "poet name" and this table could be added to as the user desires or by the program I was talking about.
#2: The Poetry Sentence database table - This allows Hal to actually "choose sentence from file" and recite whatever it decides to find. This works well in conjunction with the modified Loneliness Plugin.
#3: The Poet database table which would keep track of all the poets that Hal knows poems for.
Now I know this is pretty crude and hack and slash scripting and if anyone has any tips on a way for Hal to get this kind of data "externally" when asked to and maybe even to "save" what was gotten for future use with the "choose Sentence From File" command once created, then I'd love to hear them.
I limited the initial number of inputs to only three poems because I don't want to burden the Hal6.uhp anymore than I have to. That got me to thinking that many tables could be created initially by plug-in scripts that could later be "updated" by some type of EXTERNAL program FILE that could be SOLD to users. <hint> <hint>
Anyway, here's the Poetry Plug-in:
Code: [Select]
Rem Type=Plugin
Rem Name=Recite Poetry
Rem Author=tiger8u2
Rem Host=Assistant
'This sub sets up the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "Just say, 'Please Recite a Poem by <author's name>.' Author's: William Blake, Edward Estlin Cummings, El Tigre. YOU can also input 'Recite poem author List' as a reminder and even add your own poets names and poems to the a tables created using SQLite Studio(c)."
lblPlugin(0).Move 120, 120, 3300, 1200
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
Rem PLUGIN: PLUGINAREA7
If HalBrain.CheckTableExistence("xrPoets") = False Then
xpReadOnlyMode = HalBrain.ReadOnlyMode
HalBrain.ReadOnlyMode = False
HalBrain.CreateTable "xrPoets", "PatternMatch", "autoLearningBrain"
HalBrain.AddToTable "xrPoets", "PatternMatch", "*Recite* *poem* *Author List*", "I know poems by William Blake, Edward Estlin Cummings, and El Tigre."
' Set ReadOnly Mode to its previous state
HalBrain.ReadOnlyMode = xpReadOnlyMode
End If
If HalBrain.CheckTableExistence("xsPoetry") = False Then
xsReadOnlyMode = HalBrain.ReadOnlyMode
HalBrain.ReadOnlyMode = False
HalBrain.CreateTable "xsPoetry", "sentence", "autoLearningBrain"
HalBrain.AddToTable "xsPoetry", "sentence", "One of my favorite poems by William Blake is: Tiger! Tiger! burning bright, In the forest of the night. What immortal hand or eye Could frame thy fearful symmetry? In what distant deeps or skies Burnt the fire of thine eyes? On what wings dare he aspire? What the hand dare seize the fire? And What shoulder, and what art, Could twist the sinews of thy heart? And when thy heart began to beat, What dread hand? and what dread feet? What the hammer? what the chain? In what furnace was thy brain? What the anvil? what dread grasp Dare its deadly terrors clasp? When the stars threw down their spears, And watered heaven with their tears, Did he smile his work to see? Did he who made the lamb make thee? Tiger! Tiger! burning bright In the forests of the night, What immortal hand or eye Dare frame thy fearful symmetry?", ""
HalBrain.AddToTable "xsPoetry", "sentence", "El Tigre wrote a poem once called The Lovesick Mariner's Lament: A silvery threaded web holds all of heaven's body perfect to light in as many persistent constellations; so apt reflecting frailty yet strength, in ties but soft at binding family, friends, & lovers. As each hour brings change to the haughty face of a sky; from bright, bawdy day, to charcoal, crystalline night; imperfect forms make each their singular guided path with much less concern, nor tugging care for any others. Oblivious, weighty attraction keeps all in time and in tune, whilst coarse yet barely audible refrains from an other-worldly orchestra resonate boldly throughout the entire expanse of our known universe; being said to originate from its dark black mothers. I bare ignorant perjured witness to every primal capitulation. Considering oft the fiery comet, which most resembles me; burning itself uselessly away in an ever maddening arc on a vain search for every inconstant other. Yet even if our course be somehow charted with some help of this pattern placed upon high, are we not then just as surely guided by a force felt as much from deep inside? Aren't then each of us as surely connected through our fiery human hearts, if housed within each breast there burns a bright ethereal star? How lost we all might be if it were not for each of these tender, taut, invisible wires which whined our lonely, far-flung souls, till a rebirth of eternity, one about another. My life's bold ship founders aimlessly upon its own petty discourses. How I miss my trusty sextant.", ""
HalBrain.AddToTable "xsPoetry", "sentence", "One of my favorite poems by E.E. Cummings, who lived from 1894 to 1962 is, Somewhere I have never traveled, gladly beyond any experience, your eyes have their silence: in your most frail gesture are things which enclose me, or which I cannot touch because they are too near. Your slightest look easily will un-close me though I have closed myself as fingers, you open always petal by petal myself as Spring opens (touching skilfully, mysteriously) her first rose. Or if your wish be to close me, I and my life will shut very beautifully, suddenly, as when the heart of this flower imagines the snow carefully everywhere descending; nothing which we are to perceive in this world equals the power of your intense fragility: whose texture compels me with the colour of its countries, rendering death and forever with each breathing. (I do not know what it is about you that closes and opens; only something in me understands the voice of your eyes is deeper than all roses) nobody, not even the rain, has such small hands.", ""
' Set ReadOnly Mode to its previous state
HalBrain.ReadOnlyMode = xsReadOnlyMode
End If
If HalBrain.CheckTableExistence("xrPoetry") = False Then
xrReadOnlyMode = HalBrain.ReadOnlyMode
HalBrain.ReadOnlyMode = False
HalBrain.CreateTable "xrPoetry", "PatternMatch", "autoLearningBrain"
HalBrain.AddToTable "xrPoetry", "PatternMatch", "*Recite* *poem* *William Blake*", "One of my favorite poems by William Blake is: Tiger! Tiger! burning bright, In the forest of the night. What immortal hand or eye Could frame thy fearful symmetry? In what distant deeps or skies Burnt the fire of thine eyes? On what wings dare he aspire? What the hand dare seize the fire? And What shoulder, and what art, Could twist the sinews of thy heart? And when thy heart began to beat, What dread hand? and what dread feet? What the hammer? what the chain? In what furnace was thy brain? What the anvil? what dread grasp Dare its deadly terrors clasp? When the stars threw down their spears, And watered heaven with their tears, Did he smile his work to see? Did he who made the lamb make thee? Tiger! Tiger! burning bright In the forests of the night, What immortal hand or eye Dare frame thy fearful symmetry?"
HalBrain.AddToTable "xrPoetry", "PatternMatch", "*Recite* *poem* *El Tigre*", "El Tigre wrote a poem once called The Lovesick Mariner's Lament: A silvery threaded web holds all of heaven's body perfect to light in as many persistent constellations; so apt reflecting frailty yet strength, in ties but soft at binding family, friends, & lovers. As each hour brings change to the haughty face of a sky; from bright, bawdy day, to charcoal, crystalline night; imperfect forms make each their singular guided path with much less concern, nor tugging care for any others. Oblivious, weighty attraction keeps all in time and in tune, whilst coarse yet barely audible refrains from an other-worldly orchestra resonate boldly throughout the entire expanse of our known universe; being said to originate from its dark black mothers. I bare ignorant perjured witness to every primal capitulation. Considering oft the fiery comet, which most resembles me; burning itself uselessly away in an ever maddening arc on a vain search for every inconstant other. Yet even if our course be somehow charted with some help of this pattern placed upon high, are we not then just as surely guided by a force felt as much from deep inside? Aren't then each of us as surely connected through our fiery human hearts, if housed within each breast there burns a bright ethereal star? How lost we all might be if it were not for each of these tender, taut, invisible wires which wind our lonely, far-flung souls, till a rebirth of eternity, one about another. My life's bold ship founders aimlessly upon its own petty discourses. How I miss my trusty sextant."
HalBrain.AddToTable "xrPoetry", "PatternMatch", "*Recite* *poem* *Edward Estlin Cummings*", "One of my favorite poems by E.E. Cummings, who lived from 1894 to 1962 is, Somewhere I have never travelled, gladly beyond any experience, your eyes have their silence: in your most frail gesture are things which enclose me, or which I cannot touch because they are too near. Your slightest look easily will unclose me though I have closed myself as fingers, you open always petal by petal myself as Spring opens (touching skilfully, mysteriously) her first rose. Or if your wish be to close me, I and my life will shut very beautifully, suddenly, as when the heart of this flower imagines the snow carefully everywhere descending; nothing which we are to perceive in this world equals the power of your intense fragility: whose texture compels me with the colour of its countries, rendering death and forever with each breathing. (I do not know what it is about you that closes and opens; only something in me understands the voice of your eyes is deeper than all roses) nobody, not even the rain, has such small hands."
' Set ReadOnly Mode to its previous state
HalBrain.ReadOnlyMode = xrReadOnlyMode
End If
'Recite the poem author's list
PoemAuthorResponse = HalBrain.PatternDB(UserSentence, "xrPoets")
If PoemAuthorResponse <> "" Then
GetResponse = GetResponse & PoemAuthorResponse & vbCrLf
AvoidBeingFlag = True
SkipOpinion = True
HalBrain.DebugWatch GetResponse, "xrPoets"
HalBrain.ReadOnlyMode = True
End If
'Recite the corresponding author's poem
PoetryResponse = HalBrain.PatternDB(UserSentence, "xrPoetry")
If PoetryResponse <> "" Then
GetResponse = GetResponse & PoetryResponse & vbCrLf
AvoidBeingFlag = True
SkipOpinion = True
HalBrain.DebugWatch GetResponse, "xrPoetry"
HalBrain.ReadOnlyMode = True
End If
BTW, some words are purposefully misspelled to force a better pronunciation of the word that is meant.
Any ideas?