CN112069126A - Catalog generation method and device - Google Patents

Catalog generation method and device Download PDF

Info

Publication number
CN112069126A
CN112069126A CN201910500726.4A CN201910500726A CN112069126A CN 112069126 A CN112069126 A CN 112069126A CN 201910500726 A CN201910500726 A CN 201910500726A CN 112069126 A CN112069126 A CN 112069126A
Authority
CN
China
Prior art keywords
directory
sequence number
directory entry
entry
hierarchy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910500726.4A
Other languages
Chinese (zh)
Inventor
董师师
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN201910500726.4A priority Critical patent/CN112069126A/en
Publication of CN112069126A publication Critical patent/CN112069126A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/122File system administration, e.g. details of archiving or snapshots using management policies
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Abstract

The embodiment of the invention provides a directory generation method and a device, which relate to the technical field of computer file processing. By applying the scheme provided by the embodiment of the invention, the directory entry does not need to be searched and the directory hierarchy does not need to be set manually, but the directory entry is searched by utilizing the serial number judgment rule of the directory entry, and then the directory entry is graded by utilizing the directory serial number and the distribution position of the directory entry. When the scheme provided by the embodiment of the invention is applied to generating the directory, the efficiency of generating the file directory can be improved.

Description

Catalog generation method and device
Technical Field
The invention relates to the technical field of computer file processing, in particular to a directory generation method and a directory generation device.
Background
In order to facilitate a user to quickly find information when reading a file, a directory is usually generated for the file. In the prior art, when an electronic device generates a file directory, it is usually necessary to manually search a text with a sequence number in a file, use the searched text as a directory entry, set a directory hierarchy for each directory entry, for example, a first-level directory, a second-level directory, a third-level directory, and the like, and then generate the file directory according to the directory hierarchy set by a user.
Therefore, although the file directory can be generated by applying the prior art, the directory entry needs to be searched manually and the directory hierarchy needs to be set, so that the efficiency of generating the file directory is low.
Disclosure of Invention
The embodiment of the invention aims to provide a directory generation method and a directory generation device so as to improve the generation efficiency of a file directory. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a directory generation method, where the method includes:
according to a preset sequence number judgment rule, determining directory entries used for generating directories from a file, and obtaining the distribution positions of the directory entries in the file, wherein the directory entries comprise: the system comprises a catalog sequence number and catalog content, wherein the catalog sequence number is positioned at the starting position of a paragraph, and the catalog content is adjacent to the catalog sequence number;
determining the directory hierarchy of each directory entry according to the directory sequence number included in each directory entry and the distribution position of each directory entry;
and generating a file directory for the directory entry after the directory hierarchy is determined.
In an embodiment of the present invention, the determining, according to a preset sequence number judgment rule, a directory entry for generating a directory from a file includes:
according to a preset sequence number judgment rule, directory entries which are arranged according to the paragraph sequence and used for generating a directory are determined from the file.
In an embodiment of the present invention, the determining the directory hierarchy of each directory entry according to the directory number included in each directory entry and the distribution position of each directory entry includes:
determining the directory hierarchy of each directory item according to a preset directory hierarchy determination rule;
wherein the directory hierarchy determination rule is:
when the current directory entry is the first directory entry,
the directory hierarchy of the first category directory entry is the same as the directory hierarchy of the first directory entry, wherein the first category directory entry is: the type of the included directory sequence number is the same as that of the directory sequence number included in the first directory entry;
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
when the current directory entry is not the first directory entry,
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
the first sequence number is: a directory number included in a next directory entry of the current directory entry;
the second sequence number is: a directory number included in the current directory entry;
the third directory entry is: the first level after the directory entry with the first sequence number is higher than or equal to the directory entry of the current directory entry level.
In an embodiment of the present invention, the sequence number determination rule is: a regular expression formed by a character representing a sequence number form and a sequence number character string;
wherein, the serial number character string is: and the character strings are formed by characters respectively representing the serial numbers in the same type.
In a second aspect, an embodiment of the present invention provides a directory generation apparatus, where the apparatus includes:
a directory entry determining module, configured to determine, according to a preset sequence number judgment rule, a directory entry used for generating a directory from a file, and obtain a distribution position of each directory entry in the file, where the directory entry includes: the system comprises a catalog sequence number and catalog content, wherein the catalog sequence number is positioned at the starting position of a paragraph, and the catalog content is adjacent to the catalog sequence number;
the hierarchy determining module is used for determining the directory hierarchy of each directory entry according to the directory sequence number included in each directory entry and the distribution position of each directory entry;
and the directory generation module is used for generating a file directory for the directory entry after the directory hierarchy is determined.
In an embodiment of the present invention, the directory entry determining module is specifically configured to:
according to a preset sequence number judgment rule, directory entries which are arranged according to the paragraph sequence and used for generating a directory are determined from the file.
In an embodiment of the present invention, the hierarchy determining module is specifically configured to:
determining the directory hierarchy of each directory item according to a preset directory hierarchy determination rule;
wherein the directory hierarchy determination rule is:
when the current directory entry is the first directory entry,
the directory hierarchy of the first category directory entry is the same as the directory hierarchy of the first directory entry, wherein the first category directory entry is: the type of the included directory sequence number is the same as that of the directory sequence number included in the first directory entry;
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
when the current directory entry is not the first directory entry,
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
the first sequence number is: a directory number included in a next directory entry of the current directory entry;
the second sequence number is: a directory number included in the current directory entry;
the third directory entry is: the first level after the directory entry with the first sequence number is higher than or equal to the directory entry of the current directory entry level.
In an embodiment of the present invention, the sequence number determination rule is: a regular expression formed by a character representing a sequence number form and a sequence number character string;
wherein, the serial number character string is: and the character strings are formed by characters respectively representing the serial numbers in the same type.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the first aspects described above when executing a program stored in the memory.
In a fourth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of any one of the first aspect.
As can be seen from the foregoing technical solutions, when a directory is generated by applying the scheme provided in the embodiments of the present invention, directory entries for generating a directory are determined from a file according to a preset sequence number determination rule, and distribution positions of the directory entries in the file are obtained, then a directory hierarchy of each directory entry is determined according to a directory number included in each directory entry and a distribution position of each directory entry, and finally a file directory is generated for the directory entries after the directory hierarchies are determined. Therefore, when the scheme provided by the embodiment of the invention is applied to generating the directory, the directory entry does not need to be searched and the directory hierarchy does not need to be set manually, but the directory entry is searched by utilizing the serial number judgment rule of the directory entry, and then the directory entry is graded by utilizing the directory serial number and the distribution position of the directory entry.
Therefore, when the scheme provided by the embodiment of the invention is applied to generating the directory, the generation efficiency of the file directory can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a directory generation method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a directory generation apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiments of the present invention provide a directory generation method and apparatus, which are described in detail below.
Referring to fig. 1, fig. 1 is a schematic flowchart of a directory generation method according to an embodiment of the present invention, where the method includes the following steps.
Step 101, determining directory entries used for generating directories from files according to a preset serial number judgment rule, and obtaining distribution positions of the directory entries in the files.
Wherein, the directory entry includes: a directory number and directory contents, the directory number being located at the beginning of the paragraph.
The directory content is adjacent to the directory number, for example, the directory content may be a text with a preset length after the directory number, or the directory content may be a text with a preset length including the directory number, where the preset length may be a preset number of words or a text in a preset punctuation mark.
In an embodiment of the present invention, the sequence number determination rule may be: a regular expression formed of a character representing the form of a sequence number and a sequence number string.
Wherein, the serial number character string is: and the character strings are formed by characters respectively representing the serial numbers in the same type.
Specifically, the type is a type of a serial number, and is determined by a representation form of the serial number. For example, the numbers are 1, 2, 3, etc., the types of the numbers can be considered as roman numeral types. The serial numbers are one, two, three, etc., and the types of the serial numbers can be considered as Chinese character numeric types.
In the case where the numbers 1, 2, and 3 … … are numbers, the numbers may be represented by the characters "1", "2", and "3" … …, respectively, and the number string may be: "123456789".
In the case where the sequence numbers are one, two, and three … …, the sequence numbers may be respectively represented by characters "one", "two", and "three" … …, and accordingly, the sequence number string may be: "one, two, three, four, five, six, seven, eight, nine".
Those skilled in the art will appreciate that the various serial numbers have their own form, which may be represented by certain characters.
For example, the sequence numbers are: in the first, second, and third cases, the characters whose serial numbers represent serial numbers may be "first". Sequence number (one): and (II): and (III): in the meantime, the characters representing the serial number format for these serial numbers may be "(", ")", ": ".
In view of the above, in the case where the sequence number character string is "one, two, three, five, six, seven, eight, nine" and the character indicating the sequence number form is "the first", the regular expression is:
first [ one, two, three, five, six, seven, eight, nine ] +
In an embodiment of the present invention, directory entries for generating a directory, which are arranged in a paragraph order, may be determined from a file according to a preset sequence number judgment rule.
Because the determined directory entries are ordered according to the file paragraph sequence, the directory sequence numbers included in the directory entries are also ordered according to the file paragraph sequence, in the next step of determining the directory entry hierarchy, the position sequence of each directory sequence number in the file does not need to be returned and judged, and the process of determining the directory hierarchy of the directory entries in the following step can be greatly simplified.
And 102, determining the directory hierarchy of each directory entry according to the directory sequence number included in each directory entry and the distribution position of each directory entry.
In an embodiment of the present invention, in a case where the determined directory entries are arranged according to the paragraph order, the directory hierarchy of each directory entry may be determined according to a preset directory hierarchy determination rule.
Wherein, the directory hierarchy determination rule is:
when the current directory entry is the first directory entry,
the directory hierarchy of the first category directory entry is the same as the directory hierarchy of the first directory entry, wherein the first category directory entry is: the type of the included directory sequence number is the same as that of the directory sequence number included in the first directory entry;
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
when the current directory entry is not the first directory entry,
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
the first sequence number is: a directory number included in a next directory entry of the current directory entry;
the second sequence number is: a directory number included in the current directory entry;
the third directory entry is: the first level after the directory entry with the first sequence number is higher than or equal to the directory entry of the current directory entry level.
It should be noted that, in this embodiment, only the relationship between the directory hierarchies of the directory entries is given, but the execution flow when determining the directory hierarchies of the directory entries is not limited. In the specific implementation process, the directory hierarchy of each directory entry may be determined in any manner that can satisfy the target hierarchy determination rule. For example, the directory hierarchy of each directory entry may be determined in a recursive manner, that is, the directory entries with the directory hierarchy as a first directory hierarchy are determined, the directory hierarchies are set for the directory entries, then the directory entries with the directory hierarchy as a second directory hierarchy are determined for the directory entries between every two neighboring directory entries with the first directory hierarchy, and the directory hierarchies are set for the directory entries until the directory hierarchies of all directory entries are determined.
The above-described directory hierarchy determination rule is explained below by specific examples.
Assume that the directory entries determined in step 101 arranged in paragraph order are:
firstly, fruit
(I) bananas
(II) apple
Second, plants
Third, animals
In this case, the category numbers included in the "first, fruit" as the first directory entry, the "second, plant" and the "third, animal" are of the same type as the category number included in the first directory entry and belong to the first category directory entry, so that the directory hierarchies of the directory entries "first, fruit", "second, plant" and "third, animal" are the same directory hierarchy.
In the case that the current directory entry is the first directory entry, the directory number included in banana "is" one "as the first number, the directory number included in the directory entry" first, fruit "is" one "as the second number, and since the first number and the second number are not of the same type, and between the directory entry" first, fruit "and the directory entry" second, plant ", the directory entry" (second), and the directory number included in apple "is" two "of the same type as the first number, the directory levels of the directory entries" (one), banana "and directory entry" (second), and the apple "are the next directory level of the directory levels of the directory entries" first, fruit ".
In an embodiment of the present invention, when there is no directory entry having the same directory entry level as the current directory entry level after the directory entry having the first sequence number, the directory level of the directory entry having the directory sequence number of the first type after the current directory entry is the next directory level of the current directory entry.
In an embodiment of the present invention, when the first type of the first sequence number is identical to the second type of the second sequence number, the directory hierarchy of the directory entry where the first sequence number is located is identical to the directory hierarchy of the directory entry where the second sequence number is located.
Step 103, generating a file directory for the directory entry after determining the directory hierarchy.
It can be seen that, when a directory is generated by applying the scheme provided by the embodiment of the present invention, directory entries for generating a directory are determined from a file according to a preset sequence number judgment rule, distribution positions of the directory entries in the file are obtained, then a directory hierarchy of each directory entry is determined according to a directory sequence number included in each directory entry and the distribution positions of the directory entries, and finally a file directory is generated for the directory entries after the directory hierarchy is determined. When the scheme provided by the embodiment of the invention is applied to generating the directory, the generation efficiency of the file directory can be improved.
For step 102, in another embodiment of the present invention, when the determined directory entries are arranged according to the paragraph order, the directory number in each directory entry may be extracted first, and then the directory hierarchy of each directory entry may be determined according to the preset directory hierarchy determination rule.
For example, the directory number included in each extracted directory entry is as follows:
[ "one," (one) "," (1) "," (2) "," (two) "," two, "" 1, "2," "three," ]
When the second sequence number is "one", "the first sequence number is" (one) "," the second "is the directory sequence number included in the third directory entry, and since the sequence types of" the second "," the third "," the first "," the same ", the directory hierarchy of the directory entry where" the second "," the third "," the same as "the first", "the same as the directory hierarchy of the directory entry where" the first "," the second "," the directory entry where "the first", "the second", "the next directory hierarchy of the directory entry where" the first "and" the second "are located.
In the case where the second sequence number is "(one)", the first sequence number is "(1)", "(two)" is the directory sequence number included in the third directory entry, and the directory hierarchy of the directory entry where "(1)" and "(2)" are located is the next directory hierarchy of the directory entry where "(one)" is located.
In an embodiment of the present invention, directory entries arranged according to a paragraph order and used for generating a directory may be determined from a file according to a preset sequence number determination rule, and a directory number included in each directory entry may be extracted:
[ "one," (one) "," (1) "," (2) "," (two) "," two, "" 1, "2," "three," ]
And determining the directory hierarchy of the directory entry where each directory sequence number is located according to a directory hierarchy determination rule.
Because the serial number types of the ' one ' and ' the ' three ' are the same as the ' one ' and ' the ' one ', ' two ' and ' three ' and the directory item are the same as the directory hierarchy of the ' one ', the ' two ', the ' three ' and the ' directory item, the first directory hierarchy is taken as the first directory hierarchy;
the sequence numbers of the (first) and the (second) are the same, and the (first) and the (second) are positioned between the sequence numbers of the first, the second and the third, so that the directory hierarchy of the (first) and the (second) is the next directory hierarchy of the first directory hierarchy and is taken as a second directory hierarchy;
likewise, "1," and "2," also a second directory level;
"(1)" and "(2)" have the same type of serial number, and "(1)" and "(2)" are located between the serial numbers "(one)" and "(two)", so the directory hierarchy where "(1)" and "(2)" are located is the next directory hierarchy of the second directory hierarchy as the third directory hierarchy.
And generating a file directory for the directory entry after the directory hierarchy is determined.
Fig. 2 is a schematic structural diagram of a graph adjustment apparatus according to an embodiment of the present invention, where the apparatus includes:
the directory entry determination module 201: the method comprises the following steps of determining directory entries used for generating directories from files according to a preset sequence number judgment rule, and obtaining the distribution positions of the directory entries in the files, wherein the directory entries comprise: the system comprises a catalog sequence number and catalog content, wherein the catalog sequence number is positioned at the starting position of a paragraph, and the catalog content is adjacent to the catalog sequence number;
the hierarchy determination module 202: the directory hierarchy of each directory entry is determined according to the directory sequence number included by each directory entry and the distribution position of each directory entry;
the catalog generation module 203: for generating a file directory for the directory entry after determining the directory hierarchy.
In an embodiment of the present invention, the directory entry determining module 201 is specifically configured to:
according to a preset sequence number judgment rule, directory entries which are arranged according to the paragraph sequence and used for generating a directory are determined from the file.
In an embodiment of the present invention, the hierarchy determining module 202 is specifically configured to:
determining the directory hierarchy of each directory item according to a preset directory hierarchy determination rule;
wherein the directory hierarchy determination rule is:
when the current directory entry is the first directory entry,
the directory hierarchy of the first category directory entry is the same as the directory hierarchy of the first directory entry, wherein the first category directory entry is: the type of the included directory sequence number is the same as that of the directory sequence number included in the first directory entry;
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
when the current directory entry is not the first directory entry,
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
the first sequence number is: a directory number included in a next directory entry of the current directory entry;
the second sequence number is: a directory number included in the current directory entry;
the third directory entry is: the first level after the directory entry with the first sequence number is higher than or equal to the directory entry of the current directory entry level.
In an embodiment of the present invention, the sequence number determination rule is: a regular expression formed by a character representing a sequence number form and a sequence number character string;
wherein, the serial number character string is: and the character strings are formed by characters respectively representing the serial numbers in the same type.
It can be seen that, when a directory is generated by applying the scheme provided by the embodiment of the present invention, directory entries for generating a directory are determined from a file according to a preset sequence number judgment rule, distribution positions of the directory entries in the file are obtained, then a directory hierarchy of each directory entry is determined according to a directory sequence number included in each directory entry and the distribution positions of the directory entries, and finally a file directory is generated for the directory entries after the directory hierarchy is determined. When the device provided by the embodiment of the invention is applied to generating the directory, the generation efficiency of the file directory can be improved.
The embodiment of the present invention further provides an electronic device, as shown in fig. 3, which includes a processor 301, a communication interface 302, a memory 303, and a communication bus 304, where the processor 301, the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304,
a memory 303 for storing a computer program;
the processor 301 is configured to implement the directory generation method provided in the embodiment of the present invention when executing the program stored in the memory 303.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program realizes the steps of any of the above-mentioned directory generation methods when executed by a processor.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform any of the above-described directory generation methods.
It can be seen that, when the electronic device provided by the above embodiment is applied to generate a directory, when the computer program stored in the computer-readable storage medium provided by the above embodiment is executed to generate a directory, and when the computer program product provided by the above embodiment is run on a computer to generate a directory, directory entries for generating a directory are determined from a file according to a preset sequence number judgment rule, and distribution positions of the directory entries in the file are obtained, then a directory hierarchy of the directory entries is determined according to directory numbers included in the directory entries and distribution positions of the directory entries, and finally a file directory is generated for the directory entries after the directory hierarchies are determined.
Compared with the prior art, by applying the scheme provided by the embodiment of the invention, the directory entry does not need to be searched manually and the directory hierarchy is set, but the directory entry is searched by using the serial number judgment rule of the directory entry, and then the directory entry is classified by using the directory serial number and the distribution position of the directory entry. Therefore, when the scheme provided by the embodiment of the invention is applied to generating the directory, the generation efficiency of the file directory can be improved.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, apparatus embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are described with relative simplicity as they are substantially similar to method embodiments, where relevant only as described in portions of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A directory generation method, the method comprising:
according to a preset sequence number judgment rule, determining directory entries used for generating directories from a file, and obtaining the distribution positions of the directory entries in the file, wherein the directory entries comprise: the system comprises a catalog sequence number and catalog content, wherein the catalog sequence number is positioned at the starting position of a paragraph, and the catalog content is adjacent to the catalog sequence number;
determining the directory hierarchy of each directory entry according to the directory sequence number included in each directory entry and the distribution position of each directory entry;
and generating a file directory for the directory entry after the directory hierarchy is determined.
2. The method according to claim 1, wherein the determining a directory entry for generating a directory from a file according to a preset sequence number judgment rule comprises:
according to a preset sequence number judgment rule, directory entries which are arranged according to the paragraph sequence and used for generating a directory are determined from the file.
3. The method according to claim 2, wherein determining the directory hierarchy of each directory entry according to the directory number included in each directory entry and the distribution location of each directory entry comprises:
determining the directory hierarchy of each directory item according to a preset directory hierarchy determination rule;
wherein the directory hierarchy determination rule is:
when the current directory entry is the first directory entry,
the directory hierarchy of the first category directory entry is the same as the directory hierarchy of the first directory entry, wherein the first category directory entry is: the type of the included directory sequence number is the same as that of the directory sequence number included in the first directory entry;
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
when the current directory entry is not the first directory entry,
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
the first sequence number is: a directory number included in a next directory entry of the current directory entry;
the second sequence number is: a directory number included in the current directory entry;
the third directory entry is: the first level after the directory entry with the first sequence number is higher than or equal to the directory entry of the current directory entry level.
4. The method according to any one of claims 1 to 3,
the sequence number judgment rule is as follows: a regular expression formed by a character representing a sequence number form and a sequence number character string;
wherein, the serial number character string is: and the character strings are formed by characters respectively representing the serial numbers in the same type.
5. A catalog generation apparatus, wherein the apparatus comprises:
a directory entry determining module, configured to determine, according to a preset sequence number judgment rule, a directory entry used for generating a directory from a file, and obtain a distribution position of each directory entry in the file, where the directory entry includes: the system comprises a catalog sequence number and catalog content, wherein the catalog sequence number is positioned at the starting position of a paragraph, and the catalog content is adjacent to the catalog sequence number;
the hierarchy determining module is used for determining the directory hierarchy of each directory entry according to the directory sequence number included in each directory entry and the distribution position of each directory entry;
and the directory generation module is used for generating a file directory for the directory entry after the directory hierarchy is determined.
6. The apparatus of claim 5, wherein the directory entry determination module is specifically configured to:
according to a preset sequence number judgment rule, directory entries which are arranged according to the paragraph sequence and used for generating a directory are determined from the file.
7. The apparatus of claim 6, wherein the hierarchy determination module is specifically configured to:
determining the directory hierarchy of each directory item according to a preset directory hierarchy determination rule;
wherein the directory hierarchy determination rule is:
when the current directory entry is the first directory entry,
the directory hierarchy of the first category directory entry is the same as the directory hierarchy of the first directory entry, wherein the first category directory entry is: the type of the included directory sequence number is the same as that of the directory sequence number included in the first directory entry;
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
when the current directory entry is not the first directory entry,
when the first type of the first sequence number is inconsistent with the second type of the second sequence number, the directory hierarchy of the directory entry between the current directory entry and the third directory entry and where the directory sequence number of the first type is located is the next directory hierarchy of the current directory entry;
the first sequence number is: a directory number included in a next directory entry of the current directory entry;
the second sequence number is: a directory number included in the current directory entry;
the third directory entry is: the first level after the directory entry with the first sequence number is higher than or equal to the directory entry of the current directory entry level.
8. The apparatus according to any one of claims 5-7,
the sequence number judgment rule is as follows: a regular expression formed by a character representing a sequence number form and a sequence number character string;
wherein, the serial number character string is: and the character strings are formed by characters respectively representing the serial numbers in the same type.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN201910500726.4A 2019-06-11 2019-06-11 Catalog generation method and device Pending CN112069126A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910500726.4A CN112069126A (en) 2019-06-11 2019-06-11 Catalog generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910500726.4A CN112069126A (en) 2019-06-11 2019-06-11 Catalog generation method and device

Publications (1)

Publication Number Publication Date
CN112069126A true CN112069126A (en) 2020-12-11

Family

ID=73658270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910500726.4A Pending CN112069126A (en) 2019-06-11 2019-06-11 Catalog generation method and device

Country Status (1)

Country Link
CN (1) CN112069126A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855244A (en) * 2011-06-28 2013-01-02 北大方正集团有限公司 Method and device for file catalogue processing
CN104111922A (en) * 2013-04-16 2014-10-22 北大方正集团有限公司 Processing method and device of streaming document
US20160335280A1 (en) * 2015-05-12 2016-11-17 Y. Jerry Shmerl System and method for organizing, retrieving and displaying information using html indices
CN106951540A (en) * 2017-03-23 2017-07-14 掌阅科技股份有限公司 Generation method, device, server and the computer-readable storage medium of file directory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855244A (en) * 2011-06-28 2013-01-02 北大方正集团有限公司 Method and device for file catalogue processing
CN104111922A (en) * 2013-04-16 2014-10-22 北大方正集团有限公司 Processing method and device of streaming document
US20160335280A1 (en) * 2015-05-12 2016-11-17 Y. Jerry Shmerl System and method for organizing, retrieving and displaying information using html indices
CN106951540A (en) * 2017-03-23 2017-07-14 掌阅科技股份有限公司 Generation method, device, server and the computer-readable storage medium of file directory

Similar Documents

Publication Publication Date Title
US11816170B2 (en) Dynamic search set creation in a search engine
CN107707545B (en) Abnormal webpage access fragment detection method, device, equipment and storage medium
CN110765770A (en) Automatic contract generation method and device
JP6827116B2 (en) Web page clustering method and equipment
CN110113393B (en) Message pushing method and device, electronic equipment and medium
CN110837556A (en) Abstract generation method and device, terminal equipment and storage medium
CN109977366B (en) Catalog generation method and device
CN109190014B (en) Regular expression generation method and device and electronic equipment
US20170185653A1 (en) Predicting Knowledge Types In A Search Query Using Word Co-Occurrence And Semi/Unstructured Free Text
CN109977233B (en) Idiom knowledge graph construction method and device
US20230205755A1 (en) Methods and systems for improved search for data loss prevention
CN105955984A (en) Network data searching method based on crawler mode
CN111309970A (en) Data retrieval method and device, electronic equipment and storage medium
CN105446986A (en) Web page processing method and device
US20150161187A1 (en) Evaluation of Nodes
US8862586B2 (en) Document analysis system
CN113642311A (en) Data comparison method and device, electronic equipment and storage medium
CN111435406A (en) Method and device for correcting database statement spelling errors
CN112256691A (en) Data mapping method and device and electronic equipment
CN112069126A (en) Catalog generation method and device
CN111767223B (en) File processing method and device, electronic equipment and storage medium
CN110825976B (en) Website page detection method and device, electronic equipment and medium
JP2022104892A (en) Identification method of long tail keyword, keyword retrieval method, and computer equipment
CN112347324A (en) Document query method and device, electronic equipment and storage medium
CN112463896A (en) Archive cataloging data processing method and device, computing equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination