Patent ID: 11934765
Assignee: BEIJING KINGSOFT OFFICE SOFTWARE, INC.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 7:
8. A method for aligning elements in a document, the method comprising:
obtaining elements contained in the document;
assigning the elements into groups;
obtaining an inter-group alignment manner between the groups, and obtaining a respective intra-group alignment manner for elements in each of the groups; and
aligning the groups based on the inter-group alignment manner, and aligning the elements in each of the groups based on the corresponding intra-group alignment manner,
wherein, assigning the elements into groups comprises:
determining an attribute of each of the elements;
obtaining distribution of the attributes of the elements based on distribution of the elements in the document, and determining a distribution rule for the attributes of the elements in the document based on the distribution of the attributes of the elements; and
assigning the elements based on the distribution rule, wherein a same group of the groups comprises multiple types of elements, and different groups of the groups have a same number of types of the elements and a same order of the elements,
wherein the distribution rule is obtained by performing calculation on the distribution of the attributes of the elements in the document based on a rule algorithm,
wherein assigning the elements into groups further comprises:
determining position regions, in which the elements are located, in the document;
determining position regions overlapping in the determined position regions as one position region group;
for each position region group, determining a minimum position region containing all position regions in the position region group; and
determining a plurality of position region groups whose minimum position regions have a same contour; and assigning elements corresponding to position regions in each of the plurality of position region groups into one group.