Reformatting multiple paragraphs of text using the formatting of a sample object by creating multiple candidate combinations and selecting a closest match
First Claim
1. A computer program product for reformatting a plurality of target paragraphs with a format pattern of a plurality of sample paragraphs, the computer program product comprising one or more computer-readable storage media and program instructions stored on the one or more computer-readable storage media, the program instructions comprising:
- program instructions to generate a sample combination by dividing the plurality of sample paragraphs into sample groups according to their order and format pattern, each sample group includes adjacent sample paragraphs of the same format pattern;
program instructions to generate a plurality of different candidate combinations by assigning the plurality of target paragraphs to the sample groups, wherein each of the plurality of candidate combinations comprises a different combination of target paragraphs and sample groups, and each of the plurality of target paragraphs is assigned to only one sample group for each of the plurality of candidate combinations;
program instructions to select two or more preferred candidate combinations from the plurality of candidate combinations based on a degree of similarity between the sample combination and each of the plurality of candidate combinations;
program instructions to select a single matching combination from the two or more preferred candidate combinations; and
program instructions to apply the format pattern of the plurality of sample paragraphs to the plurality of target paragraphs in accordance with the single matching combination.
1 Assignment
0 Petitions
Accused Products
Abstract
The invention relates to electronic document processing. Embodiments of the present invention relate to a method and apparatus for copying a text format pattern. In one embodiment of the present invention there is a method for copying a text format pattern, including: receiving a selection of a sample object from a user, the sample object including multiple sample paragraphs of which at least two sample paragraphs have different format patterns; receiving a format copying instruction of from the user, the format copying instruction indicating reformatting a target object with the format pattern of the sample object, where the target object contains multiple target paragraphs; determining a corresponding relationship of the format pattern of the sample paragraphs with the target paragraphs; and applying the format pattern of the sample paragraphs to the target paragraphs in accordance with the corresponding relationship.
-
Citations
16 Claims
-
1. A computer program product for reformatting a plurality of target paragraphs with a format pattern of a plurality of sample paragraphs, the computer program product comprising one or more computer-readable storage media and program instructions stored on the one or more computer-readable storage media, the program instructions comprising:
-
program instructions to generate a sample combination by dividing the plurality of sample paragraphs into sample groups according to their order and format pattern, each sample group includes adjacent sample paragraphs of the same format pattern; program instructions to generate a plurality of different candidate combinations by assigning the plurality of target paragraphs to the sample groups, wherein each of the plurality of candidate combinations comprises a different combination of target paragraphs and sample groups, and each of the plurality of target paragraphs is assigned to only one sample group for each of the plurality of candidate combinations; program instructions to select two or more preferred candidate combinations from the plurality of candidate combinations based on a degree of similarity between the sample combination and each of the plurality of candidate combinations; program instructions to select a single matching combination from the two or more preferred candidate combinations; and program instructions to apply the format pattern of the plurality of sample paragraphs to the plurality of target paragraphs in accordance with the single matching combination. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer program product product for reformatting a set of target paragraphs with a format pattern of a set of sample paragraphs, the computer program product comprising one or more computer-readable storage media and program instructions stored on the one or more computer-readable storage media, the program instructions comprising:
-
program instructions to generate a sample combination by dividing the set of sample paragraphs into sample groups according to their order and format pattern, each sample group includes adjacent sample paragraphs of the same format pattern; program instructions to determine a plurality of all possible combinations of the set of target paragraphs and the sample groups, wherein each of the target paragraphs is assigned to only one sample group for each possible combination; program instructions to calculate a degree of similarity between the sample combination and each of the possible combinations, the degree of similarity is the sum of the number of operations of removing a target paragraph from a sample group for each of the possible combinations and the number of operations of adding a target paragraph to a sample group for each of the possible combinations in order for each of the possible combination to match the sample combination; program instructions to select two or more preferred combinations from the plurality of possible combinations based on the degree of similarity between the sample combination and each of the possible combinations, wherein the two or more preferred combinations comprises the smallest degree of similarity; program instructions to select a matching combination from the two or more preferred candidate combinations, the single matching combination having the same combination of target paragraphs and sample groups as the sample combination; and program instructions to apply the format pattern of the set of sample paragraphs to the set of target paragraphs based on the single matching combination. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
Specification