<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Georgia">Maybe 5 years before Genie. Here's the
      ancestor:<br>
      <br>
      recognize | prv cdir result features char r s t dir |<br>
      <br>
      "Alan Kay's recognizer as of 1/31/96.&nbsp; This version preserved for
      historical purposes, and also because it's still called by the
      not-yet-deployed method recogPar.&nbsp; Within the current image, the
      recognizer is now called via #recognizeAndDispatch:until:"<br>
      <br>
      <br>
      "Inits"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (p _ Pen new) defaultNib: 1; down.<br>
      &nbsp;&nbsp;&nbsp; "for points"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pts _ ReadWriteStream on: #().<br>
      <br>
      "Event Loop"&nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [(Sensor mousePoint x) &lt; 50] whileFalse:<br>
      <br>
      "First-Time"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [pts reset.&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
      "will hold features"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ftrs _ ''.<br>
      <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; (Sensor anyButtonPressed) ifTrue:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [pts nextPut: (bmin _ bmax _ t _ s _ sts _
      Sensor mousePoint).<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; p place: sts. cdir _ nil.<br>
      <br>
      "Each-Time"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [Sensor anyButtonPressed] whileTrue:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [<br>
      "ink raw input"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; p goto: (r _ Sensor mousePoint).<br>
      "smooth it"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; s _ (0.5*s) + (0.5*r).<br>
      "thin the stream"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ((s x - t x) abs &gt; 3 or:[(s y - t y)
      abs &gt; 3]) ifTrue:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [ pts nextPut: t. <br>
      "bounding box"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; bmin _ bmin min: s. bmax _ bmax max: s.<br>
      "get current dir"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dir _ (self fourDirsFrom: t to:
      s). t _ s.<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dir ~= ' dot... ' ifTrue: [<br>
      "store new dirs"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cdir ~= dir ifTrue: [ftrs _
      ftrs, (cdir _ dir)]].<br>
      "for inked t's" &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; p place: t; go: 1; place: r.<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ].<br>
      &nbsp;"End Each-Time Loop"&nbsp;&nbsp;&nbsp; ].<br>
      <br>
      "Last-Time"&nbsp;&nbsp;&nbsp; <br>
      <br>
      "save last points"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pts nextPut: t; nextPut: r.<br>
      "find rest of features"&nbsp;&nbsp;&nbsp; features _ self extractFeatures.<br>
      "find char..."&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; char _ CharacterDictionary at: features
      ifAbsent:<br>
      "...or get from user"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [ result _ FillInTheBlank
      request:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;'Not recognized. type char, or type
      ~: ', features.<br>
      "ignore or..."&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; result = '~' ifTrue: ['']<br>
      "...enter new char"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifFalse: [CharacterDictionary at:
      features put: result. result]].<br>
      <br>
      "control the editor"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (char = 'cr' ifTrue: [Transcript cr]
      ifFalse:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [char = 'bs' ifTrue: [Transcript bs]
      ifFalse:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [char = 'tab' ifTrue:[Transcript tab]
      ifFalse:<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [Transcript show: char]]]). <br>
      <br>
      "End First-Time Loop"&nbsp;&nbsp;&nbsp; ]. <br>
      <br>
      "End Event-Loop" ]. <br>
      <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br>
      &nbsp;<br>
    </font>
    <div class="moz-cite-prefix">On 3/21/13 8:06 PM, Colin Putney wrote:<br>
    </div>
    <blockquote
cite="mid:CAD+=c1gUPF8SmhxWsQBshERKaLT44oRT_F5bhKTOZtqck=QG4g@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">On Thu, Mar 21, 2013 at 4:07 PM, Bert
            Freudenberg <span dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote"
style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div style="word-wrap:break-word">
                The recognizer still works in the Etoys image.</div>
            </blockquote>
            <div><br>
            </div>
            <div>Was that Genie, or another system?</div>
            <div><br>
            </div>
            <div>It seems like Genie is still available, though it
              probably doesn't work in modern Squeak:</div>
            <div><br>
            </div>
            <div><a moz-do-not-send="true"
                href="http://bike-nomad.com/squeak/monticello/Genie/">http://bike-nomad.com/squeak/monticello/Genie/</a></div>
            <div><br>
            </div>
            <div>Colin&nbsp;</div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">
</pre>
    </blockquote>
    <br>
  </body>
</html>