Document content export method, export device, electronic device and storage medium
By determining sentences or paragraphs based on context symbols that identify content in exporting document content, the problem of content exporting out of context in the prior art is solved, and the comprehensiveness of exported content and user reading experience are improved.
Patent Information
- Application Number
- CN201910676712.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-25
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2039-07-25
AI Technical Summary
Existing methods for exporting document content can only export content with identifiers, which results in the exported content being easily out of context and resulting in poor user reading experience.
By obtaining the content with a preset identification from the document to be processed, and based on the content and its surrounding document symbols, the sentence or paragraph including the content is determined as the second content to be exported, so that the content is also exported during the export. context.
This makes the content of the new exported document more comprehensive, making it easier for users to understand the content and improving the user's reading experience.
Smart Images

Figure CN112307716B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of office software, and in particular to a document content exporting method, exporting device, electronic equipment and storage medium. Background Art
[0002] In daily work, when people read documents, they often need to mark some important content in the document, for example, highlight or underline these contents, and then export these marked contents to generate a new document for quick query of these contents.
[0003] In the prior art, after the user uses the function of exporting key content, the system usually only exports the content with the mark. The specific process is: the system first searches for the content with the mark in the document in the reading order of the document. Since these marks are preset, the system can directly find the content with the mark in the document, and then export these contents with the mark to generate a new document containing these contents. For example, if the content with the mark in the document is a keyword, the system will also export the keyword; if the content with the mark in the document is a sentence, the system will also export the sentence.
[0004] However, the existing document key content export method can only export the content with the mark, that is, what is marked is exported, so the exported content is difficult to understand due to being out of context, resulting in a poor reading experience for users. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a document content export method, export device, electronic device and storage medium to solve the technical problem that the existing document content export method can only export content with identification. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a method for exporting document content, the method comprising:
[0007] Acquire first content from a document to be processed, where the first content has a preset identifier in the document to be processed, and the first content includes: text content, formula content, or picture content;
[0008] Determine second content based on the first content and document symbols of the context of the first content, where the second content is a sentence or paragraph including the first content, and the document symbol is used to mark the end of the sentence or paragraph;
[0009] The second content is exported.
[0010] Optionally, the step of determining the second content based on the first content and document symbols of the context of the first content includes:
[0011] The second content is determined based on the first content and the document symbol with the least number of words between the first content and the context of the first content.
[0012] Optionally, before determining the second content based on the first content and the document symbols of the context of the first content, the method further includes:
[0013] Obtaining a first selection result of a user for each preset selection item in a first selection interface, wherein the first selection interface is provided with selection items for different exporting methods, wherein the exporting methods include: exporting a whole sentence content, and exporting a whole paragraph content;
[0014] The step of determining the second content based on the first content and document symbols of the context of the first content includes:
[0015] According to the exporting method determined by the first selection result, determining in the to-be-processed document a first symbol of text content located before the first content, and determining a second symbol of text content located after the first content;
[0016] Determine that the content between the first symbol and the second symbol is the second content.
[0017] Optionally, the step of determining the second content based on the first content and document symbols of the context of the first content includes:
[0018] In the document to be processed, taking the first character of the first content as the first starting search point, searching forward for the document symbol with the least number of characters between the first content and the document symbol as the first symbol;
[0019] In the document to be processed, taking the last character of the first content as the second starting search point, searching backward for the document symbol with the least number of characters between the first content and the document symbol as the second symbol;
[0020] The content between the first symbol and the second symbol is determined as the second content.
[0021] Optionally, before acquiring the first content from the document to be processed, the method further includes:
[0022] Obtaining a second selection result of the user for each preset selection item in a second selection interface, where selection items for different preset identifiers are provided in the second selection interface;
[0023] The step of exporting the second content includes:
[0024] A plurality of second contents are derived according to different preset identifiers determined by the second selection result, wherein the plurality of second contents include: second contents corresponding to first contents with different preset identifiers.
[0025] Optionally, before exporting the second content, the method further includes:
[0026] Obtaining a third selection result of the user for each preset selection item in a third selection interface, wherein the third selection interface is provided with a selection item of whether to export the directory of the to-be-processed document;
[0027] The step of exporting the second content includes:
[0028] Acquire a directory of the document to be processed and a node identifier corresponding to each directory level in the directory from preset storage structure information of the document to be processed, wherein one node identifier is used to identify one directory level;
[0029] Determine a node identifier that is located before the second content in the to-be-processed document and has the least number of words between the node identifier and the second content;
[0030] Determining a correspondence between the second content and the directory level according to the determined node identifier;
[0031] According to the corresponding relationship, the second content is added to a directory level corresponding to the second content, and the second content and the directory are exported together.
[0032] Optionally, the step of acquiring the first content from the document to be processed includes:
[0033] Acquire a plurality of the first contents from the document to be processed;
[0034] The step of determining the second content based on the first content and document symbols of the context of the first content includes:
[0035] Determine each second content corresponding to each first content according to the plurality of first contents and the document symbols of the contexts before and after the first contents;
[0036] When there are multiple identical second contents, retain one of the multiple identical second contents and delete the other second contents in the multiple identical second contents;
[0037] When the plurality of identical second contents do not exist, the step of exporting the second contents is performed.
[0038] In a second aspect, an embodiment of the present invention provides a document content exporting device, the device comprising:
[0039] A first acquisition module is used to acquire first content from a document to be processed, wherein the first content has a preset mark in the document to be processed, and the first content includes: text content, formula content, or picture content;
[0040] A determination module, configured to determine a second content based on the first content and document symbols of the context of the first content, wherein the second content is a sentence or paragraph including the first content, and the document symbol is used to mark the end of the sentence or paragraph;
[0041] An export module is used to export the second content.
[0042] Optionally, the determining module is specifically used to:
[0043] The second content is determined based on the first content and the document symbol with the least number of words between the first content and the context of the first content.
[0044] Optionally, the device further comprises:
[0045] A second acquisition module is used to acquire a first selection result of a user for each preset selection item in a first selection interface, wherein the first selection interface is provided with selection items for different exporting methods, wherein the exporting methods include: exporting a whole sentence content, and exporting a whole paragraph content;
[0046] The determination module comprises:
[0047] A first determination submodule, configured to determine, in the document to be processed, a first symbol of text content located before the first content, and a second symbol of text content located after the first content, according to the export mode determined by the first selection result;
[0048] The second determining submodule is used to determine that the content between the first symbol and the second symbol is the second content.
[0049] Optionally, the determining module includes:
[0050] A first search submodule is used to use the first character of the first content as a first starting search point in the to-be-processed document and search forward for a document symbol with the least number of characters between the first content and the document symbol as the first symbol;
[0051] A second search submodule is used to use the last character of the first content as a second starting search point in the to-be-processed document and search backward for a document symbol with the least number of characters between the first content and the document symbol as the second symbol;
[0052] The third determining submodule is used to determine the content between the first symbol and the second symbol as the second content.
[0053] Optionally, the device further comprises:
[0054] A third acquisition module is used to obtain the second selection result of the user for each preset selection item in the second selection interface, where the second selection interface is provided with selection items for different preset identifiers;
[0055] The export module is specifically used for:
[0056] A plurality of second contents are derived according to different preset identifiers determined by the second selection result, wherein the plurality of second contents include: second contents corresponding to first contents with different preset identifiers.
[0057] Optionally, the device further comprises:
[0058] A fourth acquisition module, used to acquire a third selection result of the user for each preset selection item in a third selection interface, wherein the third selection interface is provided with a selection item of whether to export the directory of the to-be-processed document;
[0059] The export module includes:
[0060] An acquisition submodule, used for acquiring the directory of the document to be processed and the node identifier corresponding to each directory level in the directory from the preset storage structure information of the document to be processed, wherein one node identifier is used to identify one directory level;
[0061] A fourth determination submodule is used to determine a node identifier that is located before the second content in the document to be processed and has the least number of words between the node identifier and the second content;
[0062] a fifth determining submodule, configured to determine a correspondence between the second content and the directory level according to the determined node identifier;
[0063] An adding submodule is used to add the second content to a directory level corresponding to the second content according to the corresponding relationship, and export the second content and the directory together.
[0064] Optionally, the first acquisition module is specifically configured to:
[0065] Acquire a plurality of the first contents from the document to be processed;
[0066] The determining module comprises:
[0067] a sixth determination submodule, configured to determine each second content corresponding to the first content according to the plurality of first contents and the document symbols of the contexts before and after the first contents;
[0068] a processing submodule, configured to, when there are a plurality of identical second contents, retain one of the plurality of identical second contents, and delete the other second contents of the plurality of identical second contents;
[0069] The triggering submodule is used to trigger the exporting module to execute the step of exporting the second content when the plurality of identical second contents do not exist.
[0070] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method steps of the document content export method provided in the first aspect of the embodiment of the present invention.
[0071] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored. The computer program is executed by a processor to perform the method steps of the document content export method provided in the first aspect of the embodiment of the present invention.
[0072] The embodiment of the present invention provides a document content export method, export device, electronic device and storage medium, which obtains the first content from the document to be processed, and determines the second content based on the first content and the document symbols of the context of the first content, the second content is a sentence or paragraph including the first content, and finally exports the second content. Through the document export method of the embodiment of the present invention, it is possible to determine that the sentence or paragraph including the first content is the second content, and export the second content, that is, while exporting the first content, the context of the first content is also exported, so as to solve the technical problem that the existing document content export method can only export the content with the mark. Therefore, the document export method of the embodiment of the present invention makes the content of the new document generated after the second content is exported more comprehensive, which is convenient for users to understand these contents on this basis without having to re-read the original document, thereby improving the user's reading experience. Of course, any product or method implementing the present invention does not necessarily need to achieve all the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0074] Figure 1 A schematic diagram of a flow chart of a document content exporting method provided by an embodiment of the present invention;
[0075] Figure 2 Another flowchart of the document content export method provided by the embodiment of the present invention;
[0076] Figure 3 A flowchart of step S102 in the document content exporting method provided in an embodiment of the present invention;
[0077] Figure 4 A third flow chart of the document content exporting method provided by an embodiment of the present invention;
[0078] Figure 5 A fourth flow chart of the document content exporting method provided by an embodiment of the present invention;
[0079] Figure 6 A fifth flow chart of the document content exporting method provided by an embodiment of the present invention;
[0080] Figure 7 A schematic diagram of the structure of a document content exporting device provided by an embodiment of the present invention;
[0081] Figure 8 Another structural schematic diagram of a document content exporting device provided by an embodiment of the present invention;
[0082] Fig. 9 A schematic diagram of a first structure of a determination module in a document content exporting device provided in an embodiment of the present invention;
[0083] Fig.10 A second structural diagram of a determination module in the document content exporting device provided in an embodiment of the present invention;
[0084] Fig.11 A third structural diagram of the document content exporting device provided by an embodiment of the present invention;
[0085] Fig.12 A fourth structural diagram of the document content exporting device provided by an embodiment of the present invention;
[0086] Fig.13A schematic diagram of a structure of an export module in a document content export device provided in an embodiment of the present invention;
[0087] Fig.14 A third structural diagram of a determination module in the document content exporting device provided in an embodiment of the present invention;
[0088] Fig.15 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0089] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0090] In view of this, an embodiment of the present invention first provides a document content export method, which can be applied to a terminal device, and the terminal device can be, for example, an electronic device with information processing capabilities such as an electronic computer, a tablet computer, and a smart phone.
[0091] like Figure 1 As shown, an embodiment of the present invention provides a document content export method, which may include the following steps:
[0092] S101: Acquire first content from a document to be processed.
[0093] In the embodiment of the present invention, the document to be processed may be a Word document, a PPT (PowerPoint, presentation) document or a PDF (Portable Document Format, portable document format) document. As long as the user can add a preset mark to the content in the document, such documents can use the document content export method provided in the embodiment of the present invention to export the second content.
[0094] The first content has a preset mark in the document to be processed, and the preset mark may include: highlighting, underlining, italics or bolding, etc., as long as the preset mark is a mark in the mark library of the document to be processed. Of course, in addition to the implementation method shown in the example given, the methods of implementing this feature all belong to the protection scope of the embodiments of the present invention.
[0095] The first content is the content that the user considers to be more important when reading the document to be processed. The first content may include: text content, formula content, or picture content.
[0096] S102: Determine the second content based on the first content and document symbols of the context of the first content.
[0097] In an embodiment of the present invention, the second content may be a sentence or paragraph including the first content. A sentence here may refer to a complete sentence, which usually ends with a punctuation mark such as a period, a question mark, or an exclamation mark, and these punctuation marks are sentence ending marks. A paragraph may refer to a whole paragraph, which usually ends with a paragraph mark, for example, in a Word document, the paragraph mark is a carriage return.
[0098] The document symbol is used to mark the end of a sentence or paragraph. Therefore, the document symbol here can be a sentence ending symbol such as a period, question mark or exclamation mark, or the document symbol can be a paragraph symbol.
[0099] As an optional implementation of the embodiment of the present invention, step S102 of the embodiment of the present invention may specifically include:
[0100] The second content is determined based on the first content and the document symbol with the least number of words between the first content and the context of the first content.
[0101] In an embodiment of the present invention, the context of the first content may refer to the content before and after the first content in the document to be processed. When the document symbol is a sentence ending symbol such as a period, question mark or exclamation mark, based on the document symbol with the least number of words between the first content and the context of the first content, it can be determined that the document symbol before the first content and with the least number of words between the first content in the document to be processed should be the sentence ending symbol of the sentence before the sentence where the first content is located; in the document to be processed, the document symbol after the first content and with the least number of words between the first content should be the sentence ending symbol of the sentence where the first content is located. The second content can be determined based on the sentence ending symbol of the previous sentence and the sentence ending symbol of the sentence where the first content is located.
[0102] As an optional implementation method of the embodiment of the present invention, Figure 2 As shown, before S102 of the embodiment of the present invention, the document content export method provided by the embodiment of the present invention further includes:
[0103] S201, obtaining a first selection result of a user for each preset selection item in a first selection interface.
[0104] In an embodiment of the present invention, the electronic device may present a first selection interface to the user, wherein the first selection interface is provided with options for different exporting methods, wherein the exporting methods may include: exporting the entire sentence content, and exporting the entire paragraph content. The user may select the exporting method according to his or her understanding of the first content. For example, when the user believes that the first content can only be understood through a paragraph including the first content, the option of exporting the entire paragraph content may be selected; when the user believes that the first content can only be understood through a sentence including the first content, the option of exporting the entire sentence content may be selected.
[0105] When the electronic device obtains the first selection result of the user for each preset selection item in the first selection interface, Figure 2 As shown, S102 of the embodiment of the present invention may specifically include:
[0106] S10211, according to the export method determined by the first selection result, determine a first symbol of the text content located before the first content in the document to be processed, and determine a second symbol of the text content located after the first content.
[0107] When the first selection result obtained by the electronic device is to export an entire paragraph of content, a paragraph symbol of the text content before the first content can be determined in the document to be processed, and the paragraph symbol is the first symbol, and a paragraph symbol of the text content after the first content can be determined in the document to be processed, and the paragraph symbol is the second symbol; when the first selection result obtained by the electronic device is to export an entire sentence of content, a sentence end symbol of the text content before the first content can be determined in the document to be processed, and the sentence end symbol is the first symbol, and a sentence end symbol of the text content after the first content can be determined in the document to be processed, and the sentence end symbol is the second symbol.
[0108] S10212, determining that the content between the first symbol and the second symbol is the second content.
[0109] The content between the paragraph mark of the text content before the first content and the paragraph mark of the text content after the first content is the paragraph including the first content; the content between the sentence end mark of the text content before the first content and the sentence end mark of the text content after the first content is the sentence including the first content.
[0110] It should be noted that the export method may also include exporting only the first content. When the user believes that the first content can be understood after exporting only the first content without exporting the context of the first content, the user may select the option of exporting only the first content. After obtaining the first selection result of exporting only the first content, the electronic device directly exports the first content.
[0111] By adopting the above technical solution, it is possible to provide users with options for different export modes, so that users can make corresponding choices according to their actual needs, and the electronic device will export content that is consistent with the export mode expected by the user according to the selection results of the user for the options for different export modes. Therefore, this technical solution can further meet the needs of users.
[0112] As an optional implementation method of the embodiment of the present invention, Figure 3 As shown, step S102 of the embodiment of the present invention may specifically include:
[0113] S10221, in the document to be processed, taking the first character of the first content as the first starting search point, searching forward for the document symbol with the least number of characters between the first content and the document symbol as the first symbol.
[0114] When the second content is a sentence, in the document to be processed, the first character of the first content can be used as the first starting search point to search forward for the sentence end symbol with the least number of words between the first content and the first content. The sentence end symbol found is the sentence end symbol of the sentence before the sentence where the first content is located, and the sentence end symbol is the first symbol.
[0115] S10222: In the document to be processed, the last character of the first content is used as the second starting search point, and a document symbol with the least number of characters between the first content and the document symbol is searched backward as the second symbol.
[0116] In the document to be processed, the last character of the first content can be used as the second starting search point, and the sentence end symbol with the least number of words between the first content and the first content can be searched backward. The sentence end symbol found is the sentence end symbol of the sentence where the first content is located, and the sentence end symbol is the second symbol.
[0117] S10223, determine the content between the first symbol and the second symbol as the second content.
[0118] The content between the sentence ending symbol of the sentence before the sentence where the first content is located and the sentence ending symbol of the sentence where the first content is located is the sentence where the first content is located, that is, the second content. The method flow of steps S10221 to S10223 can quickly determine the second content.
[0119] As an optional implementation method of the embodiment of the present invention, Figure 4 As shown, step S101 of the embodiment of the present invention may specifically include:
[0120] S1011, obtaining a plurality of first contents from the document to be processed.
[0121] Since the user may need to add preset identifiers to multiple first contents when reading the document to be processed, multiple first contents can be obtained.
[0122] When multiple first contents are obtained, such as Figure 4 As shown, step S102 of the embodiment of the present invention may specifically include:
[0123] S10231, determining each second content corresponding to each first content according to the plurality of first contents and the document symbols of the contexts before and after the first contents.
[0124] First, the second content corresponding to each first content can be determined. The specific method for determining the second content can refer to Figure 3 In steps S10221 to S10223 shown, the second content may be a sentence or a paragraph including the first content.
[0125] S10232: When there are multiple identical second contents, retain one of the multiple identical second contents, and delete the other second contents of the multiple identical second contents.
[0126] When the second content is a sentence, there may be multiple first contents in the document to be processed, which are located in the same sentence, so the second contents corresponding to the multiple first contents are all the same sentences. It can be determined whether there are multiple identical second contents. If there are identical second contents, one of all the identical second contents can be included, and the other second contents can be deleted, to ensure that there are no two identical second contents in all the exported second contents.
[0127] S10233: When there are no multiple identical second contents, execute the step of exporting the second contents.
[0128] If the same second content does not exist in all the second contents, all the second contents may be exported.
[0129] By adopting the above technical solution, by judging whether the same second content exists, if the same second content exists, one second content among all the same second contents is retained, and the other second contents are deleted, thereby avoiding the situation where when multiple first contents are located in a sentence or a paragraph, the second contents corresponding to the multiple first contents are all the same, and there are multiple same second contents in the finally exported new document. Therefore, the above technical solution can further enhance the user's reading experience.
[0130] See also Figure 1 , S103, export the second content.
[0131] When there is only one second content, the second content is exported and a new document is generated; if there are multiple second contents, after all the second contents are exported, a carriage return character is added after each second content and a new document is generated.
[0132] As an optional implementation method of the embodiment of the present invention, Figure 5 As shown, before S101 of the embodiment of the present invention, the document content export method provided by the embodiment of the present invention further includes:
[0133] S301, obtaining the second selection result of the user for each preset selection item in the second selection interface.
[0134] In an embodiment of the present invention, the electronic device can display a second selection interface to the user, and the second selection interface is provided with selection items for different preset identifiers. For example, highlighting, underlining, italics or bolding, etc. can be set in the preset selection items, and the preset selection items can be set according to the user's annotation habits and the document type of the document to be processed. For example, when the document to be processed is a PDF document, since the preset identifiers in the PDF document are only highlighting, underlining, and deleting, etc., these three preset identifiers can be set as three selection items in the second selection interface. For another example, when the document to be processed is a Word document, since there are many preset identifiers in the Word document, but in order to make the first content more clearly distinguishable from other content in the document to be processed, the user may usually choose to highlight, or change the color of the document content, etc. Therefore, for the Word document, these two preset identifiers can be set as two selection items in the second selection interface.
[0135] When the electronic device obtains the user's selection items for different preset identifiers, such as Figure 5 As shown, S103 of the embodiment of the present invention may specifically include:
[0136] S10311, exporting a plurality of second contents according to different preset identifiers determined by the second selection result.
[0137] In the embodiment of the present invention, the plurality of second contents include: second contents corresponding to first contents having different preset identifiers.
[0138] When the user selects only one of the options with preset labels, the electronic device only needs to export the second content corresponding to the first content with this preset label; when the user selects multiple options with preset labels, for example, when the user selects highlighting and bolding at the same time, the electronic device needs to determine the second content corresponding to the highlighted first content, and the second content corresponding to the bolded first content, and export both of the second contents.
[0139] Normally, when the document to be processed contains many aspects of knowledge, the user adds different preset identifiers for different aspects of knowledge. Therefore, in this case, the above technical solution can provide users with options for multiple different preset identifiers. When the user only needs one aspect of knowledge, he can select the preset identifier corresponding to the knowledge, and the electronic device will only export the knowledge in this aspect; when the user needs multiple aspects of knowledge, he can select multiple preset identifiers. At this time, the electronic device will export these multiple aspects of knowledge to a new document at the same time. The user can also select different preset identifiers each time and export to generate a new document, and then export different aspects of knowledge into different new documents. Therefore, the above solution allows users to make choices based on their actual needs, thereby further improving the user's reading experience.
[0140] As an optional implementation method of the embodiment of the present invention, Figure 6 As shown, before S103 of the embodiment of the present invention, the document content export method provided by the embodiment of the present invention further includes:
[0141] S401, obtaining a third selection result of the user for each preset selection item in the third selection interface.
[0142] In an embodiment of the present invention, the electronic device can display a third selection interface to the user, in which a selection item is provided for selecting whether to export the directory of the document to be processed. The preset selection item can usually be set to two selection items, yes and no, for the user to select.
[0143] When the obtained result of the user's third selection in the third selection interface is yes, that is, the user wants to export the directory of the documents to be processed, such as Figure 6 As shown, step S103 of the embodiment of the present invention may specifically include:
[0144] S10321, obtaining a directory of the document to be processed and a node identifier corresponding to each directory level in the directory from preset storage structure information of the document to be processed.
[0145] Usually, the preset storage structure information includes document content, directory, document attributes and other information related to the document, so the directory of the document to be processed and the node identifiers corresponding to each directory level in the directory can be obtained from the preset storage structure information of the document to be processed. In an embodiment of the present invention, a node identifier is used to identify a directory level. For example, for a Word document, the node identifier can be a paragraph symbol at the end of each directory level.
[0146] S10322: Determine a node identifier that is located before the second content in the document to be processed and has the least number of words between the node identifier and the second content.
[0147] A specific determination method may be to search from the first character of the second content forward for a node identifier with the least number of characters between the second content and the content, and determine the node identifier found as the node identifier corresponding to the directory level where the second content is located. When there are multiple second contents, the node identifier corresponding to each second content may be determined separately according to the above method.
[0148] S10323: Determine a correspondence between the second content and the directory level according to the determined node identifier.
[0149] The directory level corresponding to each second content may be determined according to the node identifier corresponding to each second content, and further the corresponding relationship between each second content and the directory level may be determined.
[0150] S10324: Add the second content to the directory level corresponding to the second content according to the corresponding relationship, and export the second content and the directory together.
[0151] According to the correspondence between the second content and the directory level, each second content may be added to the directory level corresponding to each second content, and the second content and the directory may be exported together.
[0152] By adopting the above technical solution, the user can be provided with an option of whether to export the directory, and the user can choose whether to export the directory according to his own needs. If the user thinks that the content in the to-be-processed document is small and does not need a directory, the user can select "no", and the electronic device will only export the second content; if the user thinks that in the new document generated after exporting the second content, when reading the second content, there may still be a situation where the second content cannot be fully understood, or the user still wants to view the content in the to-be-processed document that is located before and after the second content, the electronic device will export the directory and the second content together by selecting "yes", so that the user can quickly find the second content in the to-be-processed document according to the directory, and look through the content in the before and after context, so as to better understand the second content. Therefore, the above technical solution can further meet the needs of customers.
[0153] A document content export method provided by an embodiment of the present invention obtains a first content from a document to be processed, and based on the first content and the document symbols of the context of the first content, determines the second content, the second content being a sentence or paragraph including the first content, and finally exports the second content. Through the document export method of the embodiment of the present invention, it is possible to determine that the sentence or paragraph including the first content is the second content, and export the second content, that is, while exporting the first content, the context of the first content is also exported, so as to solve the technical problem that the existing document content export method can only export content with identification. Therefore, the document export method of the embodiment of the present invention makes the content of the new document generated after the second content is exported more comprehensive, which is convenient for users to understand these contents on this basis without having to re-read the original document, thereby improving the user's reading experience.
[0154] A specific embodiment of a document content exporting device provided by an embodiment of the present invention is Figure 1 The process shown corresponds to the reference Figure 7 , Figure 7 A schematic diagram of the structure of a document content exporting device according to an embodiment of the present invention includes:
[0155] The first acquisition module 501 is used to acquire first content from the document to be processed. The first content has a preset mark in the document to be processed. The first content includes: text content, formula content, or picture content.
[0156] The determination module 502 is used to determine the second content based on the first content and the document symbols of the context of the first content, where the second content is a sentence or paragraph including the first content, and the document symbol is used to mark the end of the sentence or paragraph.
[0157] The export module 503 is used to export the second content.
[0158] As an optional implementation of the embodiment of the present invention, the above-mentioned determination module 502 is specifically used for:
[0159] The second content is determined based on the first content and the document symbol with the least number of words between the first content and the context of the first content.
[0160] As an optional implementation of the embodiment of the present invention, Figure 8 As shown, the document content exporting device provided by the embodiment of the present invention may also include:
[0161] The second acquisition module 601 is used to obtain the first selection result of the user for each preset selection item in the first selection interface. The first selection interface is provided with selection items for different export methods, including: exporting the entire sentence content and exporting the entire paragraph content.
[0162] like Fig. 9 As shown, the above-mentioned determination module 502 may include:
[0163] The first determination submodule 5021 is used to determine the first symbol of the text content located before the first content and the second symbol of the text content located after the first content in the document to be processed according to the export method determined by the first selection result.
[0164] The second determining submodule 5022 is configured to determine that the content between the first symbol and the second symbol is the second content.
[0165] As an optional implementation of the embodiment of the present invention, Fig.10 As shown, the above-mentioned determination module 502 may include:
[0166] The first search submodule 5023 is used to use the first character of the first content as the first starting search point in the document to be processed, and search forward for the document symbol with the least number of characters between the first content and the document symbol as the first symbol.
[0167] The second search submodule 5024 is used to use the last character of the first content as the second starting search point in the document to be processed, and search backward for the document symbol with the least number of characters between the first content and the document symbol as the second symbol.
[0168] The third determining submodule 5025 is used to determine the content between the first symbol and the second symbol as the second content.
[0169] As an optional implementation of the embodiment of the present invention, Fig.11 As shown, the document content exporting device provided by the embodiment of the present invention may also include:
[0170] The third acquisition module 701 is used to obtain the second selection result of the user for each preset selection item in the second selection interface, and the second selection interface is provided with selection items for different preset identifiers.
[0171] The above export module is specifically used for:
[0172] A plurality of second contents are derived according to different preset identifiers determined by the second selection result, wherein the plurality of second contents include: second contents corresponding to the first contents with different preset identifiers.
[0173] As an optional implementation of the embodiment of the present invention, Fig.12 As shown, the document content exporting device provided by the embodiment of the present invention may also include:
[0174] The fourth acquisition module 801 is used to obtain the third selection result of the user for each preset selection item in the third selection interface, and the third selection interface is provided with a selection item of whether to export the directory of the document to be processed.
[0175] like Fig.13 As shown, the export module 503 may include:
[0176] The acquisition submodule 5031 is used to acquire the directory of the document to be processed and the node identifier corresponding to each directory level in the directory from the preset storage structure information of the document to be processed, where one node identifier is used to identify one directory level.
[0177] The fourth determining submodule 5032 is used to determine the node identifier that is located before the second content in the document to be processed and has the least number of words between the node identifier and the second content.
[0178] The fifth determining submodule 5033 is used to determine the correspondence between the second content and the directory level according to the determined node identifier.
[0179] The adding submodule 5034 is used to add the second content to the directory level corresponding to the second content according to the corresponding relationship, and export the second content and the directory together.
[0180] As an optional implementation of the embodiment of the present invention, the first acquisition module 501 is specifically used to: acquire a plurality of first contents from the document to be processed.
[0181] like Fig.14 As shown, the determination module 502 may include:
[0182] The sixth determination submodule 5026 is used to determine each second content corresponding to the first content according to the plurality of first contents and the document symbols of the contexts of the first contents.
[0183] The processing submodule 5027 is used to retain one of the plurality of identical second contents and delete the other second contents when there are a plurality of identical second contents.
[0184] The triggering submodule 5028 is used to trigger the exporting module 503 to execute the step of exporting the second content when there are no multiple identical second contents.
[0185] A document content exporting device provided by an embodiment of the present invention obtains a first content from a document to be processed, and determines a second content based on the first content and the document symbols of the context of the first content, wherein the second content is a sentence or paragraph including the first content, and finally the second content is exported. Through the document exporting method of the embodiment of the present invention, it is possible to determine that the sentence or paragraph including the first content is the second content, and export the second content, that is, while exporting the first content, the context of the first content is also exported, so as to solve the technical problem that the existing document content exporting method can only export the content with the identifier. Therefore, the document exporting method of the embodiment of the present invention makes the content of the new document generated after the second content is exported more comprehensive, which is convenient for users to understand these contents on this basis without having to re-read the original document, thereby improving the user's reading experience.
[0186] The embodiment of the present invention further provides an electronic device, such as Fig.15 As shown, it includes a processor 901 , a communication interface 902 , a memory 903 and a communication bus 904 , wherein the processor 901 , the communication interface 902 , and the memory 903 communicate with each other via the communication bus 904 .
[0187] The memory 903 is used to store computer programs.
[0188] The processor 901 is used to execute the program stored in the memory 903 to implement the following steps:
[0189] A first content is obtained from the document to be processed, where the first content has a preset identifier in the document to be processed, and the first content includes: text content, formula content, or picture content.
[0190] Based on the first content and the document symbols of the context of the first content, the second content is determined, the second content is a sentence or paragraph including the first content, and the document symbol is used to mark the end of the sentence or paragraph.
[0191] Export the second content.
[0192] An electronic device provided by an embodiment of the present invention obtains a first content from a document to be processed, and determines a second content based on the first content and the document symbols of the context of the first content, wherein the second content is a sentence or paragraph including the first content, and finally the second content is exported. Through the document export method of the embodiment of the present invention, it is possible to determine that the sentence or paragraph including the first content is the second content, and export the second content, that is, while exporting the first content, the context of the first content is also exported, so as to solve the technical problem that the existing document content export method can only export content with identifiers. Therefore, the document export method of the embodiment of the present invention makes the content of the new document generated after the second content is exported more comprehensive, which is convenient for users to understand these contents on this basis without having to re-read the original document, thereby improving the user's reading experience.
[0193] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0194] The communication interface is used for communication between the above electronic device and other devices.
[0195] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0196] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0197] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer is enabled to execute the document content exporting method described in any one of the above embodiments.
[0198] As for the device / electronic device / storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0199] It should be noted that the device, electronic device and storage medium of the embodiments of the present invention are respectively the device, electronic device and storage medium to which the above-mentioned document content export method is applied. All embodiments of the above-mentioned document content export method are applicable to the device, electronic device and storage medium, and can achieve the same or similar beneficial effects.
[0200] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0201] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A document content export method, It is characterized in that The method comprises: Acquire first content from a document to be processed, where the first content has a preset identifier in the document to be processed, and the first content includes: text content, formula content, or picture content; Determine second content based on the first content and document symbols of the context of the first content, where the second content is a sentence or paragraph including the first content, and the document symbol is used to mark the end of the sentence or paragraph; exporting the second content as a new document; Before exporting the second content as a new document, the method further includes: Obtaining a third selection result of the user for each preset selection item in a third selection interface, wherein the third selection interface is provided with a selection item of whether to export the directory of the to-be-processed document; The step of exporting the second content as a new document includes: Acquire a directory of the document to be processed and a node identifier corresponding to each directory level in the directory from preset storage structure information of the document to be processed, wherein one node identifier is used to identify one directory level; Determine a node identifier that is located before the second content in the to-be-processed document and has the least number of words between the node identifier and the second content; Determining a correspondence between the second content and the directory level according to the determined node identifier; According to the corresponding relationship, the second content is added to a directory level corresponding to the second content, and the second content and the directory are exported together.
2. The method according to claim 1, It is characterized in that The step of determining the second content based on the first content and document symbols of the context of the first content includes: The second content is determined based on the first content and the document symbol with the least number of words between the first content and the context of the first content.
3. The method according to claim 1 or 2, It is characterized in that Before determining the second content based on the first content and the document symbols of the context of the first content, the method further includes: Obtaining a first selection result of a user for each preset selection item in a first selection interface, wherein the first selection interface is provided with selection items for different exporting methods, wherein the exporting methods include: exporting a whole sentence content, and exporting a whole paragraph content; The step of determining the second content based on the first content and document symbols of the context of the first content includes: According to the exporting method determined by the first selection result, determining in the to-be-processed document a first symbol of text content located before the first content, and determining a second symbol of text content located after the first content; Determine that the content between the first symbol and the second symbol is the second content.
4. The method according to claim 3, It is characterized in that The step of determining the second content based on the first content and document symbols of the context of the first content includes: In the document to be processed, taking the first character of the first content as the first starting search point, searching forward for the document symbol with the least number of characters between the first content and the document symbol as the first symbol; In the document to be processed, taking the last character of the first content as the second starting search point, searching backward for the document symbol with the least number of characters between the first content and the document symbol as the second symbol; The content between the first symbol and the second symbol is determined as the second content.
5. The method according to claim 1, It is characterized in that Before obtaining the first content from the document to be processed, the method further includes: Obtaining a second selection result of the user for each preset selection item in a second selection interface, where selection items for different preset identifiers are provided in the second selection interface; The step of exporting the second content includes: A plurality of second contents are derived according to different preset identifiers determined by the second selection result, wherein the plurality of second contents include: second contents corresponding to first contents with different preset identifiers.
6. The method according to claim 1, It is characterized in that The step of acquiring the first content from the document to be processed includes: Acquire a plurality of the first contents from the document to be processed; The step of determining the second content based on the first content and document symbols of the context of the first content includes: Determine each second content corresponding to each first content according to the plurality of first contents and the document symbols of the contexts before and after the first contents; When there are multiple identical second contents, retain one of the multiple identical second contents and delete the other second contents in the multiple identical second contents; When the plurality of identical second contents do not exist, the step of exporting the second contents is performed.
7. A document content export device, It is characterized in that The device comprises: A first acquisition module is used to acquire first content from a document to be processed, wherein the first content has a preset mark in the document to be processed, and the first content includes: text content, formula content, or picture content; A determination module, configured to determine a second content based on the first content and document symbols of the context of the first content, wherein the second content is a sentence or paragraph including the first content, and the document symbol is used to mark the end of the sentence or paragraph; An export module, used for exporting the second content as a new document; The device also includes: A fourth acquisition module, used to acquire a third selection result of the user for each preset selection item in a third selection interface, wherein the third selection interface is provided with a selection item of whether to export the directory of the to-be-processed document; The export module includes: An acquisition submodule, used for acquiring the directory of the document to be processed and the node identifier corresponding to each directory level in the directory from the preset storage structure information of the document to be processed, wherein one node identifier is used to identify one directory level; A fourth determination submodule is used to determine a node identifier that is located before the second content in the document to be processed and has the least number of words between the node identifier and the second content; a fifth determining submodule, configured to determine a correspondence between the second content and the directory level according to the determined node identifier; An adding submodule is used to add the second content to a directory level corresponding to the second content according to the corresponding relationship, and export the second content and the directory together.
8. The device according to claim 7, It is characterized in that The determination module is specifically used for: The second content is determined based on the first content and the document symbol with the least number of words between the first content and the context of the first content.
9. The device according to claim 7 or 8, It is characterized in that The device also includes: A second acquisition module is used to acquire a first selection result of a user for each preset selection item in a first selection interface, wherein the first selection interface is provided with selection items for different exporting methods, wherein the exporting methods include: exporting a whole sentence content, and exporting a whole paragraph content; The determining module comprises: A first determination submodule, configured to determine, in the document to be processed, a first symbol of text content located before the first content, and a second symbol of text content located after the first content, according to the export mode determined by the first selection result; The second determining submodule is used to determine that the content between the first symbol and the second symbol is the second content.
10. The device according to claim 9, It is characterized in that The determining module comprises: A first search submodule is used to use the first character of the first content as a first starting search point in the to-be-processed document and search forward for a document symbol with the least number of characters between the first content and the document symbol as the first symbol; A second search submodule is used to use the last character of the first content as a second starting search point in the to-be-processed document and search backward for a document symbol with the least number of characters between the first content and the document symbol as the second symbol; The third determining submodule is used to determine the content between the first symbol and the second symbol as the second content.
11. The device according to claim 7, It is characterized in that The device also includes: A third acquisition module is used to obtain the second selection result of the user for each preset selection item in the second selection interface, where the second selection interface is provided with selection items for different preset identifiers; The export module is specifically used for: A plurality of second contents are derived according to different preset identifiers determined by the second selection result, wherein the plurality of second contents include: second contents corresponding to first contents with different preset identifiers.
12. The device according to claim 7, It is characterized in that The first acquisition module is specifically used to: Acquire a plurality of the first contents from the document to be processed; The determining module comprises: a sixth determination submodule, configured to determine each second content corresponding to the first content according to the plurality of first contents and the document symbols of the contexts before and after the first contents; a processing submodule, configured to, when there are a plurality of identical second contents, retain one of the plurality of identical second contents, and delete the other second contents of the plurality of identical second contents; The triggering submodule is used to trigger the exporting module to execute the step of exporting the second content when the plurality of identical second contents do not exist.
13. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.
