Patent Publication Number: US-5895446-A

Title: Pattern-based translation method and system

Description:
BACKGROUND OF THE INVENTION 
     1. Technical Field 
     The present invention relates to a translation method and translation system based on patterns, and particularly to a translation system which is based on translation patterns. 
     2. Description of the Related Art 
     As the Internet comes into widespread use, more and more documents written in foreign languages are being accessed. As a tool to translate such documents into a native language, machine translation systems are rapidly becoming widespread. However, in an environment such as the Internet, where information in a wide variety of fields is available for access, a single word may have a quite different meaning and even be translated differently depending on the fields. Therefore, customizing a translation system according to a field is important for the users and developers of a translation system. 
     One such method of customization involves adding words to or changing words in a dictionary, or modifying grammatical rules used for the system. Such customization requires expertise and in addition, is likely to increase ambiguities due to the inconsistency of terms or grammatical rules. Therefore, improvement of translation accuracy or proper selection of terms according to fields is not always possible. 
     Thus, in recent years a machine translation system using translation patterns has come to attention and has been commercialized. In this system, a large number of translation patterns for each word, clause, phrase, or sentence in a source language corresponding to those in a target language are provided in advance. A part of a text (a sentence or word) written in the source language is matched against the translation patterns to take the text as a mosaic comprising a number of translation patterns. Then, the source language is translated into the target language based on those translation patterns. Although such a method requires a large number of translation patterns, it has the significant advantage that such a system can easily be customized because the user can define translation patterns easily. 
     Published Unexamined Patent Application No. 5-290082 discloses a translation apparatus which matches text written in a source language against a plurality of translation patterns provided in advance, then translates the text based on the results. FIG. 11 shows an example of translation patterns used in the prior art. As can be seen, a number of translation patterns are provided, each of which is comprised of a source language pattern, a variable representing that source language pattern with one character, and a target language pattern corresponding to that source language pattern. Some translation patterns are represented by a nested structure which contains a variable representing another translation pattern. However, with this prior art, the range of language patterns which can be matched by one translation pattern is very narrow, because only one variable is provided for each translation pattern. This would be a particularly serious problem in a case where the part of speech of the source language pattern differs from that of the target language pattern. 
     Source language pattern: &#34;worry about&#34; 
     Target language pattern: &#34;shimpai da&#34; 
     In the above example, the pattern of speech of the source language pattern is a verb, whereas the pattern of speech of the target language pattern is an adjective. In such a case, the target pattern cannot be represented by a single variable in prior art. 
     In addition, in the prior art a variable representing a source language pattern cannot have information which is held by that pattern. For example, although a noun in singular form and a noun in plural form in English are similar in representation, they cannot be distinguished by a single translation pattern, and different patterns must be used for the respective forms. 
     Due to the above-mentioned reasons, the number of representations which can be matched by one translation pattern are limited, so that a large number of translation patterns must be provided in order to generate accurate translations. 
     SUMMARY OF THE INVENTION 
     In view of the foregoing, it is therefore one object of the present invention to provide efficient language translation by using a translation pattern which can match an increased number of representations. 
     It is another object of the present invention to provide a translation system which can be easily customized by the user and allows an efficient retrieval of translation information. 
     A first embodiment of the present invention provides a method of translating a part of a text written in a source language into a target language by associating the part of the text with a translation pattern, wherein a plurality of translation patterns are provided in advance, each of which comprises a source language pattern, a target language pattern corresponding to the source language pattern, a variable corresponding to the source language pattern, and a variable corresponding to the target language pattern. If a part of the text matches a source language pattern in a translation pattern, the source language pattern is represented with a first variable and a target language pattern which corresponds to the source language pattern is represented with a second variable. Thus, if the part of the text which is represented with the first variable matches another source language pattern having a nested structure in which at least the first variable is included, that source language pattern is represented with a third variable. Then, a target language pattern corresponding to the source language pattern and having a nested structure in which the second variable is included is represented with a fourth variable. 
     A more proper translation can be yielded if the condition for representing patterns with the third and fourth variables, that is, &#34;if the part of the text which is represented with the first variable matches another source language pattern having a nested structure in which at least the first variable is included&#34;, is stricter, that is, &#34;if the part of the text which is represented with the first variable matches another source language pattern having a nested structure in which the first variable is included and the target language pattern corresponding to that source language pattern has a nested structure in which the second variable is included&#34;. 
     In such a configuration, the source language pattern and the target language pattern have identity information indicating the characteristics of the patterns, and the variables are given the identity information on the patterns to be represented. In particular, each variable has an index and is given identity information on the pattern through the index in the variables. 
     The contents of the pattern identity information often varies depending on languages. In Japanese, for example, a conjugated form of a verb is important. Thus, in many cases, information about a conjugated form of a verb is required as identity information. Such information is not required in English. Rather, the quantity of a noun is important in English, whereas, the quantity of a noun is not important in Japanese. Therefore, the substance of identity information held by a source language pattern in a translation pattern generally differs from the substance of identity information held by a target language pattern. 
     In addition, whether a part of a text represented with a first variable matches another source language pattern having a nested structure in which the variable is embedded is determined by taking account of the identity information given to the variable. 
     A second embodiment of the present invention provides a translation system for translating a text written in a source language into a target language, wherein a part of a text written in the source language is translated into the target language by associating the part of the text written in the source language with a translation pattern. That is, a number of translation patterns are provided, each of which comprises a source language pattern, a target language pattern corresponding to the source language pattern, a variable representing the source language pattern, and a variable representing the target language pattern, and those translation patterns are stored in a storage means. This system comprises a means for representing a source language pattern with a first variable and representing a target language pattern corresponding to that source language pattern with a second variable if a part of a text written in the source language matches a source language pattern; and a means for representing the source language pattern with a third variable and representing a target language pattern which corresponds the source language pattern and has a nested structure in which the second variable is included, with a fourth variable. 
     Here, the means for representing the patterns with the third and fourth variables preferably performs the representation if the part of the text which is represented with the first variable matches another source language pattern having a nested structure in which the first variable is included, and the target language pattern corresponding to the other source language pattern has a nested structure in which the second variable is included. 
     The method and system of the present invention may further allow a user to create translation patterns and add them to patterns stored in the translation system. 
     A third embodiment of the present invention provides a storage medium storing a program which translates a text written in a source language into a target language by associating a part of the text with a translation pattern to translate that part into the target language. That is, translation patterns are provided for this program, each of which comprises a source language pattern, a target language pattern corresponding to said source language pattern, a variable representing said source language pattern, and a variable representing said target language pattern. Furthermore, this program includes: instruction means for referencing the translation patterns, and, if a part of a text written in a source language matches one of the source language patterns, instruction means for representing that source language pattern with a first variable and representing a target language pattern which corresponds to the source language pattern with a second variable; and instruction means for, if the part of the text represented with the first variable matches another source language pattern having a nested structure in which at least the first variable is included, representing the source language pattern with a third variable and representing a target language pattern having a nested structure in which the second variable is included with a fourth variable. 
     Another embodiment of the present invention relates to a customization method in a system for translating a text written in a source language into a target language by associating a part of the text written in the source language with a translation pattern, said customization method includes a method for adding translation patterns to the system. The method comprises the steps of: creating a source language pattern; creating a target language pattern corresponding to the source language pattern, associating a variable including an index with the source language pattern; and associating another variable including an index with the target language pattern. Thus, one index provides identity information of the target language pattern to one variable. The other index provides identity information of the source language pattern to the other variable. 
     Operation 
     The invention described above extends the range of representations which can be matched by one translation pattern because a source language pattern and a target language pattern are represented with different variables. For example, a pattern &#34;worry about&#34; in a translation pattern and the corresponding pattern &#34;shimpai da&#34; differs in a part of speech (identity information). Therefore, the prior art, which provides only one variable for each translation pattern, cannot represent two patterns having different identity information. The present invention, in contrast, provides a pair of variables for each translation pattern, thus the characteristics of each language pattern can be provided with the variables as identity information. Because a variable reflects the identity information of the original pattern represented by that variable, a more accurate translation can be generated by combining the translation patterns. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself however, as well as a preferred mode of use, further objects and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein: 
     FIG. 1 is a block diagram illustrating a configuration of a machine translation system according to an embodiment of the present invention; 
     FIG. 2 illustrates an example of translation patterns according to the present invention; 
     FIG. 3 illustrates an example of an algorithm for translation according to the present invention; 
     FIG. 4 illustrates a part of a translation pattern which relates to a text; 
     FIG. 5 illustrates a tree structure corresponding to a translation pattern; 
     FIG. 6 illustrates an algorithm for matching between a text and a translation pattern; 
     FIG. 7 illustrates a scan (i) process in detail; 
     FIG. 8 illustrates a complete (i) process in detail; 
     FIG. 9 illustrates the results of an algorithm executed on a translation pattern; 
     FIG. 10 illustrates an example of a translation table used for constructing computer commands from natural-language-like inputs according to the present invention; and 
     FIG. 11 illustrates translation patterns used in prior art. 
    
    
     DETAILED DESCRIPTION OF AN ILLUSTRATIVE EMBODIMENT 
     FIG. 1 is a block diagram showing a configuration of a machine translation system embodying the present invention. In the following description, translation from Japanese into English is used as an example. 
     An input means 1 is comprised of a keyboard 2, a Japanese text input file 3, and translation pattern input file 18. Text data and various operation commands are input from this input means 1 into a processor 4. 
     The processor 4 has a typical configuration including a processing unit, memory, and controller unit and performs translation processing according to processing steps described later. With respect to the function of this embodiment, the processor 4 comprises a translation pattern registration processing unit 5, an input processing unit 6, a comparator unit 7, a translation generator unit 8, a machine translator unit 9, buffer memory 10, and an output processing unit 11. 
     The translation pattern registration unit 5 is used by a user to generate a table of translation patterns and to register translation patterns. The input processing unit 6 sends a Japanese text input from the input means 1 to the comparator unit 7, where the text is compared with translation patterns in a translation pattern file 13 to determine whether there is a match. If there is a match, an English translation text is generated in the translation generator unit 8 by using that translation pattern and sent to the output processing unit 11 through buffer memory 10. If there is no match, translation processing is performed in the machine translator unit 9 through parsing the text. Alternatively, all Japanese texts may be translated by using both the translation-pattern-based process and the machine-translator-based process, then comparing the results to chose a better translation. 
     An external storage 12 includes a translation pattern file containing translation patterns, a Japanese-English translation and English text generation rule file 14 for machine translation, a Japanese parsing dictionary and grammar file 15, and an English translation file 16. The English translation file 16 is used to store English texts translated by the translation generator unit 8 and machine translator unit 9. The progress and results of the translation are displayed on a display means 17. 
     FIG. 2 is a table showing internal representations of translation patterns. A translation pattern 18 is comprised of the following 4-tuple as a unit: 
     &lt;source language pattern, variable for source language pattern, variable for target language pattern, target language pattern&gt; 
     A feature of this structure is that one translation pattern includes two variables: one variable representing a source language pattern and one variable representing a target language pattern. 
     For example, suppose a given translation pattern is represented by a 4-tuple &lt;tokkyo:1, $N:1, $NP:1, patent:1&gt;. This translation pattern indicates that the source language pattern, the character string &#34;tokkyo&#34;, is translated to the target pattern, the character string &#34;patent&#34;. At the same time, the pattern &#34;tokkyo&#34; is represented with the variable $N and the pattern &#34;patent&#34; is represented with the variable $NP. 
     The source language pattern and the target language pattern have identity information indicating characteristics of those patterns. Specific parameters for identity information include the following information. 
     Identity information for Japanese pattern 
     Part of speech 
     Conjugation 
     Identity of noun (such as proper noun) 
     Position attribute (such as beginning/end of a sentence) 
     Identity of noun (such as selective parataxis, compound parataxis) 
     Identity of conjugated independent word and auxiliary word 
     Form of end of clause 
     Meaning category 
     Identity information for English pattern 
     Part of speech 
     Singular or plural 
     Position attribute (such as beginning/end of a sentence) 
     Separation with punctuation marks and enclosure with quotation marks 
     Capitalization 
     Requiring negative representation 
     Use of articles (the, a, an, or without article) 
     Intransitive/transitive verb 
     Verb accompanied by direct or indirect object 
     Meaning category 
     Identity information required for translating Japanese is different from that for English. Therefore, as apparent from the above-given example, identity information of patterns of each language is different. If a part of speech of a given Japanese pattern is a noun, that Japanese pattern does not require information on conjugation. Thus, the same Japanese pattern may have different specific identity information. 
     In FIG. 2, the notation &#34;:1&#34; following the variables $N and $NP and patterns &#34;tokkyo&#34; and &#34;patent&#34; is an index 19C. The index is used to provide identity information to a variable itself when a pattern is represented with that variable. For example, the variable $N, which represents the source language pattern &#34;tokkyo&#34;, shares identity information with the pattern &#34;tokkyo&#34; to which the same index as that of the variable is added. 
     Similarly, the same identity information as that of the pattern &#34;patent&#34; to which the same index 19C &#34;:1&#34; is added, is given to the variable $NP which represents the target language pattern &#34;patent&#34;. 
     When the pattern &#34;tokkyo&#34; appears as a part of a longer character string, the pattern &#34;tokkyo&#34; and its target language pattern are referenced by source and target language patterns in other translation patterns as variables $N and $NP, respectively. In this case, the same index is added to the variables $N and $NP in order to indicate that they constitute a pair. 
     Thus, by adding an index to a variable which represents a given pattern, the identity of the variable can be referenced through the use of the index when the variable appears in another translation pattern. For example, in a translation pattern in which the variable &#34;$N:1&#34; is nested, like the source language pattern &lt;$N:1 wo shinsei-suru:2&gt;, the variable $N:1 and the variable $NP:1 would have the same index 19C, &#34;1&#34;. Therefore, the variables can be replaced with the pair of &#34;tokkyo&#34; and &#34;patent&#34;. The variable $N:1 inherits the identity information of the pattern &#34;tokkyo&#34; and the variable $NP:1 inherits the identity information of the pattern &#34;patent&#34;. If an appropriate condition relating to the identity information of a variable is provided in this translation pattern, only a variable which satisfies the condition can be nested in that pattern. 
     In the above-mentioned example, variables can be nested in the nest structure, providing that there is a match to both of the variables $N:1 and $NP:1 by taking account of indices. Alternatively, a match to only one variable $N:1 in a source language may be provided as a condition. In this case, a translation can be generated not as accurately as in the previous example because the condition is not as strict, although the processing speed will increase. Which condition should be selected is a matter of trade-off between accuracy and processing speed of translation. 
     The constant, variable, identity, and index may be any representations which are distinguishable from each other. Here, a variable begins with &#34;$&#34; and an index is represented by a variable or constant followed by &#34;:&#34; and then a number. 
     In the translation pattern in which the source language pattern is &lt;$N:1 wo shinsei-suru:2&gt; as shown in FIG. 2, the source language pattern is represented with the variable $S and the target language pattern is represented with the variable $VP. The index &#34;2&#34; provides identity information of the character string &#34;shinsei-suru&#34; to the variable &#34;$S&#34; and the identity information of the character string &#34;file&#34; to the variable &#34;$VP&#34;. Here, &#34;+OBJ&#34; indicates that the variable &#34;$S&#34; further has identity information 19B indicating that the variable has an object. &#34;+PP&#34; indicates that the variable &#34;$VP&#34; has identity information indicating that the variable has a prepositional phrase. 
     The representation &lt;file:2:+V?+INF?&gt; indicates the constraint 19D that the representation &#34;file&#34; should correspond to the representation &#34;shinsei-suru&#34; and satisfy the identity that it is an infinitive (+INF) and a verb (+V). The identity information can be set by referencing a dictionary to associate a word with information such as a noun, singular, or conjugated form which is relevant to the word. Thus, the constraint can range from a simple constraint indicating whether a particular identity item is contained to a complex constraint description in which a number of identity conditions are combined. However, it should be noted that the large amount of calculation time required for evaluating the satisfaction of a complex constraint condition would increase the time required for translation. 
     A source language pattern 18A may be represented in any form, including but not limited to, a sentence, clause, phrase, or a particular part of speech or a word. As described later, a source language pattern may contain a sentence, clause, or phrase in a nest structure 19A in which a variable 18B is nested, as in &lt;$N:1 wa $N:2 dearu&gt;. Similarly, a variable 18C which corresponds to a variable in said source language pattern and has the same index as that of the variable representing the source language pattern may be nested in a target language pattern. 
     In this way, even if the identity of the source language pattern differs from that of the target language pattern, such a translation pattern can be represented as a single pattern by representing the translation pattern with a pair of variables. Thus, the number of translation patterns generated can be reduced because the range of representations covered by one translation pattern is widened. 
     Nesting a translation pattern in another translation pattern through the use of a structure including such a pair of variables provides the following effects. The nested structure 19A using the variables 18B and 18C is very simple and flexible, so that a user, without expertise in linguistics or information systems, can easily use the system. The user can register or add a new translation pattern to the translation pattern file 13. without a loss of consistency with the translation system. 
     Such a translation pattern can be easily registered under a number of conversion rules in a simple manner similar to creating, for example, a wordbook by a junior high school student. Registering a translation pattern for an English-to-Japanese translation, for example, may follow the following rules. 
     (1) A translation pattern is represented by the form &#34;source language pattern= target language pattern&#34;. 
     (2) A verb phrase in English is represented by beginning the phrase with &#34;to&#34; in the source language pattern, and the counterpart in the target language pattern is represented by ending the phrase with a word with declined or conjugated endings (a verb, adjective, or adverb) or &#34;noun+ da&#34;. Variables representing the entire source language pattern and the entire target language pattern are represented by the variables &#34;$VPE&#34; and &#34;$S&#34;, respectively. They share information with a verb immediately succeeding &#34;to&#34; in English and the last word with declined or conjugated endings in Japanese through an index. In this representation, the preposition &#34;to&#34; is removed. 
     (3) An adjectival phrase in English begins with &#34;be&#34; in the source language pattern, and the counterpart in the target language pattern ends with a word with declined or conjugated endings (a verb, adjective, or an adverb) or &#34;noun + da&#34;. Variables representing the entire source language pattern and the entire target language pattern are represented by &#34;$ADJP&#34; and &#34;$AP&#34;, respectively, and share information with a verb immediately succeeding &#34;be&#34; in English and the last word with declined or conjugated endings in Japanese through an index. In this representation, the verb &#34;be&#34; is removed. 
     (4) All other translation patterns are represented by a noun phrase. Variables representing the entire source language pattern and the entire target language pattern are represented by the variables &#34;$NP&#34; and &#34;$N&#34;, respectively, and share information with the last word through an index. 
     (5) Variables are represented by &#34;˜&#34; and have an index of 1, 2, 3, . . . in the order in which the variables appears. All variables indicate a noun phrase. 
     By using the descriptions &#34;patent = tokkyo&#34;, &#34;to file ˜=˜ wo shinsei-suru&#34;, and &#34;be subject to conditions = joken ni yoru&#34;, the translation patterns &lt;patent:1, $NP:1, $N:1, tokkyo:1&gt;, &lt;file:1 $NP:2, $VP:1, $S:1, $NP:2 wo shinsei-suru:1&gt;, and &lt;subject:1 to conditions, $ADJP:1, $AP:1, joken ni yoru:1&gt; can be defined, respectively. These descriptions may be interactively entered by a user on a one-description basis, or may be entered as a batch of descriptions in a translation pattern input file 18 in text file format. 
     In a language like English in which information about gender and number of a noun and verb is important, it is difficult to describe information required for accurate translation by using translation patterns of the prior art. In contrast, the present invention can cover a wide range of representations by using indices and identity information, without the use of special language processing for generating a partial translation or machine translation processing based on accurate grammar. Furthermore, according to the present invention, information equivalent to grammar in the prior art can be represented by translation patterns in most cases. In the translation pattern &lt;$NP:1:+3SG? is OK, $S, $S, $N:1 wa OK desu&gt;, for example, even the agreement between the subject and the verb in a sentence, which is important in English, is treated properly by providing the constraint that the pattern is applicable only if the variable &#34;$NP&#34; has the identity of the third person singular and the present tense (+3SG). 
     FIG. 3 shows an example algorithm for translation processing according to the present invention. First, a Japanese text is input (Step 51). The text is then compared with source language patterns in a translation pattern file (Step 52). If a part of the input text matches a source language pattern, the source language pattern is converted into the corresponding variable of the translation pattern (Steps 53 and 54). This process is repeated until a translation pattern which covers the text up to its end is extracted (Step 55). That is, the algorithm checks to see if there is a translation pattern which can reach the end of the pattern with the number of steps equal to the size of the text. If more than one translation pattern is extracted, a translation pattern which provides the least number of patterns, that is, the most number of nests, is selected. Alternatively, the user may previously give a cost to each pattern. 
     Finally, an English text is constructed by converting the extracted source language patterns into the target language patterns according to the translation pattern (Step 58). If no source language pattern matches the part of the text in Step 53, a machine translation process based on conventional parsing is performed (Step 59). 
     A translation can be immediately generated if the target language pattern is constructed at the same time the nests of the source language pattern is constructed. Alternatively, the matching with the input text may be performed by using only source language patterns and the corresponding target language patterns are extracted sequentially from the extracted source language patterns to generate an English text. The latter method can be applied to a method in which a source language pattern is extracted from source language pattern candidates selected by using a known context-free language parsing algorithm, and then a target language pattern is extracted, without taking account of constraints provided in the source language patterns. This last method will be described below. 
     The comparison between the text and the translation pattern in Step 52 is performed by checking the input text from left to right on a character basis. The algorithm for this process will be described in detail by using a text &#34;Setten wo kairyo-suru&#34; as an example with reference to FIG. 4 through FIG. 6. FIG. 4 shows translation patterns relating to this text among other translation patterns. FIG. 5 shows a tree structure 20 called the &#34;index tree&#34; which indicates the internal representation of the translation patterns. In this index tree, the state of each character and variable immediately after it is read into the system and corresponds to each node (0 to 16). Immediately right of each character and variable, excluding constraints and indices, is a node equivalent to the end of each source language pattern which contains a pointer to the corresponding source language pattern. Although a variable is not necessarily represented by a single character, each variable is represented as a unique character which differs from any other character in the index tree. 
     In FIG. 6, first let the length of the input text be &#34;n&#34; (Step 81). The length of the text in this example is: n = 7. Then, a state set &#34;s i!&#34; is associated with each character position &#34;i&#34;. Because no pattern matching has started in the initial state at the beginning of the text parsing, s 0! = {&lt;0,0&gt;}. The parsing is performed by executing two operations, &#34;scan (i)&#34; and &#34;complete (i)&#34;, at each character position i = 0,1, . . . , n (Steps 83 to 85). A component of a state set is a diagram &lt;p, f&gt;, which represents the state to which a given pattern reaches in the matching process. The &#34;p&#34; indicates a node in the index tree and the &#34;f&#34; indicates a position in a text at which the pattern matching has started. 
     For an input character x, the node &#34;p&#39;&#34; up to which the index tree is traced from a given node &#34;p&#34; is defined as p&#39; = shift (p,x) . For example, shift (7, su) = 15 in FIG. 7. The operation &#34;shift (p,x) which follows the index tree can be performed faster by indexing or hashing the arc extending from each node in the index tree using an input alphabet size array. 
     FIG. 7 shows the scan (i) process in detail. The scan (i) process checks to see if, for each state &lt;p,f&gt; of the state set &#34;s i!&#34;, the i+1th character &#34;x i+1  &#34; in the input text matches a pattern by using &#34;shift (p,x i+1 ) (Steps 91 and 92). If it matches the pattern, &lt;shift (p,x i+1 ), f&gt;is added to the state set &#34;s i+1!&#34; of the character position &#34;i+1&#34; (Steps 93 and 94). 
     FIG. 8 shows the complete (i) process in detail. For each state &lt;p,f&gt; of s i!, the complete (i) process uses &#34;y&#34; as the variable representing the pattern if &#34;p&#34; corresponds to the end of the pattern (Steps 101 and 102). Then, the process returns to the starting position &#34;f&#34; of the pattern to try the pattern matching by using &#34;y&#34;. That is, the process tries shift (p&#39;,y) for each component &lt;p&#39;,f&#39;&gt; of the set s i! to see if matching succeeds. If the matching succeeds, &lt;shift (p&#39;, y), f&#39;&gt; is added to s i! (Steps 104 and 105). 
     FIG. 9 shows the result of the algorithm executed on the text &#34;setten wo kairyo-suru&#34;. In this figure, the set s i! for each character position &#34;i&#34; is shown. In the character position i = 1, the partial pattern &lt;12,0&gt; which begins at node 0 and ends at node 12, that is, &#34;setsu&#34; was extracted. In the character position i = 2, the partial pattern &lt;13,0&gt; which begins at node 0 and ends at node 13, that is &#34;settten&#34; was extracted. Because node 13 has &#34;*&#34; corresponding to the end of the pattern, the partial pattern &lt;1,0&gt; in which &#34;setten&#34; is represented with the variable &#34;$NP&#34; was added to s 2! in the next character position i = 3. Thus, the partial pattern &lt;2,0&gt; which begins at node 0 and ends at node 2, that is &#34;setten wo&#34;, was extracted. In this way, the pattern matching was repeated to the last character position. 
     Whether pattern matching has succeeded or not is determined based on whether a pattern which begins at the beginning of the text and ends at the last character position &#34;n&#34; (in this example, n = 7) was found. In this example, such patterns are &lt;11*,0&gt; and &lt;5*,0&gt;. Also in this figure, the state from which a shift () operation generated each state is indicated by an arrow. For example, the pattern &lt;11*, 0&gt; followed the path: node 0-12-13-0-1-2-8-9-10-11. It can be seen that the pattern &lt;5*, 0&gt; followed the path: node 0-12-13-0-1-2-3-4-5. By retaining this information in the algorithm, which pattern matched which part in the text can be determined by following the arrows after parsing. 
     In this example, it can be seen that the following two matches are possible: 
     (setten) wo kairyo-suru 
     (setten) wo (kairyo) suru 
     Here, the parentheses indicate that the enclosed part matched the partial pattern. 
     After source language patterns which match the input text, except for source language pattern constraints and information sharing through the use of an index, are extracted in this way, patterns which properly contain such constraints and a pair of variables of the target language are identified based on the results of the matching. 
     In the above-mentioned example, the translation pattern 182 used for the matching (setten) wo kairyo-suru has the variable $NP to which the constraint that it means a device (+DEVICE?), and an index indicating that a variable corresponding to the variable $NP is the variable $N, are applied. The translation pattern 185 which matches the part &#34;(setten)&#34; is the correct solution because it satisfies the constraint and provides the pair of variables required. 
     On the other hand, the translation pattern 181 used for the matching, (setten) wo (kairyo) suru, contains no translation constraint description, but contains conditions for the pairs of variables $NP and $N, and $VP and $VP. These conditions are satisfied by translation patterns 185 and 184, respectively, which correspond to the partial translations. Thus, it is found that both of the matching results are proper translation candidates which satisfy the translation pattern constraints and the condition of the pair of variables. 
     Thus, usually there can be more than one matching pattern. Various techniques may be used to select one of the matching translation patterns. The simplest technique is one in which the number of patterns is used as the highest priority in consideration of choosing a pattern with the highest degree of matching. In the above-mentioned example, it is apparent from FIG. 5 that &#34;(setten) wo (kairyo) suru&#34; uses three patterns (181, 183, and 185), whereas &#34;(setten) wo kairyo suru&#34; uses two patterns (182 and 185). Therefore, the latter &#34;(setten) wo kairyo suru&#34; should be selected. One very effective alternative technique is to give a cost to each translation pattern. In this technique, a lower cost is given to, for example, the translation pattern 182 because it is a more definitive translation pattern, and a higher cost is given to the translation pattern 181 because it is considered to be a more general one, and an even cost is given to other patterns which provide words used for the translation, so that a translation pattern with a lower total cost among the matched patterns, which is a more definitive translation, takes precedence. 
     It is easy to generate a translation from the resultant matching. It is accomplished simply by representing each of the individual source language patterns in FIG. 5 with a target language pattern according to the translation patterns (182, 185). In this way, a translation &#34;Improve point of contact in productivity.&#34; is yielded. The pattern matching algorithm of the present invention effectively works for a large number of patterns without impairing the response of the entire system. However, it can take a significant amount of time to translate an input text having a large number of translation candidates or constraints. Therefore, techniques for speeding up the system are essential, such as permitting only those constraints which can easily be evaluated as mentioned above to be used, or maintaining only the top N translation pattern candidates with high precedence as the patterns providing partial translations, in order to achieve a more efficient translation system as a whole. 
     The method and system of pattern-based translation described herein works efficiently, by configuring the system so as to use, as a preprocess for a conventional translation system, the pattern-based translation when the pattern matching has succeeded, and to activate the machine translation system when the pattern matching has failed. This means that the translation patterns of the present invention are provided for those fields for which a conventional machine translation system is hard to customize and those patterns are used in a preprocess for machine translation. Thus, special representations which cannot be translated by the machine translation system can be translated faster. Of course, because the translation patterns described herein are provided with the description ability which favorably compares with the grammar description ability used in conventional translation systems, translation patterns used for translating all input texts may be constructed. In this case, the translation patterns registered by the user are directly incorporated with the grammar written with the translation patterns and a much wider range of representations can be translated compared with a simple dictionary, so that a learning ability which cannot be achieved by conventional translation systems is provided. 
     The pattern-based translation method described herein, of course, can also be used in a translation system for translating between any two or more natural languages. Furthermore, it can be used for a system other than systems for natural language-to-natural language translation. As an example, FIG. 10 shows a translation table used for constructing computer commands from natural-language-like inputs. The symbol &#34;@&#34; indicates an alphabet name up to eight digits which represents a file name. For example, a file name such as &#34;WEIGHT.TXT&#34; can be described. In addition, a command such as &#34;COPYFILE WEIGHT.TXT TO HEALTH.TXT&#34; can be constructed by combining the file name with a pattern having a nested structure from natural-language-like inputs. 
     Advantages of the invention 
     According to the present invention, translation patterns which are provided by the user can be efficiently retrieved and a translation can be generated based on those patterns. The form of the translation pattern is very simple and flexible so that even a user without expertise in linguistics or computer systems can add a new pattern to the translation system, without impairing the consistency of the translation system. Furthermore, because the pattern matching algorithm which uses tree-structured indices efficiently works for a large number of patterns, the response of the entire system is not impaired. 
     While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.