Document processing method and apparatus

Abstract: A document processing apparatus having a spell checker function for detecting a misspelling of an input word, and informing the detected misspelling, includes a control unit for detecting a presence/absence of a dictionary memory used in detection of the misspelling of the word, and enabling/disabling the spell checker function in accordance with a detection result.

Description: The present invention relates to a document processing apparatus such as an electronic typewriter, a wordprocessor, and the like and, more particularly, to a document processing method and apparatus having a spell checker function. In recent years, many document processing apparatuses have a spell checker function for detecting misspellings of input words, and informing it to an operator. In particular, many European language document processing apparatuses adopt an English spell checker function. The European language document processing apparatuses are presented to countries in other language zones such as a French-speaking zone, a German-speaking zone, and the like as well as countries in an English-speaking zone. In this case, apparatuses in which the English spell checker function is enabled are presented to the English-speaking zone, and apparatuses in which the English spell checker function is disabled are usually presented to countries other than the English-speaking zone. In this case, in an arrangement of the conventional document processing apparatus, the spell checker function is enabled/disabled depending on a difference in control software, or by selecting connection of a specification setup switch or a jumper wire. However, in the arrangement for enabling/disabling the spell checker function depending on a difference in software, different software programs must be prepared in units of shipping countries. More specifically, combinations of parts such as ROMs (read-only memories) storing the software programs are different in correspondence with shipping countries, and assembling and inspection processes in the manufacture of the apparatuses must be performed in units of shipping countries, resulting in an increase in manufacturing cost. With the arrangement using the specification setup switch or jumper wire, the above-mentioned switch or the like is required, and the setup operation for the switch or the like is required, resulting in high cost. It is known from IBM Technical Disclosure Bulletin, vol.25, no.4, September 1982, Armonk, New York, US, Pages 2163-2164 to provide a spelling checking facility based on a dictionary and for the system to display an error message if the checking facility is selected without the dictionary having been loaded. It is also known from Patent Abstracts of Japan, vol. 012, no. 415 (P-781), 4 November 1988 & JP-A-63153690, 27 June 1988, abstract to provide a dictionary memory in an IC card. Connection of the card to a device is disciminated by a processor of the device by sensing a voltage level change at an input of the device derived from a battery mounted on the card. According to the present invention, there is disclosed a document processing apparatus for processing word data having a detachable dictionary memory defining a dictionary and having a spelling checking means which is operable to perform a spelling checking function by searching the dictionary for words of the word data, characterised by further comprising; discriminating means operable to discriminate whether a predetermined word is found to be stored in the dictionary as a result of operating the spelling checking means to search for the predetermined word, the predetermined word belonging to a predetermined language in which the spelling checking function is to be performed; and setting means operable to set said spelling checking means valid in response to a discrimination by said discriminating means that the predetermined word is stored in the dictionary and to set said spelling checking means invalid in response to a discrimination by said discriminating means that the predetermined word is not found as a result of operating the spelling checking means to search for the predetermined word, whereby the spelling checking means is set invalid when the dictionary memory is detached. An advantage of the present invention is to provide a document processing method and apparatus having a spell checker function, which can automatically enable/disable the spell checker function with an inexpensive arrangement. A further advantage of the present invention is to provide a document processing method and apparatus, which can automatically enable/disable a spell checker function in accordance with the presence/absence of a dictionary memory. Preferred embodiments of the present invention will now be described by way of example only and with reference to the accompanying drawings of which; Fig. 1 is a block diagram showing an arrangement of a control system of an electronic typewriter; Fig. 2 is a perspective view showing the outer appearance of the typewriter shown in Fig. 1; Fig. 3 is an explanatory view of a storage content of a ROM 7 shown in Fig. 1; Fig. 4 is a flow chart showing a main control processing sequence of a CPU 1 shown in Fig. 1; Figs. 5 and 6 are flow charts respectively showing presence/absence detection processing and spell checker processing in Fig. 4; Fig. 7 is a block diagram showing an arrangement of a control system of an electronic typewriter according to the second embodiment of the present invention; Fig. 8 is a perspective view of a portion near a card insertion port, for receiving a ROM card, of the typewriter shown in Fig. 7; Figs. 9A and 9B are explanatory views showing an arrangement and operation for detecting an open/closed state of a cover 12 shown in Fig. 8; and Fig. 10 is a flow chart showing presence/absence detection processing in accordance with an opening/closing operation of the cover. An embodiment of the present invention will be described in detail below with reference to the accompanying drawings. This embodiment exemplifies a European language electronic typewriter which can enable/disable an English spell checker function. Note that the present invention may be attained by a single apparatus or may be attained by a system consisting of a plurality of devices. As a matter of course, the present invention may be attained by supplying a program to the apparatus or system. First Embodiment Figs. 1 to 6 are views for explaining an electronic typewriter according to the first embodiment of the present invention. Fig. 2 shows the outer appearance of the electronic typewriter. A keyboard 3 as an operation input means, and a display 5 comprising an LCD (liquid crystal display) for performing various displays are arranged on the upper surface of the typewriter main body. An operator can operate the keyboard 3 to input character data, thereby creating a document on the display 5. The created document can be printed out on a printing paper sheet 14 by a printer 4. The printer 4 comprises, e.g., a daisy-wheel printer for printing data using a daisy wheel. The arrangement of a control system of the electronic typewriter will be described below with reference to Fig. 1. In Fig. 1, a CPU (central processing unit) 1 comprises a microprocessor element for controlling the entire electronic typewriter. The CPU 1 is connected to the keyboard 3, the printer 4, the display 5, a RAM (random-access memory) 6, a ROM (read-only memory) 7, and a dictionary ROM 8 via a bus 2. The RAM 6 is used as a working area for the CPU 1, a buffer for storing printing data, and the like, and a portion of the RAM 6 is used as a register 6a for storing enable/disable setup data of a spell checker function as data indicating a detection result of the presence/absence in the dictionary ROM 8 (to be described later), and a register 6b for storing word data to be spell-checked. Note that the buffer 6b is used for storing target data "this" in presence/absence detection processing shown in Fig. 5 (to be described later). The content of the ROM 7 is as shown in Fig. 3. The ROM 7 stores a main control program 7a corresponding to a control sequence of the main routine shown in Fig. 4, a spell checker control program 7b corresponding to a control sequence of the presence/absence detection processing shown in Fig. 5 and spell checker processing shown in Fig. 6, and target data 7c. For example, an English word "this" is used as the target data 7c so as to detect the presence/absence in the English dictionary ROM 8. The dictionary ROM 8 stores English dictionary data, i.e., dictionary data for detecting misspellings (errors) of English words. When the typewriter of this embodiment is delivered to the countries in the English-speaking zone, the dictionary ROM 8 is arranged; when the typewriter of this embodiment is delivered to countries in the non-English-speaking zone, no dictionary ROM 8 is arranged. Note that the dictionary data are so-called hash-coded data. With this arrangement, the CPU 1 reads out and executes the control programs 7a and 7b stored in the ROM 7 in accordance with a reset signal upon power-on of the typewriter, and analyzes input data if an operator inputs data using the keyboard 3. The CPU 1 causes the display 5 to display input characters, or drives the printer 4 to print data, or stores input character or document data in the RAM 6 as needed. The CPU 1 detects the presence/absence of the dictionary ROM 8, and enables/disables the spell checker function in accordance with the detection result. When the CPU 1 enables the spell checker function, it detects errors of word data input from the keyboard 3, or word data in a prestored document. When an error is detected, the CPU 1 informs the detected error to the operator by means of the display 5 or a buzzer (not shown). The control operations of the CPU 1 will be described in detail below with reference to Figs. 4 to 6. Fig. 4 shows the main routine of the control operation of the CPU 1. This routine is started in response to a reset signal upon power-on of the typewriter. In step S1 in Fig. 4, the respective sections of the typewriter, e.g., the keyboard 3, the printer 4, the display 5, and the like are initialized. In step S2, the presence/absence of the dictionary ROM 8, i.e., whether or not the dictionary ROM 8 is arranged in this typewriter is checked by the processing shown in Fig. 5 (to be described later). The detection result data is set in the register 6a as setup data indicating an enabled/disabled state of the spell checker function. In step S3, characters input from the keyboard 3 are monitored. If the character input is detected, spell checker processing in Fig. 6 (to be described later) is executed in step S4. In step S5, the error detection result of the spell checker processing is checked. If the input data is correct, the flow advances to step S7; otherwise, the buzzer (not shown) is operated, or a display state of an error word displayed on the display 5 is reversed in step S6, thus informing and alarming the error of the word to an operator. The flow then advances to step S7, and the input characters are printed in accordance with the key inputs in step S3, or a document stored in the RAM 6 is edited. The flow returns to step S3, and processing from step S3 is repeated. The presence/absence detection processing shown in Fig. 5 executed in step S2 will be explained below. In the processing shown in Fig. 5, in step S10, "0" is temporarily set as data in the register 6a. The data "0" corresponds to a detection result indicating that no dictionary ROM 8 is arranged, and indicating that the spell checker function is disabled. In step S11, the target data 7c in the ROM 7 described above with reference to Fig. 3 is transferred to the buffer 6b of the RAM 6. In step S12, search processing (steps S23 to S26) in the spell checker processing shown in Fig. 6 (to be described later) is executed to check if the target data "this" in the buffer 6b is present as data in the dictionary ROM 8. The search processing result is set in a status register (not shown) in the CPU 1 or the RAM 6 as normal status (presence of corresponding data) or error status (absence of corresponding data). In step S13, it is checked if the detection result of the search processing corresponds to the error status. If the error status is detected, the processing is ended. More specifically, in this case, if data "this" is not present as data in the dictionary ROM 8, this means that no dictionary ROM 8 is present. Therefore, the data "0" in the register 6a, which data indicates the absence of the dictionary ROM 8, and the disabled spell checker function is left unchanged, and the processing is ended. On the other hand, if the search processing result does not correspond to the error status in step S13, since the dictionary ROM 8 is present, data "1" indicating that the dictionary ROM 8 is present, and the spell checker function is enabled is set as the data in the register 6a in step S14. The processing is then ended. The spell checker processing will be described below with reference to Fig. 6. In the spell checker processing in Fig. 6, the data in the register 6a which data is set in the presence/absence detection processing in Fig. 5 is referred to in step S20 to check the enabled/disabled state of the spell checker function. If the data in the register 6a is "0", since the spell checker function is disabled, the flow advances to step S25, and the above-mentioned normal status is output so as not to execute the alarm processing in step S6 in Fig. 4, thus ending the processing. On the other hand, if the data in the register 6a is "1" in step S20, i.e., if the spell checker function is enabled, the flow advances to step S21 to check if an input corresponds to an end or pause of a word, e.g., to check if the input corresponds to a space. If the input is a character input other than a space, and is not an end of a word, since no spell check processing is executed, the processing is ended via step S25 described above. If the input corresponds to an end of a word in step S21, a series of characters before the end of the word is recognized as a word, and the flow advances to step S22. In step S22, the recognized word data is set in the buffer 6b, and thereafter, the search processing corresponding to step S12 in Fig. 5 described above is executed in steps S23 to S26. In step S23, the word data set in the buffer 6b is converted into a hash code, thereby searching to determine if the data is present in the dictionary ROM 8. In this embodiment, two bytes of the dictionary ROM 8 correspond to one hash code. For example, if there is no corresponding data in the dictionary ROM 8, a hash code FFFF(HEX) appears. If the data in the buffer 6b in step S23 is "this", its hash code is not FFFF(HEX). In step S24, the search result in step S23 is checked. If the word data in the buffer 6b is present in the dictionary ROM 8, the normal status is output in step S25 so as not to execute the alarm processing in step S6, thus ending the processing. If the word data is not present in the dictionary ROM 8, the error status is output to execute the alarm processing in step S6, thus ending the processing. As described above, according to the electronic typewriter of this embodiment, the presence/absence of the dictionary ROM 8 is detected by searching the target data "this", and the spell checker function is enabled/disabled in accordance with the detection result. More specifically, the spell checker function is automatically enabled/disabled depending on whether or not the English dictionary ROM 8 is arranged. Regardless of whether the spell checker function is enabled or disabled, the common software program of only one kind is stored in the ROM 7. Thus, different ROMs depending on shipping countries need not be prepared like in the prior art wherein the spell checker function is enabled/disabled depending on differences in software programs. In addition, the numbers of parts and assembling steps are not increased unlike in the prior art wherein the above-mentioned setting operation is performed by a setup switch or a jumper wire. As a result, the manufacturing cost can be reduced. Second Embodiment In the arrangement of the first embodiment, the dictionary ROM 8 may be arranged as a so-called ROM card, and may be detachable from an electronic typewriter as an optional component. In this case, in the first embodiment, the presence/absence detection processing shown in Fig. 5 for enabling/disabling the spell checker function is performed in accordance with a reset signal upon power-on of the electronic typewriter. Therefore, an operator must turn on/off or reset the typewriter every time he or she inserts or removes a ROM card. In order to eliminate the above drawback, the insertion/removal operation of the dictionary ROM card can be detected, and the presence/absence detection processing shown in Fig. 5 can be performed immediately after completion of the insertion/removal operation. The electronic typewriter with this arrangement will be described below as the second embodiment with reference to Figs. 7 to 10. Fig. 7 shows the arrangement of a control system of the electronic typewriter according to this embodiment. In Fig. 7, common reference numerals denote common or corresponding parts in Fig. 1 in the first embodiment, and a description of the common parts will be omitted. As a difference from Fig. 1 in the arrangement shown in Fig. 7, a dictionary ROM 8 is incorporated in a ROM card 9. The ROM card 9 is inserted from a card insertion slot 11 formed in the side portion of the exterior of an electronic typewriter main body 10 in a direction of an arrow S, and is mounted in the main body 10. In this state, the dictionary ROM 8 is connected to a CPU 1 via a bus 2. The mounted ROM card 9 can be removed in a direction of an arrow R. A cover 12 is arranged on the card insertion slot 11 to be pivotal in directions of arrow a and b , i.e., to be openable/closable about a shaft 12b as a fulcrum, as shown in Figs. 9A and 9B. The insertion/removal operation of the ROM card 9 is performed by opening the cover 12 in the direction of the arrow a by an operator. When the operator releases his or her finger from the cover 12 upon completion of the insertion/removal operation, the cover 12 is pivoted in the direction of the arrow b by, e.g., a biasing force of a spring (not shown), and is closed. A projection 12a is formed on the cover 12. As another difference from Fig. 1 in the arrangement shown in Fig. 7, a detector 13 for detecting the insertion/removal operation of the ROM card 9 is arranged. In practice, the detector 13 is arranged as a switch for detecting an open/closed state of the cover 12 near an internal portion of the card insertion slot 11, as shown in Figs. 9A and 9B. When the cover 12 is opened, as shown in Fig. 9A, the projection 12a of the cover 12 is released from an operation lever 13a of the detector 13, thus turning off the detector 13. When the cover 12 is closed, as shown in Fig. 9B, the projection 12a pushes the operation lever 13a to turn on the detector 13. The CPU 1 monitors an ON/OFF signal from the detector 13. When the ON/OFF signal is switched from an OFF state to an ON state, the CPU 1 detects that the cover 12 is closed, i.e., that the insertion/removal operation of the ROM card 9 is performed, and is completed. In this embodiment, the insertion/removal operation of the ROM card 9 is detected, and immediately thereafter, the presence/absence detection processing in Fig. 5 described in the first embodiment is executed. Fig. 10 shows a control processing sequence of the CPU 1 for these control operations. When the cover 12 is opened (the detector 13 is turned off), the CPU 1 starts the processing shown in Fig. 10 in response to, e.g., an interrupt signal, and waits until the cover 12 is closed (the detector 13 is turned on) in the loop of step S30. When the cover 12 is closed, the CPU 1 executes the presence/absence detection processing in step S31, and enables/disables the spell checker function in accordance with the presence/absence of the dictionary ROM 8. The presence/absence detection processing is executed not only upon detection of the insertion/removal operation of the ROM card 9 but also in response to a reset signal upon power-on of the typewriter of this embodiment. According to this embodiment, in the arrangement wherein the dictionary ROM 8 is detachably mounted as the ROM card 9, the spell checker function can be automatically enabled/disabled without requiring a special operation by an operator every time the ROM card 9 is inserted/removed, thus simplifying an operation on the side of the operator. In each of the first and second embodiments, when the dictionary ROM 8 is constituted not for English but for French, and the spell checker function is automatically enabled/disabled, target data 7c in the ROM 7 is replaced with a French word, e.g., "titre", and the presence/absence of the dictionary is detected using this word. In accordance with the detection result, the spell checker function can be enabled/disabled. In other words, the target data 7c need only be set as a word in a language (language of the dictionary data in the dictionary ROM 8) as a target for the spell checker function. In the arrangement of the above embodiment, the printer 4 is not limited to a daisy-wheel printer, but may comprise various other printers, such as a wire-dot printer, an ink-jet printer, and the like. The display 5 is not limited to an LCD, but may comprise a CRT, a plasma display, and the like. The arrangement for enabling/disabling the spell checker function is not limited to an electronic typewriter, but may be applied to various other document processing apparatuses such as a wordprocessor, a personal computer, and the like. As can be apparent from the above description, a document processing apparatus having a spell checker function for detecting a misspelling of an input word, and informing the misspelling, employs an arrangement comprising control means for detecting the presence/absence of a dictionary memory used for detecting the misspelling of the word, and enabling/disabling the spell checker function in accordance with the detection result. For this reason, since the spell checker function can be automatically enabled/disabled in accordance with the presence/absence of the dictionary memory, the spell checker function can be automatically enabled/disabled with an inexpensive arrangement. Therefore, the cost of the apparatus can be reduced, and an operation can be simplified.

Claims: A document processing apparatus (3,4,5) for processing word data having a detachable dictionary memory (8) defining a dictionary and having a spelling checking means (1,8;S4) which is operable to perform a spelling checking function by searching the dictionary for words of the word data, characterised by further comprising; discriminating means (S13) operable to discriminate whether a predetermined word is found to be stored in the dictionary as a result of operating the spelling checking means to search for the predetermined word, the predetermined word belonging to a predetermined language in which the spelling checking function is to be performed; and setting means (1;S14) operable to set said spelling checking means valid in response to a discrimination by said discriminating means that the predetermined word is stored in the dictionary and to set said spelling checking means invalid in response to a discrimination by said discriminating means that the predetermined word is not found as a result of operating the spelling checking means to search for the predetermined word, whereby the spelling checking means is set invalid when the dictionary memory is detached. An apparatus according to claim 1, wherein said spelling checking means includes a program (7c) for storing the predetermined word. An apparatus according to any preceding claim, further comprising a keyboard (3) operable to input word data and display means (5) operable to display the input word data. An apparatus according to any preceding claim, wherein said document processing apparatus is a typewriter. An apparatus according to any preceding claim wherein said setting means sets said spelling checking means valid or invalid using a flag (6a). An apparatus according to any preceding claim, further comprising control means (1, Fig. 6) operable to control said spelling checking means to perform the spelling checking function on the word data when said setting means sets said spelling checking means valid, and to control said spelling checking means not to perform the spelling checking function on the word data when said setting means sets said spelling checking means invalid. Apparatus as claimed in any preceding claim comprising actuating means (1) operable to actuate the discriminating means in accordance with a reset signal upon power-on of the apparatus. A method of document processing by operation of a document processing apparatus (3,4,5) for processing word data having a detachable dictionary memory (8) defining a dictionary and having a spelling checking means (1,8; S4) which is operable to perform a spelling checking function by searching the dictionary for words of the word data, characterised by comprising the steps of discriminating (S13) whether a predetermined word is found to be stored in the dictionary as a result of operating the spelling checking means to search for the predetermined word, the predetermined word belonging to a predetermined language in which the spelling checking function is to be performed; and setting (S14) said spelling checking means valid in response to a discrimination by the discriminating step that the predetermined word is stored in the dictionary and setting the spelling checking means invalid in response to a discrimination by the discriminating step that the predetermined word is not found as a result of operating the spelling checking means to search for the predetermined word, whereby the spelling checking means is set invalid when the dictionary memory is detached. A method as claimed in claim 8 including the step of storing the predetermined word by means of a program of the spelling checking means. A method as claimed in any of claims 8 and 9 including the step of inputting word data by means of a keyboard (3) and displaying the input word data by means of a display means (5). A method as claimed in of claims 8 to 10 wherein the document processing apparatus is a typewriter. A method as claimed in any of claims 8 to 11 wherein the setting step sets the spelling checking means valid or invalid using a flag (6a). A method as claimed in any of claims 8 to 12 including the step of controlling the spelling checking means to perform the spelling checking function on the word data when the setting step sets the spelling checking means valid, and controlling the spelling checking means not to perform the spelling checking function on the word data when the spelling checking means is set invalid. A method as claimed in any of claims 8 to 13 including the step of actuating the discriminating step in accordance with a reset signal upon power-on of the apparatus.

Inventors: KAWANABE TETSUYA, KAWANABE, TETSUYA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1991
Main classification: G06F17
IPC codes: B41J5, B41J29, G06F17