Automatic code generation via natural language processing
First Claim
1. A method for automatic code generation comprising:
- obtaining a parse tree, wherein the parse tree represents at least one instruction and wherein the instruction is in a natural language, and wherein the at least one instruction is free-form;
identifying a functional word in the parse tree;
identifying a regular expression matching the functional word, wherein the regular expression matches the functional word when the regular expression comprises at least one selected from a group consisting of a concept with a matching name as the functional word and a concept with a matching type as the functional word, and wherein the regular expression specifies a sentence subpart corresponding to the functional word;
identifying the sentence subpart from the parse tree according to the regular expression and based on an identifier of the sentence subpart at a same distance from the root as an identifier of the functional word;
creating, using a processor, a first instantiated concept for the sentence subpart by;
obtaining a first concept based on the first concept mapping to a first word in the sentence subpart, wherein the first concept assigns a type to the first word, andcreating the first instantiated concept from the first concept;
inserting the first instantiated concept in an instantiated concept map, wherein the instantiated concept map defines relationships between instantiated concepts in the instantiated concept map;
identifying, using a processor, a second instantiated concept for the sentence subpart by;
obtaining a second concept based on the second concept mapping to a second word in the sentence subpart, wherein the second concept is obtained based on the second concept comprising a parameter identifying the first concept, and wherein the second concept maps to a plurality of heterogeneous words, anddetermining that the second instantiated concept representing the second concept is already located in the instantiated concept map;
inserting, in the second instantiated concept already located in the instantiated concept map, a link to the first instantiated concept based on the second concept comprising the parameter identifying the first concept, wherein inserting the link creates at least two paths between at least two instantiated concepts in the instantiated concept map;
traversing the instantiated concept map,wherein traversing the instantiated concept map comprises for each instantiated concept in the instantiated concept map;
obtaining a code output rule according to the instantiated concept; and
outputting code to memory according to the code output rule.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for automatic code generation that includes obtaining a parse tree, wherein the parse tree represents at least one instruction and wherein the instruction is in a natural language, and wherein the at least one instruction is free-form, determining a plurality of sentence subparts from the parse tree, creating at least one instantiated concept for each of the plurality of sentence subparts, inserting the instantiated concept in an instantiated concept map, traversing the instantiated concept map, wherein traversing the instantiated concept map includes for each instantiated concept in the instantiated concept map obtaining a code output rule according to the instantiated concept, and outputting code according to the code output rule be completed upon finalization of claims.
82 Citations
13 Claims
-
1. A method for automatic code generation comprising:
-
obtaining a parse tree, wherein the parse tree represents at least one instruction and wherein the instruction is in a natural language, and wherein the at least one instruction is free-form; identifying a functional word in the parse tree; identifying a regular expression matching the functional word, wherein the regular expression matches the functional word when the regular expression comprises at least one selected from a group consisting of a concept with a matching name as the functional word and a concept with a matching type as the functional word, and wherein the regular expression specifies a sentence subpart corresponding to the functional word; identifying the sentence subpart from the parse tree according to the regular expression and based on an identifier of the sentence subpart at a same distance from the root as an identifier of the functional word; creating, using a processor, a first instantiated concept for the sentence subpart by; obtaining a first concept based on the first concept mapping to a first word in the sentence subpart, wherein the first concept assigns a type to the first word, and creating the first instantiated concept from the first concept; inserting the first instantiated concept in an instantiated concept map, wherein the instantiated concept map defines relationships between instantiated concepts in the instantiated concept map; identifying, using a processor, a second instantiated concept for the sentence subpart by; obtaining a second concept based on the second concept mapping to a second word in the sentence subpart, wherein the second concept is obtained based on the second concept comprising a parameter identifying the first concept, and wherein the second concept maps to a plurality of heterogeneous words, and determining that the second instantiated concept representing the second concept is already located in the instantiated concept map; inserting, in the second instantiated concept already located in the instantiated concept map, a link to the first instantiated concept based on the second concept comprising the parameter identifying the first concept, wherein inserting the link creates at least two paths between at least two instantiated concepts in the instantiated concept map; traversing the instantiated concept map, wherein traversing the instantiated concept map comprises for each instantiated concept in the instantiated concept map;
obtaining a code output rule according to the instantiated concept; andoutputting code to memory according to the code output rule. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method for generating executable code to process a form comprising:
-
obtaining the form, wherein the form comprises a plurality of fields; obtaining an instruction for each field in the plurality of fields, wherein the instruction is written in a natural language, and wherein the instruction is free-form; and generating, using a processor, code for the instruction for each field in the plurality of fields to obtain generated code, wherein the generated code processes the form, wherein, for the instruction in at least one field of the plurality of fields, generating code comprises performing; obtaining a parse tree representing the instruction; identifying a functional word from the parse tree; identifying a regular expression matching the functional word, wherein the regular expression matches the functional word when the regular expression comprises at least one selected from a group consisting of a concept with a matching name as the functional word and a concept with a matching type as the functional word, and wherein the regular expression specifies a sentence subpart corresponding to the functional word; identifying the sentence subpart from the parse tree according to the regular expression and based on an identifier of the sentence subpart at a same distance from the root as an identifier of the functional word; creating a first instantiated concept for the sentence subpart by; obtaining a first concept based on the first concept mapping to a first word in the sentence subpart, wherein the first concept assigns a type to the first word, and creating the first instantiated concept from the first concept; inserting the first instantiated concept in an instantiated concept map, wherein the instantiated concept map defines relationships between instantiated concepts in the instantiated concept map; identifying, a second instantiated concept for the sentence subpart by; obtaining a second concept based on the second concept mapping to a second word in the sentence subpart, wherein the second concept is obtained based on the second concept comprising a parameter identifying the first concept, and wherein the second concept maps to a plurality of heterogeneous words, and determining that the second instantiated concept representing the second concept is already located in the instantiated concept map; inserting, in the second instantiated concept already located in the instantiated concept map, a link to the first instantiated concept based on the second concept comprising the parameter identifying the first concept, wherein inserting the link creates at least two paths between at least two instantiated concepts in the instantiate concept map; traversing the instantiated concept map, wherein traversing the instantiated concept map comprises for each instantiated concept in the instantiated concept map;
obtaining a code output rule according to the instantiated concept; andoutputting code according to the code output rule.
-
-
8. A system for automatic code generation comprising:
-
a processor; a pattern matcher, executing on the processor, and configured to; obtain a parse tree, wherein the parse tree represents at least one instruction and wherein the instruction is in a natural language; identify a functional word in the parse tree; identify a regular expression matching the functional word, wherein the regular expression matches the functional word when the regular expression comprises at least one selected from a group consisting of a concept with a matching name as the functional word and a concept with a matching type as the functional word, and wherein the regular expression specifies a sentence subpart corresponding to the functional word; identify the sentence subpart from the parse tree according to the regular expression and based on an identifier of the sentence subpart at a same distance from the root as an identifier of the functional word; create a first instantiated concept for the sentence subpart by; obtaining a first concept based on the first concept mapping to a first word in the sentence subpart, wherein the first concept assigns a type to the first word, and creating the first instantiated concept from the first concept; inserting the first instantiated concept in an instantiated concept map, wherein the instantiated concept map defines relationships between instantiated concepts in the instantiated concept map; identifying a second instantiated concept for the sentence subpart by; obtaining a second concept based on the second concept mapping to a second word in the sentence subpart, wherein the second concept is obtained based on the second concept comprising a parameter identifying the first concept, and wherein the second concept maps to a plurality of heterogeneous words, and determining that the second instantiated concept representing the second concept is already located in the instantiated concept map; and insert, in the second instantiated concept already located in the instantiated concept map, a link to the first instantiated concept based on the second concept comprising the parameter identifying the first concept, wherein inserting the link creates at least two paths between at least two instantiated concepts in the instantiated concept map; and a code generator, executing on the processor, and configured to; traverse the instantiated concept map, wherein traversing the instantiated concept map comprises; for each instantiated concept in the instantiated concept map obtaining a code output rule according to the instantiated concept; and output code according to the code output rule. - View Dependent Claims (9, 10, 11, 12)
-
-
13. A computer readable medium comprising computer program code stored therein for causing a computer system accessing the computer readable medium to:
-
obtain a parse tree, wherein the parse tree represents at least one instruction and wherein the instruction is in a natural language, and wherein the instruction is free-form; identify a functional word in the parse tree; identify a regular expression matching the functional word, wherein the regular expression matches the functional word when the regular expression comprises at least one selected from a group consisting of a concept with a matching name as the functional word and a concept with a matching type as the functional word, and wherein the regular expression specifies a sentence subpart corresponding to the functional word; identify a sentence subpart from the parse tree according to the regular expression and based on an identifier of the sentence subpart at a same distance from the root as an identifier of the functional word; create a first instantiated concept for the sentence subpart by; obtaining a first concept based on the first concept mapping to a first word in the sentence subpart, wherein the first concept assigns a type to the first word, and creating the first instantiated concept from the first concept; insert the first instantiated concept in an instantiated concept map, wherein the instantiated concept map defines relationships between instantiated concepts in the instantiated concept map; identify a second instantiated concept for the sentence subpart by; obtaining a second concept based on the second concept mapping to a second word in the sentence subpart, wherein the second concept is obtained based on the second concept comprising a parameter identifying the first concept, and wherein the second concept maps to a plurality of heterogeneous words, and determining that the second instantiated concept representing the second concept is already located in the instantiated concept map; insert, in the second instantiated concept already located in the instantiated concept map, a link to the first instantiated concept based on the second concept comprising the parameter identifying the first concept, wherein inserting the link creates at least two paths between instantiated concepts in the instantiated concept map; traverse the instantiated concept map, wherein traversing the instantiated concept map comprises for each instantiated concept in the instantiated concept map;
obtaining a code output rule according to the instantiated concept; andoutput code according to the code output rule.
-
Specification