CN111563364A - Chapter title style conversion method and device, electronic equipment and storage medium - Google Patents

Chapter title style conversion method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111563364A
CN111563364A CN201910114409.9A CN201910114409A CN111563364A CN 111563364 A CN111563364 A CN 111563364A CN 201910114409 A CN201910114409 A CN 201910114409A CN 111563364 A CN111563364 A CN 111563364A
Authority
CN
China
Prior art keywords
chapter
title
paragraph
style
chapter title
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
CN201910114409.9A
Other languages
Chinese (zh)
Other versions
CN111563364B (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
Guangzhou Kingsoft Mobile Technology Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Kingsoft Mobile Technology 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, Guangzhou Kingsoft Mobile Technology Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN201910114409.9A priority Critical patent/CN111563364B/en
Publication of CN111563364A publication Critical patent/CN111563364A/en
Application granted granted Critical
Publication of CN111563364B publication Critical patent/CN111563364B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The embodiment of the invention provides a chapter title style conversion method and device, electronic equipment and a storage medium. The method comprises the following steps: when a new paragraph is detected in the document, calling a chapter and title feature library to perform feature matching on the paragraph; wherein, the chapter title feature library records: the mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics; the chapter title style is a style preset in the document editing software; when the content matched with the chapter title characteristics in the chapter title characteristic library exists in the paragraph, converting the chapter title styles of the paragraph by using the chapter title styles corresponding to the matched chapter title characteristics to obtain a target chapter title; and calling a multi-level list function to generate chapter numbers for the target chapter titles. Therefore, the style of the chapter titles can be converted in real time in the process of editing the document by the user, so that the standard chapter titles can be quickly converted, and the document editing efficiency of the user is improved.

Description

Chapter title style conversion method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of document processing technologies, and in particular, to a method and an apparatus for converting chapter title styles, an electronic device, and a storage medium.
Background
At present, users often input chapter titles of styles such as "first chapter, word processing summary", "second chapter, document edition", and "third chapter, document layout" into a document. However, the document editing software cannot automatically generate a document directory from these chapter titles, that is, the chapter titles are irregular chapter titles.
The document editing software can automatically code the number of the second chapter after the user inputs the chapter title of the first chapter and presses the enter key, so that the user can mistakenly assume that the chapter title made by the user is the standard chapter title without learning the making method of the standard chapter title. This results in a large amount of time for the user to subsequently change the style of the chapter title one by one to adjust the chapter title to a canonical chapter title that can generate a document catalog.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for converting chapter titles and styles, an electronic device, and a storage medium, so as to quickly convert the styles of chapter titles, thereby improving efficiency of a user in editing a document. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a chapter title style conversion method, which is applied to an electronic device, and the method may include:
when a new paragraph is detected in the document, calling a chapter and title feature library to perform feature matching on the paragraph; wherein, the chapter title feature library records: the mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics; the chapter title style is a style preset in the document editing software;
when the content matched with the chapter title characteristics in the chapter title characteristic library exists in the paragraph, converting the chapter title styles of the paragraph by using the chapter title styles corresponding to the matched chapter title characteristics to obtain a target chapter title;
and calling a multi-level list function to generate chapter numbers for the target chapter titles.
Optionally, before the step of calling the section title feature library to perform feature matching on the paragraph, the method may further include:
when an open instruction for the document editing software is detected, a chapter title feature library is downloaded from the server.
Optionally, when a paragraph is detected to be newly added to the document, the step of calling the section title feature library to perform feature matching on the paragraph may include:
when the position of the cursor is the position of a paragraph of a preset type, detecting whether a line feed instruction is received;
when a line feed instruction is received, determining that a paragraph is newly added in the document;
and calling a chapter header feature library to perform feature matching on the newly added paragraphs.
Optionally, when there is content in the paragraph that matches the chapter title feature in the chapter title feature library, the step of converting the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title feature may include:
when the content matched with the chapter and title characteristics in the chapter and title characteristic library exists in the paragraph, judging whether the chapter and title style of the paragraph is a preset style in the document editing software;
and when the chapter title style of the paragraph is not the preset style in the document editing software, converting the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title characteristic.
Optionally, before the step of calling the multi-level list function and generating the chapter number for the target chapter title, the method may further include:
and when the target chapter number meeting the preset numbering rule exists in the target chapter title, deleting the target chapter number.
In a second aspect, an embodiment of the present invention further provides a chapter title style conversion apparatus, which is applied to an electronic device, and the apparatus may include:
the matching module is used for calling the chapter and title feature library to perform feature matching on the paragraphs when a new paragraph is detected in the document; wherein, the chapter title feature library records: the mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics; the chapter title style is a style preset in the document editing software;
the conversion module is used for converting the chapter title styles of the paragraphs by using the chapter title styles corresponding to the matched chapter title characteristics to obtain target chapter titles when the contents matched with the chapter title characteristics in the chapter title characteristic library exist in the paragraphs;
and the generation module is used for calling a multi-level list function and generating chapter numbers for the target chapter titles.
Optionally, in an embodiment of the present invention, the apparatus may further include:
and the downloading module is used for downloading the chapter and title feature library from the server when an opening instruction for the document editing software is detected before calling the chapter and title feature library to perform feature matching on the paragraphs.
Optionally, in an embodiment of the present invention, the matching module may include:
the detection unit is used for detecting whether a line feed instruction is received or not when the position of the cursor is the position of a paragraph of a preset type;
the determining unit is used for determining that a paragraph is newly added in the document when the line feed instruction is received;
and the matching unit is used for calling the chapter title feature library to perform feature matching on the newly added paragraphs.
Optionally, in an embodiment of the present invention, the conversion module may include:
the judging unit is used for judging whether the chapter title style of the paragraph is a preset style in the document editing software or not when the content matched with the chapter title characteristics in the chapter title characteristic library exists in the paragraph;
and the conversion unit is used for converting the chapter title styles of the paragraphs by using the chapter title styles corresponding to the matched chapter title characteristics when the chapter title styles of the paragraphs are not preset styles in the document editing software.
Optionally, in an embodiment of the present invention, the apparatus may further include:
and the deleting module is used for deleting the target chapter number when the target chapter number meeting the preset number rule exists in the target chapter title before the generation of the chapter number for the target chapter title.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the method steps of the chapter header style conversion method when the program stored in the memory is executed.
In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, where a computer program is stored in the readable storage medium, and the computer program, when executed by a processor of an electronic device, implements the method steps of any one of the chapter header style conversion methods described above.
In a fifth aspect, an embodiment of the present invention further provides a computer program product, which when run on an electronic device, causes the electronic device to perform: method steps of any of the above chapter header style conversion methods.
In the embodiment of the invention, when the electronic device detects that a paragraph is newly added in a document, the electronic device can call a chapter and title feature library to perform feature matching on the paragraph. Wherein, the chapter title feature library records: and mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics, wherein the chapter title styles are preset styles in the document editing software. When the content matched with the chapter title features in the chapter title feature library exists in the paragraph, the electronic device may convert the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title features, so as to obtain the target chapter title. The electronic device can then invoke a multi-level listing function to generate a chapter number for the target chapter title. Therefore, the style of the chapter titles can be converted in real time in the process of editing the document by the user, so that the standard chapter titles can be quickly converted, and the document editing efficiency of the user is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a chapter title style conversion method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a chapter title style conversion apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problems in the prior art, embodiments of the present invention provide a chapter title style conversion method, an apparatus, an electronic device, and a readable storage medium.
The following first describes a chapter title style conversion method provided by an embodiment of the present invention.
The chapter title style conversion method provided by the embodiment of the invention is applied to electronic equipment, and the electronic equipment can be provided with document editing software, so that a user can edit a document through the document editing software. The electronic devices in the embodiments of the present invention include, but are not limited to, computers and smart phones.
Referring to fig. 1, the chapter title style conversion method provided by the embodiment of the present invention may include the following steps:
s101: when a new paragraph is detected in the document, calling a chapter and title feature library to perform feature matching on the paragraph; wherein, the chapter title feature library records: the mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics; the chapter title style is a style preset in the document editing software;
the chapter title feature library may be a feature library stored in the document editing software in advance. Of course, the feature library may be downloaded from the server by the electronic device when the user opens the document editing software, that is, when the electronic device detects an open instruction for the document editing software. This is all reasonable.
For example, the server may learn the section title features corresponding to the student graduation papers and the section title styles corresponding to the section title features according to a machine learning algorithm and a large number of student graduation paper samples. The section title feature corresponding to the company document and the section title style corresponding to the section title feature may also be learned according to a machine learning algorithm and a large number of company document samples, which is not limited to this.
The chapter heading features may include: format features and/or character features, although not limited thereto. For example, one chapter title feature that may be learned may be: the format is "blue font" and includes characters "chapter i,", and the chapter title style corresponding to the chapter title feature is "title 1". Wherein denotes a wildcard character.
After learning the chapter title features and the chapter title styles corresponding to the chapter title features, the server may establish a chapter title feature library in which mapping relationships between the chapter title features and the chapter title styles are stored. And, after receiving the download instruction sent by the electronic device, the server may send the chapter title feature library to the electronic device.
Wherein, the title style of the chapter is a preset style in the document editing software. It is understood that the chapter titles, which are the titles of the preset styles in the document editing software, are canonical chapter titles and can be used to automatically generate the document catalog.
In addition, it can be understood that, when the electronic device detects that a new paragraph is added to the document, in order to avoid a situation that a large amount of time is required to change the chapter title style subsequently due to the fact that the added paragraph is an irregular chapter title, the electronic device may call the chapter title feature library to perform feature matching on the newly added paragraph, so as to detect whether the paragraph has features in the chapter title feature library. If yes, step S102 is triggered. If not, it indicates that the paragraph is not a chapter title, and step S102 need not be triggered.
The electronic device may determine whether a paragraph is newly added to the document by: the electronic equipment monitors whether a user inputs content into the document through the keyboard, and if so, the position of the cursor can be continuously judged whether to be located at the position of the paragraph of the preset type. When the position of the cursor is located at the position of the paragraph of the preset type, the electronic device may detect whether a line feed instruction (e.g., an enter instruction) is received. When a line feed instruction is received, it may be determined that a paragraph is newly added to the document. The paragraph of the preset type refers to a paragraph with a preset class name, such as a conventional text paragraph.
S102: when the content matched with the chapter title characteristics in the chapter title characteristic library exists in the paragraph, converting the chapter title styles of the paragraph by using the chapter title styles corresponding to the matched chapter title characteristics to obtain a target chapter title;
it is to be understood that when there is content in the paragraph that matches the chapter title feature in the chapter title feature library, the electronic device may further determine whether the chapter title style of the paragraph is a preset style in the document editing software. When the chapter title style of the paragraph is not the preset style in the document editing software, the chapter title at the moment is indicated to be an irregular chapter title, and the chapter title style of the paragraph can be converted by using the chapter title style corresponding to the matched chapter title characteristic at the moment.
When the chapter header style of the paragraph is a preset style in the document editing software, it indicates that the chapter header at this time is a canonical chapter header, and the execution may be abandoned: and converting the chapter title styles of the paragraphs by using the chapter title styles corresponding to the matched chapter title characteristics.
S103: and calling a multi-level list function to generate chapter numbers for the target chapter titles.
After obtaining the target chapter title in the document, the electronic device may detect whether a target chapter number meeting a preset number rule exists in the target chapter title. Wherein, the preset numbering rule may include: the number manually entered by the user. Such as the first chapter of user input, etc. When there is a target chapter number that satisfies the preset numbering rule, the electronic device may delete the target chapter number in the target chapter title. And numbering the target chapter titles after the target chapter numbers are deleted. Further, the document catalog may be generated using the chapter titles of the specification. Therefore, the style of the chapter titles can be converted in real time in the process of editing the document by the user, so that the standard chapter titles can be quickly converted, and the document editing efficiency of the user is improved.
For example, when the user manually enters "chapter x, XXX" and presses back the vehicle, the electronic device may detect that there is content in the paragraph that matches the chapter title features in the chapter title feature library. Wherein, the title content is input by the XXX user. The electronic device may then automatically apply a one-level title style (i.e., "title 1" style) to the paragraph, may delete the chapter title number "chapter i" manually entered by the user, and may also invoke the multi-level listing function to generate the chapter number for the title content "XXX".
In the embodiment of the invention, when the electronic device detects that a paragraph is newly added in a document, the electronic device can call a chapter and title feature library to perform feature matching on the paragraph. Wherein, the chapter title feature library records: and mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics, wherein the chapter title styles are preset styles in the document editing software. When the content matched with the chapter title features in the chapter title feature library exists in the paragraph, the electronic device may convert the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title features, so as to obtain the target chapter title. The electronic device can then invoke a multi-level listing function to generate a chapter number for the target chapter title. Therefore, the style of the chapter titles can be converted in real time in the process of editing the document by the user, so that the standard chapter titles can be quickly converted, and the document editing efficiency of the user is improved.
In summary, the chapter header style conversion scheme provided by the embodiment of the invention can convert the style of the chapter header in real time in the process of editing the document by the user, so that the standard chapter header can be quickly converted, and the document editing efficiency of the user is improved.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a chapter title style conversion apparatus, applied to an electronic device, and referring to fig. 2, the apparatus may include:
the matching module 201 is configured to, when a new paragraph is detected in the document, invoke a chapter header feature library to perform feature matching on the paragraph; wherein, the chapter title feature library records: the mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics; the chapter title style is a style preset in the document editing software;
the conversion module 202 is configured to, when there is content in the paragraph that matches the chapter title features in the chapter title feature library, convert the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title features to obtain a target chapter title;
the generating module 203 is used for calling a multi-level list function and generating chapter numbers for the target chapter titles.
By applying the device provided by the embodiment of the invention, when the electronic equipment detects that a paragraph is newly added in the document, the electronic equipment can call the chapter and title feature library to perform feature matching on the paragraph. Wherein, the chapter title feature library records: and mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics, wherein the chapter title styles are preset styles in the document editing software. When the content matched with the chapter title features in the chapter title feature library exists in the paragraph, the electronic device may convert the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title features, so as to obtain the target chapter title. The electronic device can then invoke a multi-level listing function to generate a chapter number for the target chapter title. Therefore, the style of the chapter titles can be converted in real time in the process of editing the document by the user, so that the standard chapter titles can be quickly converted, and the document editing efficiency of the user is improved.
Optionally, in an embodiment of the present invention, the apparatus may further include:
and the downloading module is used for downloading the chapter and title feature library from the server when an opening instruction for the document editing software is detected before calling the chapter and title feature library to perform feature matching on the paragraphs.
Optionally, in an embodiment of the present invention, the matching module 201 may include:
the detection unit is used for detecting whether a line feed instruction is received or not when the position of the cursor is the position of a paragraph of a preset type;
the determining unit is used for determining that a paragraph is newly added in the document when the line feed instruction is received;
and the matching unit is used for calling the chapter title feature library to perform feature matching on the newly added paragraphs.
Optionally, in an embodiment of the present invention, the conversion module 202 may include:
the judging unit is used for judging whether the chapter title style of the paragraph is a preset style in the document editing software or not when the content matched with the chapter title characteristics in the chapter title characteristic library exists in the paragraph;
and the conversion unit is used for converting the chapter title styles of the paragraphs by using the chapter title styles corresponding to the matched chapter title characteristics when the chapter title styles of the paragraphs are not preset styles in the document editing software.
Optionally, in an embodiment of the present invention, the apparatus may further include:
and the deleting module is used for deleting the target chapter number when the target chapter number meeting the preset number rule exists in the target chapter title before the generation of the chapter number for the target chapter title.
Corresponding to the above method embodiment, an embodiment of the present invention further provides an electronic device, referring to fig. 3, the electronic device includes a processor 301, a communication interface 302, a memory 303, and a communication bus 304, where the processor 301, the communication interface 302, and the memory 303 complete communication with each other through the communication bus 304;
a memory 303 for storing a computer program;
the processor 301 is configured to implement the method steps provided in any one of the above embodiments of the chapter header style conversion method when executing the program stored in the memory.
In the embodiment of the invention, when the electronic device detects that a paragraph is newly added in a document, the electronic device can call a chapter and title feature library to perform feature matching on the paragraph. Wherein, the chapter title feature library records: and mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics, wherein the chapter title styles are preset styles in the document editing software. When the content matched with the chapter title features in the chapter title feature library exists in the paragraph, the electronic device may convert the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title features, so as to obtain the target chapter title. The electronic device can then invoke a multi-level listing function to generate a chapter number for the target chapter title. Therefore, the style of the chapter titles can be converted in real time in the process of editing the document by the user, so that the standard chapter titles can be quickly converted, and the document editing efficiency of the user is improved.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a readable storage medium, where a computer program is stored in the readable storage medium, and the computer program, when executed by a processor of an electronic device, implements the method steps provided in any of the above chapter title style conversion method embodiments.
After the computer program stored in the readable storage medium provided by the embodiment of the present invention is executed by the processor of the electronic device, when the electronic device detects that a paragraph is newly added to a document, the electronic device may call the chapter and title feature library to perform feature matching on the paragraph. Wherein, the chapter title feature library records: and mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics, wherein the chapter title styles are preset styles in the document editing software. When the content matched with the chapter title features in the chapter title feature library exists in the paragraph, the electronic device may convert the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title features, so as to obtain the target chapter title. The electronic device can then invoke a multi-level listing function to generate a chapter number for the target chapter title. Therefore, the style of the chapter titles can be converted in real time in the process of editing the document by the user, so that the standard chapter titles can be quickly converted, and the document editing efficiency of the user is improved.
Corresponding to the above method embodiments, the present invention further provides a computer program product containing instructions, which when run on an electronic device, causes the electronic device to perform the method steps of any one of the chapter, title, style conversion method embodiments in the above embodiments.
After the computer program provided by the embodiment of the invention is executed by the processor of the electronic device, when the electronic device detects that a paragraph is newly added in a document, the electronic device can call the chapter and title feature library to perform feature matching on the paragraph. Wherein, the chapter title feature library records: and mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics, wherein the chapter title styles are preset styles in the document editing software. When the content matched with the chapter title features in the chapter title feature library exists in the paragraph, the electronic device may convert the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title features, so as to obtain the target chapter title. The electronic device can then invoke a multi-level listing function to generate a chapter number for the target chapter title. Therefore, the style of the chapter titles can be converted in real time in the process of editing the document by the user, so that the standard chapter titles can be quickly converted, and the document editing 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 may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus, the electronic device and the readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some parts of the description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A chapter title style conversion method is applied to an electronic device and comprises the following steps:
when a new paragraph is detected in the document, calling a chapter and title feature library to perform feature matching on the paragraph; wherein, the chapter title feature library records: the mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics; the chapter title style is a style preset in document editing software;
when the paragraph has the content matched with the chapter title characteristics in the chapter title characteristic library, converting the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title characteristics to obtain a target chapter title;
and calling a multi-level list function to generate chapter numbers for the target chapter titles.
2. The method of claim 1, further comprising, prior to the step of calling a chapter header feature library to feature match the paragraph:
downloading the chapter title feature library from a server when an open instruction for the document editing software is detected.
3. The method according to claim 1, wherein the step of calling the section title feature library to perform feature matching on the paragraph when detecting that a paragraph is newly added to the document comprises:
when the position of the cursor is the position of a paragraph of a preset type, detecting whether a line feed instruction is received;
when a line feed instruction is received, determining that a paragraph is newly added in the document;
and calling a chapter header feature library to perform feature matching on the newly added paragraphs.
4. The method according to claim 1, wherein when there is content in the paragraph that matches the chapter title feature in the chapter title feature library, the step of converting the chapter title style of the paragraph by using the chapter title style corresponding to the matched chapter title feature comprises:
when the paragraph has the content matched with the chapter and title characteristics in the chapter and title characteristic library, judging whether the chapter and title style of the paragraph is a preset style in the document editing software;
and when the chapter header style of the paragraph is not the preset style in the document editing software, converting the chapter header style of the paragraph by using the chapter header style corresponding to the matched chapter header characteristic.
5. The method of any of claims 1-4, further comprising, prior to the step of invoking a multilevel list function to generate a chapter number for the target chapter title,:
and when the target chapter number meeting a preset number rule exists in the target chapter title, deleting the target chapter number.
6. A chapter title style conversion device is applied to an electronic device, and comprises the following components:
the matching module is used for calling the chapter and title feature library to perform feature matching on a paragraph when a new paragraph is detected in the document; wherein, the chapter title feature library records: the mapping relation between the chapter title characteristics and the chapter title styles corresponding to the chapter title characteristics; the chapter title style is a style preset in document editing software;
the conversion module is used for converting the chapter title styles of the paragraphs by using the chapter title styles corresponding to the matched chapter title characteristics to obtain target chapter titles when the contents matched with the chapter title characteristics in the chapter title characteristic library exist in the paragraphs;
and the generation module is used for calling a multi-level list function and generating chapter numbers for the target chapter titles.
7. The apparatus of claim 6, further comprising:
and the downloading module is used for downloading the chapter and title feature library from a server when an opening instruction for the document editing software is detected before calling the chapter and title feature library to perform feature matching on the paragraph.
8. The apparatus of claim 6, wherein the matching module comprises:
the detection unit is used for detecting whether a line feed instruction is received or not when the position of the cursor is the position of a paragraph of a preset type;
the determining unit is used for determining that a paragraph is newly added in the document when a line feed instruction is received;
and the matching unit is used for calling the chapter title feature library to perform feature matching on the newly added paragraphs.
9. The apparatus of claim 6, wherein the conversion module comprises:
a judging unit, configured to judge whether a chapter title style of the paragraph is a preset style in the document editing software when there is content in the paragraph that matches the chapter title features in the chapter title feature library;
and the conversion unit is used for converting the chapter header style of the paragraph by using the chapter header style corresponding to the matched chapter header characteristic when the chapter header style of the paragraph is not the preset style in the document editing software.
10. The apparatus according to any one of claims 6-9, further comprising:
and the deleting module is used for deleting the target chapter number when the target chapter number meeting a preset number rule exists in the target chapter title before the target chapter title is generated with the chapter number.
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 readable storage medium, characterized in that the readable storage medium is a readable storage medium in an electronic device, in which a computer program is stored, which computer program, when being executed by a processor of the electronic device, realizes the method steps of any one of claims 1-5.
CN201910114409.9A 2019-02-14 2019-02-14 Chapter title style conversion method and device, electronic equipment and storage medium Active CN111563364B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910114409.9A CN111563364B (en) 2019-02-14 2019-02-14 Chapter title style conversion method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910114409.9A CN111563364B (en) 2019-02-14 2019-02-14 Chapter title style conversion method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111563364A true CN111563364A (en) 2020-08-21
CN111563364B CN111563364B (en) 2023-12-22

Family

ID=72074132

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910114409.9A Active CN111563364B (en) 2019-02-14 2019-02-14 Chapter title style conversion method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111563364B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024001434A1 (en) * 2022-06-27 2024-01-04 北京字跳网络技术有限公司 Information processing method and device, terminal, and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326194A (en) * 2015-07-06 2017-01-11 北大方正集团有限公司 Directory generation method and apparatus applied to file format conversion scene
CN106708795A (en) * 2016-12-18 2017-05-24 杨昕 Method and device for setting title formats in batch

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326194A (en) * 2015-07-06 2017-01-11 北大方正集团有限公司 Directory generation method and apparatus applied to file format conversion scene
CN106708795A (en) * 2016-12-18 2017-05-24 杨昕 Method and device for setting title formats in batch

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李艳芳等: "Word 样式的应用和管理研究" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024001434A1 (en) * 2022-06-27 2024-01-04 北京字跳网络技术有限公司 Information processing method and device, terminal, and storage medium

Also Published As

Publication number Publication date
CN111563364B (en) 2023-12-22

Similar Documents

Publication Publication Date Title
CN111638873A (en) Program code generation method and device, computer equipment and storage medium
CN111444750A (en) PDF document identification method and device and electronic equipment
CN111563364A (en) Chapter title style conversion method and device, electronic equipment and storage medium
CN111553130A (en) Chapter title style conversion method and device, electronic equipment and storage medium
CN110442353B (en) Installation package management method and device and electronic equipment
CN112000257A (en) Method and device for exporting key contents of document
CN113627129B (en) Text copying method and device, electronic equipment and readable storage medium
CN110633457A (en) Content replacement method and device, electronic equipment and readable storage medium
CN111695327B (en) Method and device for repairing messy codes, electronic equipment and readable storage medium
CN114356330A (en) Page configuration method and device, electronic equipment and storage medium
CN110309103B (en) Document opening method and device, electronic equipment and readable storage medium
US9397993B1 (en) System and method for accessing modular applications
CN111181836B (en) Message pushing method and device
CN112784564B (en) Document generation method and device
CN110851346B (en) Query statement boundary problem detection method, device, equipment and storage medium
CN108984503B (en) Fool-proof method and system for page input box and related components
CN111444451B (en) Document acquisition method and device, electronic equipment and readable storage medium
CN112784527A (en) Document merging method and device and electronic equipment
CN112035596A (en) Text submission method, device, equipment and storage medium
CN111460760A (en) PDF document editing method and device
CN111949184A (en) Method and device for creating new document
CN112784542B (en) Document editing method and device
CN110929048A (en) Bookmark generation method and device, electronic equipment and storage medium
CN110889066A (en) Method and device for opening webpage in client software and electronic equipment
CN111522627B (en) Docker mirror image management method, device, equipment and medium

Legal Events

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