A system and method of using an example document to create another document with the same style. The style is determined by examining the example file for syntax patterns that are required in a document of this type. Each pattern is used to create a section template (a sub-template for a larger template). After all the required sub-templates have been defined, by examining the example, we have a document template that may be used to format new documents. Along with user-specific content, a document generator uses the captured document template to generate sections of a new document. When a section of a document is generated, the sub-template that corresponds to that section of a document is inserted with user-specific content. The generated file ends up with the same kind of text spacing and positioning, ordering of sections, presence of annotations and other nonfunctional attributes as the example.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A computer program product embodied in a computer readable medium for generating an output document in a user preferred style using a style capture tool, said computer program product comprising: instruction means for reading an example file representing said user preferred style into an input buffer; instruction means for searching said input buffer for a pattern that matches that of an expected section; if said pattern is found, instruction means for, from the position of said pattern, defining a first bound by searching backwards in said buffer until a previous expected search pattern is found; instruction means for, from the position of said pattern, defining a second bound by searching forwards in said buffer until a next expected search pattern is found; instruction means for copying a string of characters contained within said input buffer between said first bound and said second bound to a template buffer; instruction means for removing said string from said input buffer; instruction means for parsing said template buffer to isolate expected keywords, and names and subsections; instruction means for, if said expected section is a section that can be is repeated in a document, saving in said template buffer the line offsets of keywords, names and other elements; instruction means for replacing content-specific subsections with macro names; and if said pattern is not found, instruction means for creating a default template buffer for said expected section.
2. The computer program product of claim 1 , further comprising: instruction means for getting a said template buffer for each section to be generated in said output document; instruction means for getting user content for all sections of said output document; instruction means for creating an output buffer for storing said output document; for each section of said output document, instruction means for putting a corresponding template buffer into a temporary output buffer; instruction means for replacing macro names in said temporary output buffer with user content information; instruction means for, if this section is expected to be repeated and the user desires alignment, using corresponding template offsets to modify said temporary output buffer for aligning keywords, names, and other sub-sections; instruction means for inserting the content of said temporary output buffer into said output buffer; and instruction means for writing said output buffer to a file.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
July 26, 2008
May 11, 2010
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.