CN112417834A - Document processing method and device and electronic equipment - Google Patents

Document processing method and device and electronic equipment Download PDF

Info

Publication number
CN112417834A
CN112417834A CN201910786503.9A CN201910786503A CN112417834A CN 112417834 A CN112417834 A CN 112417834A CN 201910786503 A CN201910786503 A CN 201910786503A CN 112417834 A CN112417834 A CN 112417834A
Authority
CN
China
Prior art keywords
document
processed
target
template
paragraph
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.)
Granted
Application number
CN201910786503.9A
Other languages
Chinese (zh)
Other versions
CN112417834B (en
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 CN201910786503.9A priority Critical patent/CN112417834B/en
Publication of CN112417834A publication Critical patent/CN112417834A/en
Application granted granted Critical
Publication of CN112417834B publication Critical patent/CN112417834B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The embodiment of the invention provides a document processing method, a document processing device and electronic equipment, wherein the method comprises the following steps: acquiring a document to be processed; determining a target numbering template from preset numbering templates when the selection operation of the capturing numbering template is carried out; and numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document. By applying the embodiment of the invention, the efficiency of modifying the document by the user can be improved.

Description

Document processing method and device and electronic equipment
Technical Field
The present invention relates to the field of electronic document processing technologies, and in particular, to a document processing method and apparatus, and an electronic device.
Background
In daily work, study, and life, users often need to perform document editing through document editing software in electronic devices. When a user writes a document with a clear hierarchy such as a paper, a label, etc., it is often necessary to process the number in the document.
Currently, when a user processes a number in a document, an electronic device can process the number in the document according to a default number template selected by the user from a plurality of system default number templates. Specifically, the electronic device may determine the number in the document, and then change the numbered style in the document according to the numbered style in the default number template selected by the user, so as to obtain the processed document.
Because the pattern of the serial number in the default serial number template of the system is designed according to the habit of western serial numbers and is not in accordance with the habit of Chinese serial numbers, when a user needs to process the serial number in a document, the processing result obtained by processing the serial number in the default serial number template of the system by the electronic equipment is probably not appropriate, and obviously brings inconvenience when the user writes the document.
Disclosure of Invention
The embodiment of the invention aims to provide a document processing method, a document processing device and electronic equipment, which are used for processing a document to obtain a numbered target document. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a document processing method, where the method includes:
acquiring a document to be processed;
when the number capturing template is selected, determining a target number template from preset number templates, wherein the number templates and a system default number template are in a parallel relation, each number template comprises a plurality of levels of numbers, and the plurality of levels of numbers at least comprise one level of Chinese numbers and the number in the system default number template;
and numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document.
Optionally, a number exists in the document to be processed;
the step of numbering the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain a numbered target document comprises the following steps:
determining a number included in the document to be processed as a number to be processed;
and changing the styles of the numbers to be processed at the corresponding levels according to the styles of the numbers at all levels in the target numbering template to obtain the numbered target document.
Optionally, no number exists in the document to be processed;
the step of numbering the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain the target document with a specific number includes:
determining paragraphs of the document to be processed, wherein the paragraph formats of the document to be processed conform to a preset format, and using the paragraphs as paragraphs to be processed;
determining the level of the paragraph to be processed according to the preset format;
and adding each level number in the target number template to the to-be-processed paragraph of the corresponding level based on the determined level to obtain a numbered target document.
Optionally, after the step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document, the method further includes:
and changing the character style of the title to which each number belongs in the target document into a target character style, wherein the target character style is a preset character style corresponding to the number template.
Optionally, after the step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document, the method further includes:
and changing the paragraph style of the title to which each number belongs in the target document into a target paragraph style, wherein the target paragraph style is a preset paragraph style corresponding to the number template.
In a second aspect, an embodiment of the present invention provides a document processing apparatus, where the apparatus includes:
the document acquisition module is used for acquiring a document to be processed;
the system comprises a target template determining module, a system default numbering template determining module and a target template determining module, wherein the target template determining module is used for determining a target numbering template from a preset numbering template database when the number capturing template is selected, the numbering template and the system default numbering template are in a parallel relation, each numbering template comprises a plurality of levels of numbers, and the plurality of levels of numbers at least comprise one level of Chinese numbers and the numbers in the system default numbering template;
and the document processing module is used for numbering the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain the numbered target document.
Optionally, a number exists in the document to be processed;
the document processing module includes:
the number determining submodule is used for determining the number included in the document to be processed as the number to be processed;
and the number processing submodule is used for changing the styles of the numbers to be processed at the corresponding levels according to the styles of the numbers at all levels in the target number template to obtain the numbered target document.
Optionally, no number exists in the document to be processed;
the document processing module includes:
the paragraph determining submodule is used for determining paragraphs of the document to be processed, wherein the paragraph formats of the document to be processed conform to a preset format and the paragraphs serve as paragraphs to be processed;
the level determining submodule is used for determining the level of the paragraph to be processed according to the preset format;
and the number adding submodule is used for adding the number of each level in the target number template to the to-be-processed paragraph of the corresponding level based on the determined level to obtain the numbered target document.
Optionally, the apparatus further comprises:
and the word style processing module is used for numbering the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain a numbered target document, and then changing the word style of the title to which each number belongs in the target document into a target word style, wherein the target word style is a preset word style corresponding to the numbering template.
Optionally, the apparatus further comprises: and the paragraph style processing module is used for changing the paragraph style of a title to which each number belongs in the target document into a target paragraph style after the document to be processed is numbered based on the number in the target numbering template and the paragraph format of the document to be processed to obtain the numbered target document, wherein the target paragraph style is the preset paragraph style corresponding to the numbering template.
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;
and a processor for implementing any of the above-described document processing method steps when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements any of the document processing method steps described above.
In the scheme provided by the embodiment of the invention, the electronic equipment can acquire the document to be processed, then the target numbering template is determined from the preset numbering template when the selection operation of the numbering template is captured, and the document to be processed is numbered based on the number in the target numbering template and the paragraph format of the document to be processed, so that the numbered target document is obtained. Therefore, the electronic equipment can quickly process the document to be processed according to the numbering template required by the user, and the document modifying efficiency of the user is improved. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
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 flowchart of a document processing method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a numbered template interface according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a document to be processed according to an embodiment of the present invention;
FIG. 4 is a flow chart of a manner of adding numbers to a document based on the embodiment shown in FIG. 1;
FIG. 5 is a schematic structural diagram of a document processing apparatus according to an embodiment of the present invention;
fig. 6 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.
In order to process a document to obtain a numbered target document, embodiments of the present invention provide a document processing method, an apparatus, an electronic device, and a computer-readable storage medium.
First, a document processing method provided by an embodiment of the present invention is described below.
The document processing method provided by the embodiment of the present invention may be applied to any electronic device that needs to process a document, for example, a computer, a mobile phone, a processor, and the like, and is not limited specifically herein. For convenience of description, the electronic device is hereinafter referred to simply.
As shown in fig. 1, a document processing method may include:
s101, acquiring a document to be processed;
s102, determining a target number template from preset number templates when the number template is captured and selected;
the number templates and the default system number templates are in a parallel relationship, each number template comprises a plurality of levels of numbers, and the plurality of levels of numbers at least comprise one level of Chinese numbers and the number in the default system number template.
S103, numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document.
It can be seen that, in the scheme provided by the embodiment of the present invention, the electronic device may obtain a document to be processed, and then determine a target numbering template from preset numbering templates when a numbering template selection operation is captured, and then number the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed, so as to obtain a numbered target document. Therefore, the electronic equipment can quickly process the document to be processed according to the numbering template required by the user, and the document modifying efficiency of the user is improved.
In the step S101, the electronic device may obtain a document to be processed, where the document to be processed is a document that needs to be processed and includes text content. The document to be processed may be a document edited by the user currently, may also be a document stored in advance in the local electronic device, and may also be a document sent to the electronic device by another electronic device, which is reasonable.
After the document to be processed is obtained, when the user sends out a numbering template selection operation, the user needs to perform numbering processing on the document to be processed at the moment. In order to facilitate the numbering process for the document, the electronic device may preset a plurality of numbering templates, so that when the number template selection operation is captured, a target numbering template is determined from the preset numbering templates for processing the document to be processed, that is, the above-mentioned step S102 is performed.
The electronic equipment can also store a default numbering template of the system, but the default numbering template of the system is a numbering template which generally accords with western language numbering habits and cannot meet the numbering requirements of users on Chinese documents. Therefore, in order to provide more numbering templates conforming to Chinese numbering habits for the user to select, the electronic equipment can preset a plurality of numbering templates, namely the preset numbering templates according to the habits and rules of the user for writing documents.
Since the user may be used to the default system number template, the preset number template and the default system number template may be in a parallel relationship for the convenience of the user. For example, as shown in FIG. 2, when the user clicks the template button, the pre-set numbered template thumbnails 201, 202 and the system default numbered template thumbnails 203, 204, 205, 206, 207, 208 may be displayed simultaneously for selection by the user.
Since a general document has a plurality of layers and needs to have a plurality of levels of numbers, each preset number template can comprise a plurality of levels of numbers, and the plurality of levels of numbers at least comprise a level of Chinese numbers and the numbers in the default system number template, so that the habit of Chinese numbers can be met, and the use habit of the default system template formed by a user is met, and the use of the user is more convenient.
In one embodiment, the system default number template X1 stored by the electronic device may be as shown in the following table:
Figure BDA0002178208790000071
then, the preset number template M1 can be as shown in the following table:
Figure BDA0002178208790000072
after determining the target numbering template, in order to obtain the document with the number in the numbering template selected by the user, the electronic device may execute the step S103, that is, perform numbering processing on the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed, so as to obtain the numbered target document.
For the document to be processed with the serial number, the serial number can be adjusted according to the serial number in the target serial number template; for the document to be processed without the number, the number can be added to the document to be processed according to the number in the target number template.
As an implementation manner provided by the embodiment of the present invention, a number may exist in the document to be processed.
In one case, the user has already entered a number in the document to be processed, and the electronic device obtains the number in the document to be processed.
For this situation, the step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document may include:
determining a number included in the document to be processed as a number to be processed; and changing the styles of the numbers to be processed at the corresponding levels according to the styles of the numbers at all levels in the target numbering template to obtain the numbered target document.
The number exists in the document to be processed acquired by the electronic equipment, which indicates that the user needs to adjust the number existing in the document to be processed. Therefore, the electronic device can determine that the number included in the document to be processed is the number to be processed.
After the number to be processed is determined, in order to adjust the number to be processed to the style required by the user, the electronic device may change the style of the number to be processed at the corresponding level according to the style of the number at each level in the target number template, so as to obtain the numbered target document.
For example, as shown in fig. 3, the electronic device determines that the number 301, the number 302, the number 303, and the number 304 included in the document to be processed are the numbers to be processed, and the target number template M2 is shown in the following table:
Figure BDA0002178208790000081
then, the electronic device may change the to-be-processed number 301 to the "first part" and the to-be-processed number 302 to the "second part" according to the pattern of the first-level number in the target number template M2, and may also change the to-be-processed number 303 to the "one" and the to-be-processed number 304 to the "two" according to the pattern of the second-level number in the target number template M2.
It can be seen that, in this embodiment, in the case that the number exists in the document to be processed, the electronic device may determine the number included in the document to be processed as the number to be processed, and then change the style of the number to be processed at the corresponding level according to the style of the number at each level in the target number template, so as to obtain the numbered target document. Therefore, when the number exists in the document to be processed, the electronic equipment can adjust the number to be processed according to the target number template, and the target document which accords with Chinese habits and meets user requirements can be obtained.
As an implementation manner provided by the embodiment of the present invention, no number may exist in the document to be processed.
In one case, the document that the user needs to process may not have a number, and the document to be processed acquired by the electronic device may not have a number.
For this situation, the step of numbering the to-be-processed document based on the number in the target number template and the paragraph format of the to-be-processed document to obtain the target document with a specific number may include, as shown in fig. 4:
s401, determining paragraphs of the document to be processed, wherein the paragraph formats of the document to be processed accord with a preset format, and using the paragraphs as paragraphs to be processed;
according to the writing rule of Chinese documents, the document contents generally comprise a title paragraph and a text paragraph, and the paragraph format of the title paragraph is generally different from that of the text paragraph. Since a user generally needs to add a number to a title paragraph when writing a document, when no number exists in the document to be processed, in order to determine which paragraph or paragraphs in the document to be processed are the title paragraphs, the electronic device may determine whether a paragraph format of the paragraph in the document to be processed conforms to a preset format, and when the paragraph format conforms to the preset format, the paragraph may be determined to be the title paragraph, that is, the paragraph to be processed.
For example, the preset format may be "centered alignment", and when the electronic device determines that the paragraph format of paragraph D1 in the document to be processed conforms to "centered alignment", paragraph D1 may be determined as the paragraph to be processed.
S402, determining the level of the paragraph to be processed according to the preset format;
the electronic device may determine a plurality of paragraphs to be processed from the document to be processed, and there may be a plurality of logical relationships between the paragraphs to be processed, for example, a parallel relationship, an affiliation relationship, and the like. Because the paragraphs to be processed have different logical relationships, their paragraph formats are generally different, and in order to make the numbers added to the paragraphs to be processed conform to the logical relationships between the paragraphs to be processed, the electronic device may determine the level of each paragraph to be processed according to a preset format.
For example, in the preset format, the paragraph format of the paragraph to be processed at the first level is "aligned in the middle, and 2 lines are spaced behind the paragraph", and the paragraph format of the paragraph to be processed at the second level is "aligned in the middle, and 1.5 lines are spaced behind the paragraph". When the electronic device determines that the paragraph format of the to-be-processed paragraph D2 corresponds to "aligned centered, 2 lines after paragraph", it may determine that the level of the to-be-processed paragraph D2 is the first level; when the electronic device determines that the paragraph format of pending paragraph D3 corresponds to "center aligned, 1.5 lines post paragraph", the rank of pending paragraph D3 may be determined to be the second rank.
S403, based on the determined levels, adding the level numbers in the target number template to the paragraphs to be processed at the corresponding levels to obtain numbered target documents.
After determining the level of each to-be-processed paragraph, the electronic device may add the number in the target number template to the to-be-processed paragraph at its corresponding level according to the determined level.
For example, the object number template M5 may be as shown in the following table:
Figure BDA0002178208790000101
the electronic device determines that the to-be-processed paragraph D4 is ranked at the first level, and the to-be-processed paragraphs D5 and D6 are ranked at the second level, and then the electronic device may add the number of the first level in the target number template M5 to the to-be-processed paragraph D4, and may add the number of the second level in the target number template M5 to the to-be-processed paragraph D5 and the to-be-processed paragraph D6.
When one paragraph to be processed at one level is one, the first number of the corresponding level in the target number template may be added to the paragraph to be processed; when there are a plurality of paragraphs to be processed at one level, the number of the corresponding level in the target number template may be added to the plurality of paragraphs to be processed according to the logical relationship of each paragraph in the document to be processed.
For example, when the second level number in the target number template M5 is added to the to-be-processed paragraph D5 and the to-be-processed paragraph D6 with respect to the target number template M5, if the to-be-processed paragraph D5 and the to-be-processed paragraph D6 are in a parallel relationship, the electronic device may add the second level numbers "one" and "two" in the target number template M5 to the to-be-processed paragraph D5 and the to-be-processed paragraph D6, respectively.
As can be seen, in this embodiment, in the case that no number exists in the document to be processed, the electronic device may determine, as the to-be-processed paragraph, a paragraph in the document to be processed whose paragraph format conforms to the preset format, then determine, according to the preset format, a level of the to-be-processed paragraph, and further add, based on the determined level, each level number in the target number template to the to-be-processed paragraph at the corresponding level, so as to obtain the numbered target document. Therefore, when no number exists in the document to be processed, the electronic equipment can add the number to the document to be processed according to the format of the paragraph in the document to be processed, and a target document which meets the Chinese habit and meets the user requirement can be obtained.
As an implementation manner provided by the embodiment of the present invention, after the step of numbering the to-be-processed document based on the number in the target number template and the paragraph format of the to-be-processed document to obtain the numbered target document, the method may further include:
and changing the character style of the title to which each number belongs in the target document into a target character style.
And the target character style is a character style corresponding to a preset numbering template. The text style is an effect that the text presents in the document, for example, the text style may be a font, a font size, a bold, an incline, an underline, a font color, a character shading, a character border, and the like.
The text style of the title portion and the text portion of the document may be different according to the writing rules of the document. For example, the font size of the text of the header portion in the document is larger than the font size of the text of the body portion; as another example, the font of the text portion in the document may be different from the font of the text portion, and so on.
In order to make the effect of the title in the target document more prominent, after the target document is obtained, the electronic device may change the text style of the title to which each label in the target document belongs to the text style corresponding to the preset numbering template, that is, the target text style.
For example, the target text style may be "bold, 20, bold", and the electronic device may change the font of the text of the title to which each number in the target document belongs to the bold, change the font size to 20, and bold the font.
It can be seen that, in this embodiment, after the document to be processed is numbered based on the numbers in the target numbering template and the paragraph formats of the document to be processed to obtain the target document with the numbers, the electronic device may change the text style of the title to which each number belongs in the target document into the target text style. Therefore, after the electronic equipment obtains the target document, the character style of the title to which each number belongs in the target document can be changed into the character style corresponding to the target number template, so that the numbering process of the document is more comprehensive, and the format of the obtained target document is more standardized.
As an implementation manner provided by the embodiment of the present invention, after the step of numbering the to-be-processed document based on the number in the target number template and the paragraph format of the to-be-processed document to obtain the numbered target document, the method may further include:
and changing the paragraph style of the title to which each number belongs in the target document into a target paragraph style.
The target paragraph style is a paragraph style corresponding to a preset numbering template. The paragraph style may determine the effect that the paragraph appears in the document, for example, the paragraph style may be alignment, line spacing, paragraph shading, indentation, and the like.
The paragraph style of the title portion and the paragraph style of the body portion in the document may be different according to the document composition rules. For example, the title part in the document is aligned in the middle, and the text part is aligned at both ends; as another example, the header portion segment spacing is different from the body portion segment spacing in the document, and so on.
In order to make the style of the title paragraph in the target document more standard, after the target document is obtained, the electronic device may change the paragraph style of the title to which each label belongs in the target document to the paragraph style corresponding to the preset numbering template, that is, the target paragraph style.
For example, the target paragraph style may be "center aligned, 1.5 lines after the paragraph", and the electronic device may change the paragraph alignment manner of the title to which each number belongs in the target document to center aligned, and the paragraph spacing to 1.5 lines after the paragraph alignment manner.
Therefore, in this embodiment, the electronic device may change the paragraph style of the title to which each number belongs in the target document into the target paragraph style after numbering the document to be processed based on the number in the target number template and the paragraph format of the document to be processed to obtain the numbered target document. Therefore, after the electronic equipment obtains the target document, the paragraph style of the title to which each number belongs in the target document can be changed into the paragraph style corresponding to the target number template, so that the numbering process of the document is more comprehensive, and the style of the obtained paragraph in the target document is more standard.
Corresponding to the document processing method, the embodiment of the invention also provides a document processing device. The following describes a document processing apparatus according to an embodiment of the present invention.
As shown in fig. 5, a document processing apparatus, the apparatus comprising:
a document obtaining module 501, configured to obtain a document to be processed;
a target template determining module 502, configured to determine a target numbering template from a preset numbering template database when a selection operation of a captured numbering template is performed;
the number templates and the default system number templates are in a parallel relationship, each number template comprises a plurality of levels of numbers, and the plurality of levels of numbers at least comprise one level of Chinese numbers and the number in the default system number template.
And the document processing module 503 is configured to number the to-be-processed document based on the number in the target number template and the paragraph format of the to-be-processed document, so as to obtain a numbered target document.
Therefore, in the scheme provided by the embodiment of the invention, the electronic device can acquire the document to be processed, then determine the target numbering template from the preset numbering templates when the selection operation of the numbering template is captured, and further number the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain the numbered target document. Therefore, the electronic equipment can quickly process the document to be processed according to the numbering template required by the user, and the document modifying efficiency of the user is improved.
As an implementation manner of the embodiment of the present invention, a number may exist in the document to be processed;
the document processing module 503 may include:
a number determination submodule (not shown in fig. 5) for determining a number included in the document to be processed as a number to be processed;
and a numbering sub-module (not shown in fig. 5) configured to change the styles of the numbers to be processed at corresponding levels according to the styles of the numbers at different levels in the target numbering template, so as to obtain a numbered target document.
As an implementation manner of the embodiment of the present invention, no number may exist in the document to be processed;
the document processing module 503 may include:
a paragraph determining sub-module (not shown in fig. 5) configured to determine a paragraph in the to-be-processed document whose paragraph format conforms to a preset format as a to-be-processed paragraph;
a level determination submodule (not shown in fig. 5) for determining a level of the to-be-processed paragraph according to the preset format;
and a number adding sub-module (not shown in fig. 5) configured to add, based on the determined level, each level number in the target number template to the to-be-processed paragraph at a corresponding level, so as to obtain a numbered target document.
As an implementation manner of the embodiment of the present invention, the document processing apparatus may further include:
a word style processing module (not shown in fig. 5) configured to, after numbering the to-be-processed document based on the numbers in the target numbering template and the paragraph formats of the to-be-processed document to obtain a numbered target document, change a word style of a title to which each number belongs in the target document into a target word style;
and the target character style is a character style corresponding to the preset numbering template.
As an implementation manner of the embodiment of the present invention, the document processing apparatus may further include:
a paragraph style processing module (not shown in fig. 5) configured to, after numbering the to-be-processed document based on the numbers in the target numbering template and the paragraph formats of the to-be-processed document to obtain a numbered target document, change the paragraph style of the heading to which each number belongs in the target document into a target paragraph style;
and the target paragraph style is a paragraph style corresponding to the preset numbering template.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
acquiring a document to be processed;
determining a target numbering template from preset numbering templates when the selection operation of the capturing numbering template is carried out;
the number templates and the default system number templates are in a parallel relationship, each number template comprises a plurality of levels of numbers, and the plurality of levels of numbers at least comprise one level of Chinese numbers and the number in the default system number template.
And numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document.
Therefore, in the scheme provided by the embodiment of the invention, the electronic device can acquire the document to be processed, then determine the target numbering template from the preset numbering templates when the selection operation of the numbering template is captured, and further number the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain the numbered target document. Therefore, the electronic equipment can quickly process the document to be processed according to the numbering template required by the user, and the document modifying efficiency of the user is improved.
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.
Wherein, the document to be processed may have a number;
the step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document may include:
determining a number included in the document to be processed as a number to be processed;
and changing the styles of the numbers to be processed at the corresponding levels according to the styles of the numbers at all levels in the target numbering template to obtain the numbered target document.
The document to be processed may not have a number;
the above step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the target document with a specific number may include:
determining paragraphs of the document to be processed, wherein the paragraph formats of the document to be processed conform to a preset format, and using the paragraphs as paragraphs to be processed;
determining the level of the paragraph to be processed according to the preset format;
and adding each level number in the target number template to the to-be-processed paragraph of the corresponding level based on the determined level to obtain a numbered target document.
After the step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document, the method may further include:
changing the character style of the title to which each number belongs in the target document into a target character style;
and the target character style is a character style corresponding to the preset numbering template.
After the step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document, the method may further include:
changing the paragraph style of the title to which each number belongs in the target document into a target paragraph style;
and the target paragraph style is a paragraph style corresponding to the preset numbering template.
In yet another embodiment provided by the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, the computer program, when executed by a processor, implementing the steps of:
acquiring a document to be processed;
determining a target numbering template from preset numbering templates when the selection operation of the capturing numbering template is carried out;
the number templates and the default system number templates are in a parallel relationship, each number template comprises a plurality of levels of numbers, and the plurality of levels of numbers at least comprise one level of Chinese numbers and the number in the default system number template.
And numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document.
It can be seen that, in the solution provided in the embodiment of the present invention, when a computer program stored in a computer-readable storage medium is executed by a processor, a to-be-processed document may be obtained, and then when a number template is captured and a number template is selected, a target number template is determined from preset number templates, and then the to-be-processed document is numbered based on the number in the target number template and the paragraph format of the to-be-processed document, so as to obtain the to-be-numbered target document. Therefore, the electronic equipment can quickly process the document to be processed according to the numbering template required by the user, and the document modifying efficiency of the user is improved.
Wherein, the document to be processed may have a number;
the step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document may include:
determining a number included in the document to be processed as a number to be processed;
and changing the styles of the numbers to be processed at the corresponding levels according to the styles of the numbers at all levels in the target numbering template to obtain the numbered target document.
The document to be processed may not have a number;
the above step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the target document with a specific number may include:
determining paragraphs of the document to be processed, wherein the paragraph formats of the document to be processed conform to a preset format, and using the paragraphs as paragraphs to be processed;
determining the level of the paragraph to be processed according to the preset format;
and adding each level number in the target number template to the to-be-processed paragraph of the corresponding level based on the determined level to obtain a numbered target document.
After the step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document, the method may further include:
changing the character style of the title to which each number belongs in the target document into a target character style;
and the target character style is a character style corresponding to the preset numbering template.
After the step of numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document, the method may further include:
changing the paragraph style of the title to which each number belongs in the target document into a target paragraph style;
and the target paragraph style is a paragraph style corresponding to the preset numbering template.
It should be noted that, for the above-mentioned apparatus, electronic device and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
It is further 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. 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 (12)

1. A method of document processing, the method comprising:
acquiring a document to be processed;
when the number capturing template is selected, determining a target number template from preset number templates, wherein the number templates and a system default number template are in a parallel relation, each number template comprises a plurality of levels of numbers, and the plurality of levels of numbers at least comprise one level of Chinese numbers and the number in the system default number template;
and numbering the to-be-processed document based on the number in the target numbering template and the paragraph format of the to-be-processed document to obtain the numbered target document.
2. The method according to claim 1, characterized in that there is a number in the document to be processed;
the step of numbering the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain a numbered target document comprises the following steps:
determining a number included in the document to be processed as a number to be processed;
and changing the styles of the numbers to be processed at the corresponding levels according to the styles of the numbers at all levels in the target numbering template to obtain the numbered target document.
3. The method according to claim 1, wherein no number is present in the document to be processed;
the step of numbering the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain the target document with a specific number includes:
determining paragraphs of the document to be processed, wherein the paragraph formats of the document to be processed conform to a preset format, and using the paragraphs as paragraphs to be processed;
determining the level of the paragraph to be processed according to the preset format;
and adding each level number in the target number template to the to-be-processed paragraph of the corresponding level based on the determined level to obtain a numbered target document.
4. The method according to any one of claims 1-3, wherein after the step of numbering the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain the numbered target document, the method further comprises:
and changing the character style of the title to which each number belongs in the target document into a target character style, wherein the target character style is a preset character style corresponding to the number template.
5. The method according to any one of claims 1-3, wherein after the step of numbering the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain the numbered target document, the method further comprises:
and changing the paragraph style of the title to which each number belongs in the target document into a target paragraph style, wherein the target paragraph style is a preset paragraph style corresponding to the number template.
6. A document processing apparatus, characterized in that the apparatus comprises:
the document acquisition module is used for acquiring a document to be processed;
the system comprises a target template determining module, a system default numbering template determining module and a target template determining module, wherein the target template determining module is used for determining a target numbering template from a preset numbering template database when the number capturing template is selected, the numbering template and the system default numbering template are in a parallel relation, each numbering template comprises a plurality of levels of numbers, and the plurality of levels of numbers at least comprise one level of Chinese numbers and the numbers in the system default numbering template;
and the document processing module is used for numbering the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain the numbered target document.
7. The apparatus of claim 6, wherein there is a number in the document to be processed;
the document processing module includes:
the number determining submodule is used for determining the number included in the document to be processed as the number to be processed;
and the number processing submodule is used for changing the styles of the numbers to be processed at the corresponding levels according to the styles of the numbers at all levels in the target number template to obtain the numbered target document.
8. The apparatus of claim 6, wherein no number exists in the document to be processed;
the document processing module includes:
the paragraph determining submodule is used for determining paragraphs of the document to be processed, wherein the paragraph formats of the document to be processed conform to a preset format and the paragraphs serve as paragraphs to be processed;
the level determining submodule is used for determining the level of the paragraph to be processed according to the preset format;
and the number adding submodule is used for adding the number of each level in the target number template to the to-be-processed paragraph of the corresponding level based on the determined level to obtain the numbered target document.
9. The apparatus of any of claims 6-8, further comprising:
and the word style processing module is used for numbering the document to be processed based on the number in the target numbering template and the paragraph format of the document to be processed to obtain a numbered target document, and then changing the word style of the title to which each number belongs in the target document into a target word style, wherein the target word style is a preset word style corresponding to the numbering template.
10. The apparatus of any of claims 6-8, further comprising:
and the paragraph style processing module is used for changing the paragraph style of a title to which each number belongs in the target document into a target paragraph style after the document to be processed is numbered based on the number in the target numbering template and the paragraph format of the document to be processed to obtain the numbered target document, wherein the target paragraph style is the preset paragraph style corresponding to the numbering template.
11. 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 one of claims 1 to 5 when executing a program stored in the memory.
12. 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 the claims 1-5.
CN201910786503.9A 2019-08-23 2019-08-23 Document processing method and device and electronic equipment Active CN112417834B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910786503.9A CN112417834B (en) 2019-08-23 2019-08-23 Document processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910786503.9A CN112417834B (en) 2019-08-23 2019-08-23 Document processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112417834A true CN112417834A (en) 2021-02-26
CN112417834B CN112417834B (en) 2024-06-25

Family

ID=74779425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910786503.9A Active CN112417834B (en) 2019-08-23 2019-08-23 Document processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112417834B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090292987A1 (en) * 2008-05-22 2009-11-26 International Business Machines Corporation Formatting selected content of an electronic document based on analyzed formatting
CN101872340A (en) * 2009-04-23 2010-10-27 北京大学 Typesetting method and device based on format layout template
CN108376153A (en) * 2018-02-07 2018-08-07 厦门集微科技有限公司 A kind of Webpage production method and device
CN109740139A (en) * 2018-11-27 2019-05-10 平安科技(深圳)有限公司 The customized pattern control method of Document Title, device, computer equipment and storage medium
CN110134931A (en) * 2019-05-14 2019-08-16 北京字节跳动网络技术有限公司 Media title generation method, device, electronic equipment and readable medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090292987A1 (en) * 2008-05-22 2009-11-26 International Business Machines Corporation Formatting selected content of an electronic document based on analyzed formatting
CN101872340A (en) * 2009-04-23 2010-10-27 北京大学 Typesetting method and device based on format layout template
CN108376153A (en) * 2018-02-07 2018-08-07 厦门集微科技有限公司 A kind of Webpage production method and device
CN109740139A (en) * 2018-11-27 2019-05-10 平安科技(深圳)有限公司 The customized pattern control method of Document Title, device, computer equipment and storage medium
CN110134931A (en) * 2019-05-14 2019-08-16 北京字节跳动网络技术有限公司 Media title generation method, device, electronic equipment and readable medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李艳芳、文海英: "Word样式的应用和管理研究", 《湖南科技学院学报》, vol. 39, no. 5, pages 62 - 65 *

Also Published As

Publication number Publication date
CN112417834B (en) 2024-06-25

Similar Documents

Publication Publication Date Title
CN111428457B (en) Automatic formatting of data tables
CN111597771B (en) Method, device, electronic equipment and medium for adjusting document content format
CN112651217B (en) Paper document processing method, paper document processing device, electronic equipment and storage medium
CN111414727B (en) Editing method and device for PDF document header footer and electronic equipment
WO2017211202A1 (en) Method, device, and terminal device for extracting data
CN109992759B (en) Table object editing method and device, electronic equipment and storage medium
CN111199136A (en) Document content display method, device and equipment
CN112329409B (en) Cell color conversion method and device and electronic equipment
US8650482B2 (en) Dynamic positioning and aligning tabs relative to margins indent and column width
CN112417830B (en) Document page management method and device, electronic equipment and storage medium
CN112417834B (en) Document processing method and device and electronic equipment
CN111783408A (en) Cell pasting method and device, electronic equipment and storage medium
CN112000257A (en) Method and device for exporting key contents of document
CN110309103B (en) Document opening method and device, electronic equipment and readable storage medium
CN112783396B (en) Object format modification method and device
CN112949266B (en) Electronic form processing method, electronic form processing device, electronic equipment and storage medium
CN110457659B (en) Clause document generation method and terminal equipment
CN114118029A (en) Image processing method, device, equipment and storage medium
CN111832270B (en) Method and device for displaying line numbers and column labels of tables in non-table document and electronic equipment
CN112417898A (en) Text translation method based on keyword prompt, computing device and storage medium
CN112784526A (en) Document page adjusting method and device
CN112395829B (en) Method and device for adding Chinese numbers to documents and electronic equipment
KR20200070506A (en) Method for describing a patent specification
CN111553136A (en) Method and device for generating demonstration document template and electronic equipment
US20190146659A1 (en) Method and system for selecting objects on a computer screen

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
GR01 Patent grant
GR01 Patent grant