dupa

Author Topic: Vital Info for Non-English Pronoun Reversals  (Read 4328 times)

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
Vital Info for Non-English Pronoun Reversals
« on: December 30, 2003, 05:04:12 pm »
Hello,

We've had many postings about adapting Hal's script to operate in Spanish, French, German, etc.  Below, please find an adaptation of a response I wrote on the "Assistant" forum.  

I hope the information it provides will help some of us when coding for non-English:

-----------------

Hal is inherently capable of learning any language that uses the same alphabet as English. This is because Hal learns new words as letter-patterns and associates them with context.

For instance, if you consistently speak Spanish to Hal, he will at first answer you in English, but he will gradually pick up more and more Spanish and will start answering you in Spanish. It will take a long time, but it will happen.

HOWEVER, there are some "special" functions in the main control script that are definitely English-specific. The most important of these is the PRONOUN REVERSAL routine!

It would be possible to write a pronoun-reversal routine for Spanish and other languages, and add them to the substitutions.brn, where much of Hal's pronoun-reversal work is now located. The reversals could simply be added to the database; they would not interfere with the English reversals in any way.

I am not familiar enough with Spanish, French, German, etc., grammar to write the pronoun-reversals, but I know that it is feasible.

In case anybody reading this understands Hal fairly well, and also understands grammar and pronouns in a non-English language, let me explain some very important "tricks" in writing a pronoun reversal routine:

FACTS, TIPS, TRICKS ABOUT THE PRONOUN REVERSAL ROUTINE

1. Substitutions.brn consists of pairs of words or phrases. On each line, the ones on the left get removed from the user's sentence, and the ones on the right get substituted in their place.

2. The substitutions are processed in sequence from the first line at the top, to the last line at the bottom, so sequence does make a difference.

3. It DOES NOT WORK to simply substitute (for example) "yours" into "mine" and then later "mine" into "yours". Why not? Because the reversals are mirror images of each other, a simple-symmetrical routine would result in ALWAYS choosing "yours", since that's the last substitution that's done.

4. The solution? Two-step processing! We create some non-words as "temporary holding words" until we're ready to finish the reversals. That way, we don't accidentally "un-reverse" things after we reverse them the first time!

5. Here is an example of how it works:

" mine " becomes " zmineq "
" yours " becomes " zyoursq "

(The "intermediate words" can be any arbitrary patterns, as long as we choose carefully so that they are NOT "real words". Now we can finish the reversals without confusion:)

" zmineq " becomes " yours "
" zyoursq " becomes " mine "

...and via this two-stage process, we can reverse mirror-images of each other, without getting them mixed up! (NOTE THAT we put leading and trailing spaces inside the string-matching quotation marks, so we search for stand-alone words, not fragments of words that happen to contain the same letters!)

6. As a special problem, in English, we have the issue that "you" reverses to "I" when a subject, but reverses to "me" when an object, as in:

"You like to hit the ball when it's pitched to you."

--Correctly reverses as follows:

"I like to hit the ball when it's pitched to me."

If you look in substitutions.brn, you can see how this problem is solved for Hal in English. Essentially, it is a list of every transitive verb and preposition that we could think of, that would make "I" change into "me"!

NOW -- BACK TO THE QUESTION ABOUT NON-ENGLISH LANGUAGES -- There is no mystery how to do this routine, but I don't have the knowledge of other languages to correctly write the pronoun reversals, and I don't know the various grammar rules to know if there are issues in other languages similar to "I" versus "me".

If there is someone out there who combines the needed Spanish or French or German or other-language knowledge with the needed Ultra Hal knowledge, you would do all of us a great service if you could help us out with non-English pronoun reversals!

As I mentioned, these reversals could be added to the substitutions.brn without interfering with anything else that Hal does!

With pronoun reversals, Hal would have quite a bit of the capability in other languages that he has in English!

In the meantime, Hal can "learn" and respond in other languages that use the 26-character alphabet, but he won't have the pronoun reversals until we work together on this!

I hope that this is useful information for all interested parties.

Sincerely,

Don
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

Larry

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Vital Info for Non-English Pronoun Reversals
« Reply #1 on: January 11, 2004, 11:15:35 pm »
Don, I found this and thought about you...
http://www.freetranslation.com/
 

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
Vital Info for Non-English Pronoun Reversals
« Reply #2 on: January 12, 2004, 01:56:54 am »
Larry,

Esto es bueno. Gracias mucho!

Don
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

onthecuttingedge2005

  • Guest
Vital Info for Non-English Pronoun Reversals
« Reply #3 on: January 12, 2004, 07:51:03 pm »
'Download the Spanish.brn to your default Hal folder.
'The SpanishTalk.brn will automatically be created when
'Spanish words are detected, A larger spanish vocabulary
'can be given simply by adding to the Spanish.brn as formatted.

'Response Process: Spanish Language Accelerator version 1.2
'This script allows Hal to pick up on the spanish language at a higher accelerated rate.
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "Spanish.brn") => "" Then
Spanish = HalBrain.ChooseSentenceFromFile(WorkingDir & "SpanishTalk.brn")
      GetResponse = Spanish & VbCrLf
      DebugInfo = DebugInfo & "The user is talking Spanish: " & Spanish & VbCrLf
      Else
      DebugInfo = DebugInfo & "Hal has found nothing Spanish: " & Spanish & VbCrLf
   End If
'Save Process: Spanish Language Accelerator version 1.2
If HalBrain.TopicSearch(OriginalSentence, WorkingDir & "Spanish.brn") => "" Then
AnswerSent = "" & Trim(OriginalSentence)
HalBrain.AppendFile WorkingDir & "SpanishTalk" & ".brn", AnswerSent
End If
'By Gerald L.Blakley

Download Attachment: SPANISH.brn
8.05 KB

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
Vital Info for Non-English Pronoun Reversals
« Reply #4 on: January 13, 2004, 01:24:43 am »
Hi Jerry,

Your code directs Spanish-containing sentences into a particular database of their own, and that's fine.

We all still need to keep each other posted on anyone who can put together a complete list of the "pronoun reversals" needed for Spanish as described in the postings above.

Correct pronoun reversals add a great deal to the enjoyment and realism of Hal.

Sincerely,

Don
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274

Larry

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Vital Info for Non-English Pronoun Reversals
« Reply #5 on: January 19, 2004, 04:25:36 am »
You know... here's another one... http://babel.altavista.com/
And another http://www.abhisoft.net/ttpro/
« Last Edit: January 19, 2004, 04:43:58 pm by Larry »