Methods and apparatus for obtaining structured information in fixed layout documents
Abstract
The present application discloses a method and an apparatus for obtaining structured information in a fixed layout document to improve the structuring speed for information management of a fixed layout document. The method may comprise: determining initial page number information corresponding to current directory entry of the document; segmenting first article content of a page corresponding to the initial page number information into at least one structured-characters-block; searching in each structured-characters-block for a first structured-characters-block which matches with name strings of the current directory entry, and obtaining first position information about where the first structured-characters-block is located in the first article content; and obtaining initial position information of the current directory entry and end position information of the previous directory entry based on the first position information.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1. A computer-implemented method for obtaining structured information of a fixed layout document on a computer comprising a processor, the method comprising:
determining, using the processor, initial page number information corresponding to a current directory entry of the document;
segmenting, using the processor and according to content attributes, a first article content of a page corresponding to the determined initial page number information into at least one structured-characters-block;
searching, using the processor, in each segmented structured-characters-block for a first structured-characters-block which matches with name strings of the current directory entry, and obtaining, using the processor, first position information about where the searched first structured-characters-block is located in the first article content; and
obtaining, using the processor, initial position information of the current directory entry and end position information of a previous directory entry based on the obtained first position information,
wherein the searching comprises:
searching, using the processor, in each structured-characters-block to determine whether there is a structured-characters-block matched with each character in the name strings of the current directory entry,
if there is a structured-characters-block matched with each character in the name strings of the current directory entry, determining, using the processor, the searched structured-characters-block as the first structured-characters-block;
if there is no structured-characters-block matched with each character in the name strings of the current directory entry, searching, using the processor, in each structured-characters-block to determine whether there is a structured-characters-block matched with the name strings of the current directory entry by using regular expression,
if there is a structured-characters-block matched with the name strings of the current directory entry by using regular expression, determining, using the processor, the searched structured-characters-block as the first structured-characters-block;
if there is no structured-characters-block matched with the name strings of the current directory entry by using regular expression, calculating, using the processor, a matched degree between each structured-characters-block and the name strings of the current directory entry by one-by-one character matching, and
determining, using the processor, a structured-characters-block with the calculated matched degree as the first structured-characters-block, when the calculated matched degree reaches a preset threshold,
wherein the step of obtaining initial position information of the current directory entry and end position information of the previous directory entry based on the first position information comprises:
when the first position information refer to a position where the end structured-characters-block is located in the first article content,
segmenting, according to character attributes, a second article content of next page of the page corresponding to the initial page number information into at least one structured-characters-block, and
determining the initial position information of the current directory entry based on the first position information and a position information about where the initial structured-characters-block is located in the second article content;
when the first position information refers to a position where the initial structured-characters-block is located in the first article content,
segmenting, according to the character attributes, a third article content of previous page of the page corresponding to the initial page number information into at least one structured-characters-block, and
determining the end position information of the previous directory entry based on the first position information and a position information about where the end structured-characters-block is located in the third article content.
2. The method according to claim 1 , wherein the segmenting comprises:
segmenting the first article content into at least one structured-characters-block according to differences of a font size and a format between characters of directory and characters of main body of the document, and according to differences between: a first line-spacing between directories and the main body of the document, and a second line-spacing among the characters of main body of the document,
wherein the structured-characters-block comprises a segment-structured-character or a line-structured-character.
3. The method according to claim 1 , wherein before searching in each structured-characters-block to determine whether there is a structured-characters-block matched with each character in the name strings of the current directory entry, the method further comprises:
unifying each structured-characters-block and the name strings of the current directory entry into full-width characters or half-width characters.
4. An apparatus for obtaining structured information in a fixed layout document, the apparatus comprising:
a memory that stores executable components; and
a processor, coupled to the memory, that executes the executable components to perform operations of the apparatus, the executable components comprising:
a determining unit configured to determine initial page number information corresponding to a current directory entry of the document;
a segmenting unit configured to divide a first article content of a page corresponding to the initial page number information into at least one structured-characters-block;
a matching unit configured to search for a first structured-characters-block which matches with the name strings of the current directory entry in each structured-characters-block, and to obtain first position information about where the searched first structured-characters-block is located in the first article content of the document; and
a obtaining unit configured to obtain initial position information of the current directory entry based on the first position information, wherein
the matching unit is further configured to determine whether there is a structured-characters-block matched with each character in the name strings of the current directory entry,
if there is a structured-characters-block matched with each character in the name strings of the current directory entry, to determine the searched structured-characters-block as the first structured-characters-block;
if there is no structured-characters-block matched with each character in the name strings of the current directory entry, to further search in each structured-characters-block to determine whether there is a structured-characters-block matched with the name strings of the current directory entry by using regular expression,
if there is a structured-characters-block matched with the name strings of the current directory entry by using regular expression, to determine the searched structured-characters-block as the first structured-characters-block;
if there is no structured-characters-block matched with the name strings of the current directory entry by using regular expression, to calculate a matched degree between each structured-characters-block and the name strings of the current directory entry by one-by-one character matching, and
to determine a structured-characters-block with the calculated matched degree as the first structured-characters-block, when the calculated matched degree reaches a preset threshold,
when the first position information refers to a position where the end structured-characters-block is located in the first article content, the obtaining unit is further configured to
divide, according to character attributes, a second article content of next page of the page corresponding to the initial page number information into at least one structured-characters-block, and
determine the initial position information of the current directory entry based on the first position information and a position information about where the initial structured-characters-block is located in the second article content;
when the first position information refers to a position where the initial structured-characters-block is located in the first article content, the obtaining unit is further configured to
divide, according to the character attributes, a third article content of previous page of the page corresponding to the initial page number information into at least one structured-characters-block, and
determine the end position information of the previous directory entry based on the first position information and a position information about where the end structured-characters-block is located in the third article content.
5. The apparatus according to claim 4 , wherein the segmenting unit is further configured to divide the first article content into at least one structured-characters-block according to:
differences of a font size and a format between characters of directory and characters of main body of the document, and according to differences between: a first line-spacing between directories and the main body of the document, and a second line-spacing among the characters of main body of the document,
wherein the structured-characters-block comprises a segment-structured-character or a line-structured-character.
6. The apparatus according to claim 4 , wherein the matching unit is further configured to unify each structured-characters-block and the name strings of the current directory entry into full-width characters or half-width characters.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.