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 method for copying a text format pattern, the method comprising:
- 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 from the user, the format copying instruction indicating reformatting a target object with a format pattern of the sample object, wherein the target object contains N number of target paragraphs;
determining a corresponding relationship between the sample paragraphs and the target paragraphs by;
generating a sample combination by dividing the sample paragraphs into M number of sample groups according to their order and format pattern, each sample group includes adjacent sample paragraphs of the same format pattern;
generating a plurality of different candidate combinations by assigning the N number of target paragraphs to the M number of sample groups, wherein each of the plurality of candidate combinations comprises a different combination of target paragraphs and sample groups, and each of the N number of target paragraphs is assigned to only one of the M number of sample groups for each of the plurality of candidate combinations;
selecting 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;
selecting a single matching combination from the two or more preferred candidate combinations; and
applying the format pattern of the sample paragraphs to the target paragraphs in accordance with the corresponding relationship.
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.
12 Citations
20 Claims
-
1. A method for copying a text format pattern, the method comprising:
-
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 from the user, the format copying instruction indicating reformatting a target object with a format pattern of the sample object, wherein the target object contains N number of target paragraphs; determining a corresponding relationship between the sample paragraphs and the target paragraphs by; generating a sample combination by dividing the sample paragraphs into M number of sample groups according to their order and format pattern, each sample group includes adjacent sample paragraphs of the same format pattern; generating a plurality of different candidate combinations by assigning the N number of target paragraphs to the M number of sample groups, wherein each of the plurality of candidate combinations comprises a different combination of target paragraphs and sample groups, and each of the N number of target paragraphs is assigned to only one of the M number of sample groups for each of the plurality of candidate combinations; selecting 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; selecting a single matching combination from the two or more preferred candidate combinations; and applying the format pattern of the sample paragraphs to the target paragraphs in accordance with the corresponding relationship. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method for copying a text format pattern, the method comprising:
-
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; in response to receiving a format copying instruction from the user, reformatting a target object with a format pattern of the entire sample object, wherein the target object is also selected by the user and contains N number of target paragraphs; determining a corresponding relationship between the sample paragraphs and the target paragraphs by; generating one sample combination by dividing the sample paragraphs into M number of sample groups according to their order and format pattern, each sample group includes adjacent sample paragraphs of the same format pattern; determining a plurality of all possible combinations of the N number of target paragraphs and the M number of sample groups, wherein each of the N number of target paragraphs is assigned to only one of the M number of sample groups for each possible combination; calculating a deviation between the one sample combination and each of the possible combinations, the deviation is the sum of the number of operations of deleting 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 combinations to match the one sample combination; selecting two or more preferred combinations from the plurality of possible combinations based on the deviation between the one sample combination and each of the possible combinations, wherein the two or more preferred combinations comprises the smallest deviation; selecting one matching combination from the two or more preferred combinations, the one matching combination having the same combination of target paragraphs and sample groups as the one sample combination; and applying the format pattern of the sample paragraphs to the target paragraphs based on the corresponding relationship and based on the single matching combination. - View Dependent Claims (8, 9, 10, 11, 12, 13)
-
-
14. A method for copying a text format pattern, the method comprising:
-
in response to receiving a format copying instruction from a user, reformatting a set of target paragraphs with a format pattern of a set of sample paragraphs each of which is selected by the user; generating a single sample combination by dividing the set of sample paragraphs into M number of sample groups according to their order and format pattern, each sample group includes adjacent sample paragraphs of the same format pattern; determining a plurality of all possible combinations of the N number of target paragraphs and the M number of sample groups, wherein each of the N number of target paragraphs is assigned to only one of the M number of sample groups for each possible combination; calculating a similarity between the single sample combination and each of the possible combinations, the 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 single sample combination; selecting two or more preferred combinations from the plurality of possible combinations based on the similarity between the single sample combination and each of the possible combinations, wherein the two or more preferred combinations comprises the smallest similarity; selecting a single 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 single sample combination; and applying the format pattern of the set of sample paragraphs to the set of target paragraphs based on the single matching combination. - View Dependent Claims (15, 16, 17, 18, 19, 20)
-
Specification