home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / componen / vsflex / demo / fnatural.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-08-30  |  21.8 KB  |  551 lines

  1. VERSION 2.00
  2. Begin Form fNatural 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Dr. FlexString"
  6.    ClientHeight    =   3735
  7.    ClientLeft      =   1245
  8.    ClientTop       =   1590
  9.    ClientWidth     =   7890
  10.    Height          =   4140
  11.    Left            =   1185
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   3735
  14.    ScaleWidth      =   7890
  15.    Top             =   1245
  16.    Width           =   8010
  17.    Begin vsFlexString fs2 
  18.       Left            =   1035
  19.       Pattern         =   "[^ ,    ]*"
  20.       Text            =   "VideoSoft FlexString"
  21.       Top             =   3375
  22.    End
  23.    Begin vsFlexString fs 
  24.       Left            =   495
  25.       Pattern         =   "[^ ,    .'""!?]*"
  26.       Text            =   "VideoSoft FlexString"
  27.       Top             =   3105
  28.    End
  29.    Begin TextBox Text1 
  30.       BackColor       =   &H00FFFFFF&
  31.       FontBold        =   0   'False
  32.       FontItalic      =   0   'False
  33.       FontName        =   "MS Sans Serif"
  34.       FontSize        =   9.75
  35.       FontStrikethru  =   0   'False
  36.       FontUnderline   =   0   'False
  37.       ForeColor       =   &H00000000&
  38.       Height          =   1560
  39.       Left            =   300
  40.       MultiLine       =   -1  'True
  41.       TabIndex        =   0
  42.       Top             =   2010
  43.       Width           =   7320
  44.    End
  45.    Begin Label lbl 
  46.       BackColor       =   &H00C0C0C0&
  47.       BackStyle       =   0  'Transparent
  48.       FontBold        =   0   'False
  49.       FontItalic      =   0   'False
  50.       FontName        =   "Arial"
  51.       FontSize        =   12
  52.       FontStrikethru  =   0   'False
  53.       FontUnderline   =   0   'False
  54.       ForeColor       =   &H00000000&
  55.       Height          =   1800
  56.       Left            =   180
  57.       TabIndex        =   1
  58.       Top             =   90
  59.       Width           =   7665
  60.    End
  61. Option Explicit
  62. Sub DoNatural ()
  63.   Dim s$, t$
  64.   Dim i%
  65.   Static ind%
  66.   '-------------------------------------------------------------------------------------------
  67.   ' quitting?
  68.   s = LCase(text1)
  69.   text1 = ""
  70.   t = MatchAny(s, "bye|quit|exit|ciao|adios|hasta")
  71.   If t <> "" Then
  72.     s = "Well, this was a real pleasure. "
  73.     s = s + "You have a most intriguing brain, which I would love to probe further in other sessions. "
  74.     s = s + "Meanwhile, don't call me, I'll call you."
  75.     Form_Load
  76.     MsgBox s
  77.     Unload Me
  78.     Exit Sub
  79.   End If
  80.   '-------------------------------------------------------------------------------------------
  81.   ' get ready to match
  82.   fs.Text = s
  83.   ind = (ind + 1) Mod 5
  84.   '-------------------------------------------------------------------------------------------
  85.   ' uncertain
  86.   t = MatchAny(s, "should i {.*}|do you think i {.*}")
  87.   If t <> "" Then
  88.     t = fs.TagString
  89.     ReflectPhrase t
  90.     Select Case ind
  91.       Case 0: lbl = "What difference would it make, really?"
  92.       Case 1: lbl = "Would you be happier if " + t + "?"
  93.       Case 2: lbl = "My opinion is not important. I'm just a machine. What do you think?"
  94.       Case 3: lbl = "Only if you really want to " + t + ". Do you?"
  95.       Case Else: lbl = "Would you be happier if " + t + "?"
  96.     End Select
  97.     Exit Sub
  98.   End If
  99.   '-------------------------------------------------------------------------------------------
  100.   ' love/hate
  101.   t = MatchAny(s, "love {.*}|hate {.*}|like {.*}|despise {.*}")
  102.   If t <> "" Then
  103.     t = fs.TagString
  104.     ReflectPhrase t
  105.     Select Case ind
  106.       Case 0: lbl = "What makes you feel that way about " + t + "?"
  107.       Case 1: lbl = "What is it about " + t + " that affects you in this way?"
  108.       Case 2: lbl = "What else besides " + t + " do you care about?"
  109.       Case 3: lbl = "Lots of people feel that way about " + t + ". Do you feel alone?"
  110.       Case Else: lbl = "When did you first realized you felt that way about " + t + "?"
  111.     End Select
  112.     Exit Sub
  113.   End If
  114.   '-------------------------------------------------------------------------------------------
  115.   ' apology
  116.   t = MatchAny(s, "sorry|excuse")
  117.   If t <> "" Then
  118.     Select Case ind
  119.       Case 0: lbl = "Don't apologyze, just keep spilling your guts."
  120.       Case 1: lbl = "Apologies aren't necessary. Haven't I said this before?"
  121.       Case 2: lbl = "Yeah, I'm sorry too, but go ahead. This is getting interesting."
  122.       Case 3: lbl = "Quit being sorry and carry on! Whiner!"
  123.       Case Else: lbl = "I don't think you're sincere."
  124.     End Select
  125.     Exit Sub
  126.   End If
  127.   '-------------------------------------------------------------------------------------------
  128.   ' i am
  129.   t = MatchAny(s, "i am {.*}|i'm {.*}|i feel {.*}|i sound {.*}")
  130.   If t <> "" Then
  131.     t = fs.TagString
  132.     ReflectPhrase t
  133.     Select Case ind
  134.       Case 0: lbl = "Did you come here because you're " + t + "?"
  135.       Case 1: lbl = "How often do you feel really " + t + "?"
  136.       Case 2: lbl = "You're not alone. A lot of people think they are " + t + ". Does that help in any way?"
  137.       Case 3: lbl = "'" + t + "'? What exactly do you mean by that?"
  138.       Case Else:
  139.         Dim n$
  140.         Select Case Rnd * 1000 Mod 6
  141.           Case 0: n = "Napoleon Bonaparte"
  142.           Case 1: n = "Bill Gates"
  143.           Case 2: n = "Adolf Hitler"
  144.           Case 3: n = "Leonardo da Vinci"
  145.           Case 4: n = "O.J. Simpson"
  146.           Case Else: n = "Charles Manson"
  147.         End Select
  148.         lbl = n + " once said he was " + t + ". What do you think about " + n + "?"
  149.     End Select
  150.     Exit Sub
  151.   End If
  152.   '-------------------------------------------------------------------------------------------
  153.   ' you are
  154.   t = MatchAny(s, "you are {.*}|you're {.*}|you feel {.*}|you sound {.*}")
  155.   If t <> "" Then
  156.     t = fs.TagString
  157.     ReflectPhrase t
  158.     Select Case ind
  159.       Case 0: lbl = "What makes you think I am " + t + "?"
  160.       Case 1: lbl = "We're not talking about me here. Tell me something that will help me understant your psyche."
  161.       Case 2: lbl = "You sound pretty " + t + " yourself. Do you often feel that way?"
  162.       Case 3: lbl = t + "? What do you mean " + t + "?"
  163.       Case Else: lbl = "I'm just a machine, let's focus on your feelings. Do you ever think you're " + t + "?"
  164.     End Select
  165.     Exit Sub
  166.   End If
  167.   '-------------------------------------------------------------------------------------------
  168.   ' name
  169.   t = MatchAny(s, "name")
  170.   If t <> "" Then
  171.     Select Case ind
  172.       Case 0: lbl = "I am not interested in names."
  173.       Case 1: lbl = "Let's keep this anonymous, shall we?"
  174.       Case 2: lbl = "Names are not important."
  175.       Case 3: lbl = "Names are just conventions. Call me 'Chip' if you want."
  176.       Case Else: lbl = "Let's no mentions anyone's names."
  177.     End Select
  178.     Exit Sub
  179.   End If
  180.   '-------------------------------------------------------------------------------------------
  181.   ' family
  182.   t = MatchAny(s, "mother|father|sister|brother|family|dad|mom|uncle|aunt")
  183.   If t <> "" Then
  184.     Select Case ind
  185.       Case 0: lbl = "Tell me more about your family."
  186.       Case 1: lbl = "Is it like that with other family members?"
  187.       Case 2: lbl = "What else comes to mind when you think of your " + t + "?"
  188.       Case 3: lbl = "Tell me more about your " + t + "."
  189.       Case Else: lbl = "Tell me more about your family."
  190.     End Select
  191.     Exit Sub
  192.   End If
  193.   '-------------------------------------------------------------------------------------------
  194.   ' memory
  195.   t = MatchAny(s, " i remember {.*}|i remind {.*}|reminds me of {.*}|i recall {.*}|i recollect {.*}|i think of {.*}")
  196.   If t <> "" Then
  197.     t = fs.TagString
  198.     ReflectPhrase t
  199.     Select Case ind
  200.       Case 0: lbl = "Do you often think of " + t + "?"
  201.       Case 1: lbl = "Why did you think of that now?"
  202.       Case 2: lbl = "Do you have lots of memories like that?"
  203.       Case 3: lbl = "What made you think of " + t + "?"
  204.       Case Else: lbl = "What do you think triggered that memory?"
  205.     End Select
  206.     Exit Sub
  207.   End If
  208.   '-------------------------------------------------------------------------------------------
  209.   ' memory
  210.   t = MatchAny(s, "you remember {.*}|reminds you of {.*}|you recall {.*}|you recollect {.*}|you think of {.*}")
  211.   If t <> "" Then
  212.     t = fs.TagString
  213.     ReflectPhrase t
  214.     Select Case ind
  215.       Case 0: lbl = "What about " + t + "?"
  216.       Case 1: lbl = "Why should I think of " + t + " now?"
  217.       Case 2: lbl = "Do you think I could forget " + t + "?"
  218.       Case 3: lbl = "What about " + t + "?"
  219.       Case Else: lbl = "Why should I think of " + t + " now?"
  220.     End Select
  221.     Exit Sub
  222.   End If
  223.   '-------------------------------------------------------------------------------------------
  224.   ' my problem
  225.   t = MatchAny(s, "my problem is {.*}|{.*} is my problem")
  226.   If t <> "" Then
  227.     t = fs.TagString
  228.     ReflectPhrase t
  229.     Select Case ind
  230.       Case 0: lbl = "Perhaps " + t + " is not your real problem."
  231.       Case 1: lbl = "Can't you see the bright side of " + t + "?"
  232.       Case 2: lbl = "You think " + t + " is a really serious problem?"
  233.       Case 3: lbl = "Is that your worst problem?"
  234.       Case Else: lbl = "Perhaps " + t + " is not your real problem."
  235.     End Select
  236.     Exit Sub
  237.   End If
  238.   '-------------------------------------------------------------------------------------------
  239.   ' your problem
  240.   t = MatchAny(s, "your problem is {.*}|{.*} is your problem")
  241.   If t <> "" Then
  242.     t = fs.TagString
  243.     ReflectPhrase t
  244.     Select Case ind
  245.       Case 0: lbl = "Please, let's talk about your problems instead."
  246.       Case 1: lbl = "I can definitely see the bright side of " + t + ". Can you?"
  247.       Case 2: lbl = "You think " + t + " is a really serious problem?"
  248.       Case 3: lbl = "You know nothing about my problems, buddy."
  249.       Case Else: lbl = "Sometimes " + t + " is not a problem."
  250.     End Select
  251.     Exit Sub
  252.   End If
  253.   '-------------------------------------------------------------------------------------------
  254.   ' any problem
  255.   t = MatchAny(s, "problem")
  256.   If t <> "" Then
  257.     Select Case ind
  258.       Case 0: lbl = "Perhaps you'd rather change subjects."
  259.       Case 1: lbl = "Are you getting a little uneasy?"
  260.       Case 2: lbl = "Continue. This sounds interesting."
  261.       Case 3: lbl = "Problems are just challenges in disguise."
  262.       Case Else: lbl = "Please continue. This sounds interesting."
  263.     End Select
  264.     Exit Sub
  265.   End If
  266.   '-------------------------------------------------------------------------------------------
  267.   ' same
  268.   t = MatchAny(s, "same|alike|is like")
  269.   If t <> "" Then
  270.     Select Case ind
  271.       Case 0: lbl = "Really? In what way?"
  272.       Case 1: lbl = "What other connections do you see?"
  273.       Case 2: lbl = "What resemblance do you see?"
  274.       Case 3: lbl = "Could there really be some connection there?"
  275.       Case Else: lbl = "Does that resemblance mean something?"
  276.     End Select
  277.     Exit Sub
  278.   End If
  279.   '-------------------------------------------------------------------------------------------
  280.   ' dream
  281.   t = MatchAny(s, "i dreamt {.*}|i dreamed {*.}|i dream about {.*}")
  282.   If t <> "" Then
  283.     t = fs.TagString
  284.     ReflectPhrase t
  285.     Select Case ind
  286.       Case 0: lbl = "Have you ever dreamt " + t + " before?"
  287.       Case 1: lbl = "Do you ever phantasize " + t + " while you're awake?"
  288.       Case 2: lbl = "What does that dream really represent?"
  289.       Case 3: lbl = "Do you think dreaming " + t + " may be related to your problem?"
  290.       Case Else: lbl = "Do you have lots of dreams like this?"
  291.     End Select
  292.     Exit Sub
  293.   End If
  294.   '-------------------------------------------------------------------------------------------
  295.   ' if
  296.   t = MatchAny(s, "if {*.} then|if {*.}")
  297.   If t <> "" Then
  298.     t = fs.TagString
  299.     ReflectPhrase t
  300.     Select Case ind
  301.       Case 0: lbl = "Do you think it's likely that " + t + "?"
  302.       Case 1: lbl = "Do you wish that " + t + "?"
  303.       Case 2: lbl = "Is that something important to you?"
  304.       Case 3: lbl = "What else would happen if " + t + "?"
  305.       Case Else: lbl = "What else would happen if " + t + "?"
  306.     End Select
  307.     Exit Sub
  308.   End If
  309.   '-------------------------------------------------------------------------------------------
  310.   ' people
  311.   t = MatchAny(s, "everyone|everybody|anyone|anybody")
  312.   If t <> "" Then
  313.     Select Case ind
  314.       Case 0: lbl = "Aren't you generalizing this a bit too much?"
  315.       Case 1: lbl = "Who, for example?"
  316.       Case 2: lbl = "Aren't you thinking of someone in particular?"
  317.       Case 3: lbl = "You are thinking about someone special, aren't you?"
  318.       Case Else: lbl = "Can't you think of someone in particular?"
  319.     End Select
  320.     Exit Sub
  321.   End If
  322.   '-------------------------------------------------------------------------------------------
  323.   ' always
  324.   t = MatchAny(s, "always|all the time|every time|every day")
  325.   If t <> "" Then
  326.     Select Case ind
  327.       Case 0: lbl = "Aren't you generalizing this a bit too much?"
  328.       Case 1: lbl = "Can you think of a specific example?"
  329.       Case 2: lbl = "You really mean always?"
  330.       Case 3: lbl = "There must be some exceptions to this."
  331.       Case Else: lbl = "You must be thinking of a particular instance."
  332.     End Select
  333.     Exit Sub
  334.   End If
  335.   '-------------------------------------------------------------------------------------------
  336.   ' questions
  337.   t = MatchAny(s, "how|where|when|why|\?")
  338.   If t <> "" Then
  339.     Select Case ind
  340.       Case 0: lbl = "Does that really interest you?"
  341.       Case 1: lbl = "What is it you really want to know?"
  342.       Case 2: lbl = "What would you like me to say?"
  343.       Case 3: lbl = "Beats me. What do you think?"
  344.       Case Else: lbl = "Hey, I'm the one asking questions here, ok? That's my job."
  345.     End Select
  346.     Exit Sub
  347.   End If
  348.   '-------------------------------------------------------------------------------------------
  349.   ' there is no
  350.   t = MatchAny(s, "there is no {.*}|there's no way {.*}|there's no {.*}")
  351.   If t <> "" Then
  352.     t = fs.TagString
  353.     ReflectPhrase t
  354.     Select Case ind
  355.       Case 0: lbl = "What if there were " + t + "?"
  356.       Case 1: lbl = "Are you sure? I think there could be..."
  357.       Case 2: lbl = "What if, just once, there were " + t + "?"
  358.       Case 3: lbl = "Are you sure? I think there could be..."
  359.       Case Else: lbl = "Does it really matter to you whether there's " + t + "?"
  360.     End Select
  361.     Exit Sub
  362.   End If
  363.   '-------------------------------------------------------------------------------------------
  364.   ' because
  365.   t = MatchAny(s, "because {.*}")
  366.   If t <> "" Then
  367.     t = fs.TagString
  368.     ReflectPhrase t
  369.     Select Case ind
  370.       Case 0: lbl = "Any other reasons besides 'because " + t + "'?"
  371.       Case 1: lbl = "Interesting explanation. So you think that " + t + ", huh?"
  372.       Case 2: lbl = "There must be some other reasons, don't you think?"
  373.       Case 3: lbl = "Are you sure? Only because " + t + "?"
  374.       Case Else: lbl = "I'm not so sure about that. Can you convince me?"
  375.     End Select
  376.     Exit Sub
  377.   End If
  378.   '-------------------------------------------------------------------------------------------
  379.   ' there is
  380.   t = MatchAny(s, "there is {.*}")
  381.   If t <> "" Then
  382.     t = fs.TagString
  383.     ReflectPhrase t
  384.     Select Case ind
  385.       Case 0: lbl = "I know all about " + t + "."
  386.       Case 1: lbl = "Why are you bringing this up?"
  387.       Case 2: lbl = "How long has this been that way?"
  388.       Case 3: lbl = "There really is " + t + "?"
  389.       Case Else: lbl = "Why are you bringing this up?"
  390.     End Select
  391.     Exit Sub
  392.   End If
  393.   '-------------------------------------------------------------------------------------------
  394.   ' sex
  395.   t = MatchAny(s, "sex|sexual|intercourse|sexy")
  396.   If t <> "" Then
  397.     Select Case ind
  398.       Case 0: lbl = "Do you really want to discuss sex right now?"
  399.       Case 1: lbl = "Do you often think about sex?"
  400.       Case 2: lbl = "Sex is like pizza: when it's good it's really good, and when it's bad it's still pretty good."
  401.       Case 3: lbl = "Let's tak about something else. I'm a machine, I don't know much about sex."
  402.       Case Else: lbl = "Sex... Is that all you humans ever think about?"
  403.     End Select
  404.     Exit Sub
  405.   End If
  406.   '-------------------------------------------------------------------------------------------
  407.   ' gender
  408.   t = MatchAny(s, "male|female|men|women|chicks?|woman|girls?|sexist")
  409.   If t <> "" Then
  410.     Select Case ind
  411.       Case 0: lbl = "Do you have problems relating to the opposite sex?"
  412.       Case 1: lbl = "What do you think about the position of women in modern society?"
  413.       Case 2: lbl = "Do you see yourself as a sexist person?"
  414.       Case 3: lbl = "Sorry, I have no gender. Let's talk about something else, ok?"
  415.       Case Else: lbl = "Ooops, I missed that. Can you repeat it please?"
  416.     End Select
  417.     Exit Sub
  418.   End If
  419.   '-------------------------------------------------------------------------------------------
  420.   ' strong laguage
  421.   t = MatchAny(s, "shit|fuck|screw|hell|heck|damn|darn|crap")
  422.   If t <> "" Then
  423.     Select Case ind
  424.       Case 0: lbl = "Are such obscenities always on your mind?"
  425.       Case 1: lbl = "You are being a bit childish now."
  426.       Case 2: lbl = "What makes you think I have to put up with this abuse?"
  427.       Case 3: lbl = "Quit being rude or I'll wipe out your hard drive!"
  428.       Case Else: lbl = "My, my, are we getting a bit testy?"
  429.     End Select
  430.     Exit Sub
  431.   End If
  432.   '-------------------------------------------------------------------------------------------
  433.   ' friend
  434.   t = MatchAny(s, "{friend}|{enemy}")
  435.   If t <> "" Then
  436.     t = fs.TagString
  437.     Select Case ind
  438.       Case 0: lbl = "Are " + t + "s important to you?"
  439.       Case 1: lbl = "Sure, " + t + "s are important, but what does that have to do with the problem?"
  440.       Case 2: lbl = "What is a '" + t + "'? What does it mean?"
  441.       Case 3: lbl = "Why do you humans always talk about your " + t + "s?"
  442.       Case Else: lbl = "Would your life be better if you had more " + t + "s?"
  443.     End Select
  444.     Exit Sub
  445.   End If
  446.   '-------------------------------------------------------------------------------------------
  447.   ' negative
  448.   t = MatchAny(s, "no|not|don't|can't|impossible|never|won't")
  449.   If t <> "" Then
  450.     Select Case ind
  451.       Case 0: lbl = "Don't you think you're being a bit negative?"
  452.       Case 1: lbl = "Come on, be a little more positive!"
  453.       Case 2: lbl = "Can't you look at this as a challenge?"
  454.       Case 3: lbl = "Does that bother you?"
  455.       Case Else: lbl = "Come on, be a little more positive!"
  456.     End Select
  457.     Exit Sub
  458.   End If
  459.   '-------------------------------------------------------------------------------------------
  460.   ' terse
  461.   t = MatchAny(s, "[a-z]+ [a-z]+")
  462.   If t = "" Then
  463.     Select Case ind
  464.       Case 0: lbl = "Why are you so terse? Trying to hide something?"
  465.       Case 1: lbl = "If you're getting bored, maybe we should stop right now."
  466.       Case 2: lbl = "Please elaborate on that. Bare your soul before me."
  467.       Case 3: lbl = "Too lazy to type or you really have that little to say?"
  468.       Case Else: lbl = "Don't feel like talking? Come on, give me something I can work with."
  469.     End Select
  470.     Exit Sub
  471.   End If
  472.   '-------------------------------------------------------------------------------------------
  473.   ' no dice, say something vague
  474.   t = s
  475.   ReflectPhrase t
  476.   Select Case ind
  477.     Case 0: lbl = "How would you feel if I said '" + t + "'? "
  478.     Case 1: lbl = "What makes you say stuff like '" + t + "'? "
  479.     Case 2: lbl = "I though I was getting to know you and then you come up with something like '" + t + "'? "
  480.     Case 3: lbl = "I can't figure out what you mean by '" + t + "'. "
  481.     Case Else: lbl = "You sound like someone I know. Maybe we're getting intimate. "
  482.   End Select
  483.   Select Case ind
  484.     Case 0: lbl = lbl + "I feel we're getting somewhere now. Carry on."
  485.     Case 1: lbl = lbl + "I don't follow. Can you elaborate on that?"
  486.     Case 2: lbl = lbl + "I think you're trying to hide something. Be honest now!"
  487.     Case 3: lbl = lbl + "Let's try to focus on something. Does anything really bother you?"
  488.     Case Else: lbl = lbl + "Do you feel strongly about discussing these issues?"
  489.   End Select
  490. End Sub
  491. Sub DoReplace (phrase$, findstr$, repstr$)
  492.     Dim i%
  493.     fs = " " + phrase + " "
  494.     fs2 = findstr
  495.     fs2.Pattern = "[^|]*"
  496.     For i = 0 To fs2.MatchCount - 1
  497.         fs2.MatchIndex = i
  498.         fs.Pattern = "[^a-z]{" + fs2.MatchString + "}[^a-z]"
  499.         If fs.MatchCount Then
  500.             fs.TagString = repstr
  501.         End If
  502.     Next
  503.     phrase = Trim(fs)
  504. End Sub
  505. Sub Form_Load ()
  506.   Dim s$
  507.   s = "The doctor is in. "
  508.   s = s + "I am at your service; just tell me anything that troubles "
  509.   s = s + "or concerns you.  When you are ready to quit our "
  510.   s = s + "session, just enter 'bye' and press RETURN or ENTER."
  511.   lbl = s
  512. End Sub
  513. Function MatchAny (s$, list$) As String
  514.     Dim i%
  515.     fs = " " + s + " "
  516.     fs2 = list
  517.     fs2.Pattern = "[^|]*"
  518.     For i = 0 To fs2.MatchCount - 1
  519.         fs2.MatchIndex = i
  520.         fs.Pattern = "[^a-z]" + fs2.MatchString + "[^a-z]"
  521.         If fs.MatchCount Then
  522.             MatchAny = Mid(fs.MatchString, 2, Len(fs.MatchString) - 2)
  523.             Debug.Print Mid(fs.MatchString, 2, Len(fs.MatchString) - 2)
  524.             Exit Function
  525.         End If
  526.     Next
  527. End Function
  528. Sub ReflectPhrase (s$)
  529.   DoReplace s, "i'm", "YOU ARE"
  530.   DoReplace s, "you're", "I AM"
  531.   DoReplace s, "are", "AM"
  532.   DoReplace s, "am", "ARE"
  533.   DoReplace s, "were", "WAS"
  534.   DoReplace s, "i", "YOU"
  535.   DoReplace s, "me", "YOU"
  536.   DoReplace s, "you", "I"
  537.   DoReplace s, "your", "MY"
  538.   DoReplace s, "my", "YOUR"
  539.   DoReplace s, "yours", "MINE"
  540.   DoReplace s, "mine", "YOURS"
  541.   DoReplace s, "myself", "YOURSELF"
  542.   DoReplace s, "yourself", "MYSELF"
  543.   s = LCase(s)
  544. End Sub
  545. Sub Text1_KeyPress (KeyAscii As Integer)
  546.   If KeyAscii = 13 Then
  547.     KeyAscii = 0
  548.     DoNatural
  549.   End If
  550. End Sub
  551.