Back to results
US 9,430,231 B1Granted
Automatic comment creation for computer files
AssigneeInternational Business Machines Corporation
InventorIan M. Hodges
Life of this patent
Estimating the term…
Abstract
Embodiments of the present invention include a method, computer program product, and system for inserting text content into a computer file as a comment in a determined comment convention. In an embodiment, a comment convention is determined in a file. The file includes at least one file line. A text content is received. A comment is inserted into the file. The comment includes the comment convention and the text content.
Claims1
A method for inserting text into a file as a comment in a determined comment convention, the method comprising:
- determining, by one or more computer processors, at least one file line of a file that has a special character as the first non-space character;
- determining, by one or more computer processors, one or more character sequences in the determined at least one file line;
- determining, by one or more computer processors, a start comment sequence as a most frequently identified character sequence of the determined one or more character sequences;
- determining, by one or more computer processors, an end comment sequence as the reverse order of the start comment sequence in a file line in which the start comment sequence is identified;
- determining, by one or more computer processors, if a first appearance of the start comment sequence and a file line immediately preceding the start comment sequence have a same character in a same character location;
- responsive to determining the first appearance of the start comment sequence and the file line immediately preceding the start comment sequence have a same character in a same character location;
- determining, by one or more computer processors, a header line as the file line immediately preceding the start comment sequence;
- determining, by one or more computer processors, if a last appearance of the start comment sequence and a file line immediately succeeding the start comment sequence have a same character in a same character location;
- responsive to determining the last appearance of the start comment sequence and the file line immediately succeeding the start comment sequence have a same character in a same character location,
- determining, by one or more computer processors, a trailer line as the file line immediately succeeding the start comment sequence;
- receiving, by one or more computer processors, a text content;
- and
- inserting, by one or more computer processors, a comment into the file, wherein the comment includes the start comment sequence, the end comment sequence, the header line, the trailer line, and the text content.
10 more elements
Dependencies are inferred from the claim text.