BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a context-base input/ output system and, more particularly, to a context-base input/output system for inputting a manually drawn sketch to a computer to convert it into a geometrically defined pattern and to display it. 
     2. Description of the Prior Art 
     Generally speaking, pattern input to the computer is accomplished by means of an electronic pen, a digitizer, a mouse or the like after either a menu (i.e., a table indicating the functions) on the screen of a CRT or a tablet menu on a tablet has been selected. In case a circle is to be displayed on a CRT by means of the electronic pen and the tablet, for example, the function to display the circle is selected from the menu, and a data corresponding to a central point of the circle and one point on its circumference are registered at a predetermined position of the tablet by means of the electronic pen. Then, the computer executes graphic processing to display the circle according to the input data on the CRT. According to a method using the tablet menu, on the other hand, difference from the foregoing method is limited to a point that the selection of function from the menu is executed on the tablet. 
     However, the aforementioned methods of selecting the graphic processing function according to the menus suffer from problems that a number of steps of selecting the function from the menu is more than a method of manually drawing a segment or circle directly on a paper by writing means so that they are not only troublesome but also felt with a physical disorder, thus making it difficult to use the tool. Moreover, the method of inputting the data is executed by inputting the data of specific points and is followed by the feeling of a physical disorder because operations are different from those in case the pattern is manually drawn. 
     SUMMARY OF THE INVENTION 
     The present invention is conceived to solve the above-specified problems and has as an object to provide a context-base input/output system capable of inputting a physical data, as if a pattern were to be drawn on a paper by writing means, to display a pattern thereof. 
     According to a major feature of the present invention, there is provided a context-base input/output system including: input means having an electronic pen and a tablet for converting a locus of the electronic pen on a tablet into dot data to input them; first determining means based on the input dot data for determining what of at least a segment, circle and arc is expressed by the locus; display means based on the determination result of the first determining means for displaying a pattern expressed by the locus in a display apparatus; memory means for memorizing graphic processing commands which correspond to a plurality of predetermined patterns, respectively; second determining means based on the determination result of the first determining means for determining whether or not the predetermined patterns are expressed by the locus; and processing means based on the determination result of the second determining means for graphic processing in response to the commands corresponding to the predetermined patterns expressed by the locus. 
     The input means of the present invention is composed of the electronic pen and the tablet, and the locus of the electronic pen on the tablet is converted into dot data before it is registered. Thus, the data of a manually drawn pattern are converted into the dot data and inputted by drawing the pattern on the tablet by the electronic pen. The first determining means is based upon the inputted dot data for determining what of at least the segment, circle and arc is expressed by the locus of the electronic pen on the tablet. The display means is based on the determination result of the first determining means for displaying on the display apparatus the pattern expressed by the locus of the electronic pen. Thus, even in case the manually drawn pattern, i.e., the locus of the electronic pen fails to express a geometrically accurate pattern, it is determined by the first determining means what pattern is expressed, that is to say, what geometric pattern the manually drawn pattern resembles. As a result, the manually drawn pattern is converted into the geometrically defined pattern and displayed on the display apparatus. Thus, the pattern can be inputted or outputted without using any menu. 
     On the other hand, the memory means memorizes or stores the graphic processing commands corresponding to a plurality of predetermined patterns, respectively. The second determining means is based on the determination result of the first determining means for determining whether or not the predetermined patterns are expressed by the locus of the electronic pen. The processing means is based on the determination result of the second determining means for graphic processing in response to the command corresponding to the predetermined drawing expressed by the locus of the electronic pen, if so expressed. Thus, the graphic processing command can be designated by drawing a specific pattern without using any menu. 
     Incidentally, the pattern will be herein termed to be a set of points, lines and planes as well as letters and symbols. 
     Other objects, features and advantages of the present invention will become apparent from the following description to be made with reference to the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The accompanying drawings illustrate the preferred embodiment of the present invention, in which: 
     FIG. 1 is a flow chart showing a control routine of an embodiment of the present invention; 
     FIG. 2 is a block diagram schematically showing the embodiment of the present invention; 
     FIG. 3 is a flow chart showing the details of Step 38; 
     FIG. 4 is a flow chart showing the details of Step 50; 
     FIG. 5 is a flow chart showing the details of Step 36; 
     FIGS. 6(A) to 6(G) are diagrams explaining the processing of pattern recognition; 
     FIGS. 7(A) to 7(C) are diagrams explaining the shape of an operator; and 
     FIGS. 8(A) to 8(C) are diagrams for explaining the automatic edition of a pattern. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     A context-base input/output system of the present invention will be described in detail in connection with an embodiment thereof with reference to the accompanying drawings. FIG. 2 is a schematic view showing the embodiment, in which a graphic processing computer 10 is composed of a CPU, a ROM and a RAM. The computer 10 is connected with a CRT 12, a keyboard 14 and a tablet 16. The tablet 16 is connected with an electric pen 18, and a tip of the electric pen 18 is movable on and in contact with a surface of the tablet 16 to convert a moving locus into dot data, which are then inputted to the computer 10. The computer 10 has the ROM stored in advance with both the program of a graphic processing control routine, as will be described hereinafter, and commands corresponding to specific patterns. The control routine will be described in the following. 
     When a switch of the context-base input/output system is turned on, the routine shown in FIG. 1 is started. The routine is initialized at Step 30, and pattern recognizing parameters are set at Step 32. These parameters are used to determine which of segment, circle and arc the dot data inputted from the tablet resemble. The parameters may include ε1, ε2 and so on, as will be described in the following, and are additionally prepared, if necessary. At next Step 34, it is determined which the data are inputted from the tablet 16 or the keyboard 14. If it is determined that the data are inputted from the keyboard 14, the keyboard inputting operation is executed at Step 36, as will be described in more detail with reference to FIG. 5. 
     If, on the other hand, it is determined at the Step 34 that the data are inputted from the tablet 16, the pattern recognition is executed at Step 38. The details of this pattern recognition will be described hereinafter with reference to FIG. 3. At subsequent step 40, it is determined whether the pattern recognized at the Step 38 is one to be drawn or one expressed by a predetermined pattern. If it is determined that the recognized pattern is to be drawn, the pattern is automatically edited at Step 44, and graphic data thereof are then stored at Step 46 until the pattern is displayed in the CRT 12 at Step 48. If, on the other hand, it is determined that the recognized pattern is an operator, the operator is processed at Step 50, and the pattern data are stored at the Step 46 until the routine advances to the Step 48. Incidentally, the operator processing will be described hereinafter. 
     Next, the pattern recognition of the Step 38 will be described with reference to FIG. 3. First of all, the dot data inputted from the tablet 16 takes the shape, as shown in FIG. 6(A), for example. At Step 60, a formula expressing a straight line passing through the start point P1 and the end point P2 of the dot data is arithmetically determined (as shown in FIG. 6(B)). At nest Step 62, one remotest point P3 from that a straight line is selected, and the distance d between the remotest point P3 and the straight line is arithmetically determined (as shown in FIG. 6(C)). At Step 66, the distance d is compared with a parameter ε1. If d&gt;ε1, the remotest point P3 selected at the Step 62 is caused to substitute the start and end points at Step 68, and the routine returns to the Step 60. As a result, the point P3 becomes the end point with respect to the start point P1 and becomes the start point with respect to the end point P2. At the Step 60, formulas of the two straight lines, as shown in FIG. 6(D), are arithmetically determined. At this time, the point P3 becomes a broken point of the traverse passing through the points P1, P3 and P2. At the Step 62, moreover, there are selected remotest points P4 and P5 from those straight lines. If the distances to the points P4 and P5 are larger than the parameter ε1, the formulas of the straight lines P1 to P4, P4 to P3 and P5 to P2 are individually determined (as shown in FIG. 6(E)), as described above. These Steps 60, 62, 64 and 68 are repeated until the distance to the remotest point becomes less than the parameter ε1, so that the traverse shown in FIG. 6(F) can be formed. 
     At subsequent Step 70, a center of a virtual circle having the circumference or arc resembling that traverse the most data points is determined by determining the perpendicular bisector of one traverse line forming the traverse. At Step 72, a formula of a virtual circle having the virtual center is determined, and the maximum value D of the distance between the virtual circle and the traverse is determined at Step 74 (as shown in FIG. 6(G)). At Step 76, the maximum value D of the distance and a parameter ε2 is compared. If D≦ε2, it is determined that the virtual circle and the traverse resemble in shape, and this traverse is recognized as the circle or arc. 
     If D&gt;ε2, on the other hand, it is determined that the traverse fails to resemble the circle, the traverse is recognized as the segment or traverse. This recognized pattern is automatically edited and is then displayed by the CRT. 
     Next, the operator processing will be described with reference to FIG. 4. At first Step 100, it is determined which of the following Table the operator inputted from the tablet belongs to: 
     
                       TABLE______________________________________Shape of Operator        Command   Function______________________________________X            Erase     Erase designated pattern                  element/            Cut       Divide designated pattern                  element(closed)     Wrap      Recognize pattern element in                  wrapper (wrapper &amp; arrow)        Copy      Copy recognized pattern (wrapper &amp; arrow)        Magnify   Magnify recognized pattern (wrapper &amp; arrow)        Reduce    Reduce recognized pattern______________________________________ 
    
     The operator will be described in the following. The symbol &#34;X&#34; designates the operator having a command to erase, which has a function to erase the pattern element designated by an overwrite, as shown in FIG. 7(A). The symbol &#34;/&#34; designates the operator having a command to cut, which has a function to divide across the operator a pattern element designated by the overwrite, as shown in FIG. 7(8). The symbol &#34;○&#34;, which may take any shape if it is closed, designates the operator having a command to wrap, which has a function to recognize the pattern element enclosed by the closed 
     pattern. By combining a wrapper and an arrow head &#34;→&#34;, it is possible to define the operator having the commands to copy, magnify and reduce. The function to copy the pattern recognized by the wrapper can be obtained by combining the arrow head &#34;→&#34; starting from that recognized pattern. The function to magnify the pattern recognized by the wrapper can be obtained by combining the outward arrow head &#34;→&#34; starting from the wrapper. Moreover, the function to reduce the pattern recognized by the wrapper can be obtained by combining the inward arrow head &#34;→&#34; starting from the wrapper. These operators can be discriminated whether the pattern is to be drawn or belongs to the operator, by determining whether or not the individual lengths of the pattern elements composing the operator are less than the parameters d1 and d2, as shown in FIGS. 7(A) to 7(C). The operator is recognized only in case the wrapper and the arrow head &#34;→&#34; are drawn in combination for a short time. If it is determined at the Step 100 that the operator has the command to erase, the designated pattern element is erased from the memory at Step 102. Moreover, the graphic processings, as tabulated above, are executed at Steps 104 to 110. 
     FIG. 5 shows the detail of the Step 36. It is judged at Step 112 whether or not an ending function is selected from a menu displayed by the CRT. If YES, the routine shown in FIG. 1 is ended. Otherwise, the processing according to another function selected according to the menu is executed at Step 114. The function include change of the magnitude of the graphic processing parameter, as has been described at the Step 32, and the store, write, erase, hard copy, all clear and help. 
     Next, the automatic edition of the Step 44 will be described with reference to FIG. 8. First of all, as shown in FIG. 8(A), a center angle θ between a horizontal line H and a vertical line V is set as a parameter. If the segment recognized by the pattern recognization is within the range of the angle θ with respect to the horizontal line H or the vertical line V, it is edited to the horizontal line H or the vertical line V. As shown in FIG. 8(B), moreover, the region of a diameter d3 around the end (point) of one segment is determined in advance. If the region includes a plurality of ends of the individual segments, the ends are connected and edited again, as shown in FIG. 8(C). 
     Incidentally, the description thus far made is directed to an example in which the pattern inputted is displayed by the CRT. If the tablet used has a display, that CRT can be omitted to accomplish the manual drawing and the pattern display can be executed in the common portion. Moreover, the description thus far made is directed to an example in which the segment, circle or arc is recognized. However, another pattern such as an ellipse may be recognized. As the operator, there may be defined and processed the movement of a pattern, the drawing of symmetric patterns and the drawing of rotation of a pattern. Still moreover, another function of processing the intersection may be added as the editing function. 
     As has been described hereinbefore, according to the present invention, the graphic data can be inputted and displayed by the drawing operation using the electronic pen without selecting the graphic processing function from the menu. There can be attained an effect that the drawing can be accomplished on the basis of human engineering without feeling any physical disorder.
When a pattern is manually drawn on a tablet with an electronic pen, a computer executes a graphic processing to display on a CRT a geometrically defined pattern which best resembles the manually drawn pattern. Moreover, a pattern element is erased, divided or copied by memorizing a graphic processing command in advance in a manner to correspond to a predetermined pattern or operator and by manually drawing this operator on the tablet with the electronic pen. The pattern data can be inputted to the computer to display the pattern by the same operations as those for drawing on a paper with writing apparatus so that the pattern can be drawn on the basis of the human engineering without feeling any physical disorder.