dupa

Author Topic: Hal can Capitalize much better now.  (Read 5145 times)

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
Hal can Capitalize much better now.
« on: October 30, 2003, 06:56:06 pm »
Here's a description of my latest creation.

'PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS
'This is the version entirely rewritten by =vonsmith= , version 10-30-03a.
'This function improves on the original function in Ultra Hal Assistant v5.0 and
'provides new capability. Just delete the entire original "PROCESS: REVERSE CERTAIN
'CONTRACTIONS AND OTHER SUBSTITUTIONS" in the hal5.uhp file and replace it with
'this script. Always back up the original hal5.uhp file!!!
'
'ORIGINAL CAPABILITY:
'Standardizing on contractions can make Hal sound conversational.
'However, certain sentence constructions don't work well if expressed as
'contractions.  For example:
'"I don't know where it is" becomes "I don't know where it's."
'For another example, "That's how he is" becomes "That's how he's."
'To solve these types of cases we attempt to modify certain contractions, words,
'and phrases at the end of this function, now that Hal's thinking is done.
'
'ADDITIONAL CAPABILITIES:
'Normally Hal converts every user input into all caps to evaluate the sentence
'and create a response. However if Hal parrots back the user input the user's
'capitalization is lost. Example:
'  User: Where is Disneyland?  Hal: Where is disneyland? We must examine this.
'Capitals in names of people and places are lost similarly.
'  User: Do you know Ted and Mark?  Hal: Should I know ted and mark?
'The programmer could edit the corrections.brn file to substitute Mark for mark
'in all cases, but this would erroneously lead to:
'  User: How much should I fill a glass?  Hal: Fill it to the Mark.
'
'This rewritten function will preserve the user's capitalized words in the input
'sentence and replace Hal's uncapitalized words in GetResponse with the correct
'user capitalized versions. Example:
'  User: Where is Ted and Mark?  Hal: I don't know Ted and Mark.
'Hal now takes a clue from the user about capitalization.
'  User: Where is Ted's mark?  Hal: Ted's mark is not here.
'  User: I know ted and mark.  Hal: Where is ted and mark.
'
'In cases where the user always wants a word capitalized, then Hal can save a
'word to the corrections.brn for the user. Example:
'  User: Hal caps Disneyland.
'  Hal: Your input Disneyland is saved as capitalized in the corrections brn file.
'If your Hal is named Betty instead type:
'  User: Betty caps Saint Mary.
'  Hal: Your input Saint Mary is saved as capitalized in the corrections brn file.
'Since Hal's computername appears in the user input this programming type input
'will not be saved to any other brn files or anywhere else in Hal's data base.
'Now for example:
'  User: I hear Saint Mary's bells.  Hal: What is Saint Mary's bells?
'However Hal still takes a clue from the user's input.
'  User: I hear saint mary's bells.  Hal: What is saint mary's bells?
'The phrase "saint mary's" is still lower case even if it is in the corrections.brn
'file. Hal always assumes the user's use of capitalization is correct.
'This method should produce the correct capitalization in almost every case. The
'programmer shouldn't add words like "Mark" or "Hall" to corrections.brn because
'these names can also be used as uncapitalized words. However words like "Fred",
'"God", "Christmas", "Knott's Berry Farm" can be added with reasonable certainty
'that they should always be capitalized. You can add as many words to
'corrections.brn as you like. Duplicated words will not be added to the file.
'
'This function does not handle all capitalized words like acronyms, i.e., DOA, SUV.
'Unfortunately Hal's other functions do not preserve all cap words during the final
'processing of GetResponse.
'
'Have fun with this improved function. =vonsmith=
'
'P.S. - Try this. User: Where is Mark's mark? See if Hal gets it right.


Download it and give it a try. Let me know how it works out.

= vonsmith =


<snip> I deleted the attachment, because a newer version is available. This first version had an intermittment bug that caused a "Function 'Asc' not recognized" error. It is corrected in the new version. Refer to the new posting in this thread.
= vonsmith = 11/11/03
« Last Edit: November 11, 2003, 02:52:31 pm by vonsmith »
 

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
Hal can Capitalize much better now.
« Reply #1 on: October 31, 2003, 10:42:46 am »
Attn: ROBERT MEDEKSZA or anyone else with an answer/comment.

My new Capitalization function appears to work pretty well. However I haven't found a way to get acronyms or other all cap's words through to Hal's output. I tried placing all cap's words like MOSFET, SUV, DOA, IBM, etc. into the final GetResponse string. Hal's main program apparently lower cases all cap's words, but leaves words with first letter cap's alone. Words like Hal, Frank, Christmas with first letter cap's are displayed in Hal's response correctly.

Is there a way to get all cap's acronyms through to Hal's output? Is a modification to Hal's main program required to make this possible?

Thanks,

= vonsmith =
« Last Edit: October 31, 2003, 10:43:24 am by vonsmith »
 

vonsmith

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
Hal can Capitalize much better now.
« Reply #2 on: November 11, 2003, 02:51:44 pm »
Here is the newest version of the "PROCESS: REVERSE CERTAIN CONTRACTIONS AND OTHER SUBSTITUTIONS" replacement script. The first version had an intermittent bug which I have corrected.

Just download the file and cut & paste into the hal5.uhp file as indicated. See my prior email for details about the script.

Comments, questions, or whatever are welcome.

= vonsmith =


Download Attachment: REV_CONTRACTIONS_AND_SUBSTITUTIONS,11-10-03a.txt
7.94 KB
« Last Edit: November 11, 2003, 02:53:25 pm by vonsmith »