CN114742019A - Document processing method and device - Google Patents

Document processing method and device Download PDF

Info

Publication number
CN114742019A
CN114742019A CN202210314358.6A CN202210314358A CN114742019A CN 114742019 A CN114742019 A CN 114742019A CN 202210314358 A CN202210314358 A CN 202210314358A CN 114742019 A CN114742019 A CN 114742019A
Authority
CN
China
Prior art keywords
directory entry
target
directory
document
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210314358.6A
Other languages
Chinese (zh)
Inventor
符镇源
曾元概
唐思远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Wuhan Kingsoft Office Software Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Wuhan 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, Wuhan Kingsoft Office Software Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN202210314358.6A priority Critical patent/CN114742019A/en
Publication of CN114742019A publication Critical patent/CN114742019A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/189Automatic justification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The specification provides a document processing method and a document processing device, wherein the method comprises the following steps: responding to the moving operation of a first directory entry in a directory of a document to be processed, and determining the target position of the first directory entry in the directory; wherein the target position is the position of the moved first directory entry in the directory; the catalog of the document to be processed corresponds to a title in a body of the document to be processed; determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed; determining a target moving position of the target text area according to the target position of the first directory entry; and moving the target text area according to the target moving position to realize automatic typesetting of the document, so that the efficiency of document typesetting can be effectively improved, and the user experience is high.

Description

Document processing method and device
Technical Field
The present disclosure relates to the field of electronic devices, and in particular, to a method and an apparatus for processing a document.
Background
During work learning, users often edit documents. In the process of editing a document, the document needs to be typeset.
At present, when a document is typeset, a user generally typesets manually, for example, when a text portion corresponding to a certain title needs to be moved to the end of the document, the user selects the text portion corresponding to the title, cuts the text portion, and pastes the text portion to the end of the document.
However, since the document needs to be manually typeset, when the document content is large, the time required for typesetting is long, and thus the document typesetting efficiency is low.
Disclosure of Invention
To overcome the problems in the related art, the present specification provides a document processing method and apparatus.
According to a first aspect of embodiments herein, there is provided a document processing method, the method comprising:
responding to the moving operation of a first directory entry in a directory of a document to be processed, and determining the target position of the first directory entry in the directory; wherein the target position is the position of the moved first directory entry in the directory; the catalog of the document to be processed corresponds to a title in a body of the document to be processed;
determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed;
determining a target moving position of the target text area according to the target position of the first directory entry;
and moving the target text area according to the target moving position.
Optionally, the determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed includes:
determining the starting position of the target text area according to the starting position of the first title in the text of the document to be processed;
determining a second directory entry according to the first directory entry; wherein the second directory entry is a directory entry next to the first directory entry in the directory of the document to be processed displayed before the moving;
and determining the end position of the target text area according to the starting position of the title corresponding to the second directory entry in the text of the document to be processed.
Optionally, the determining a second directory entry according to the first directory entry includes:
acquiring the display state of the first directory entry; wherein the display status of the first directory entry indicates a collapsed condition of the first directory entry;
and determining a second directory entry corresponding to the first directory entry according to the display state of the first directory entry.
Optionally, the determining, according to the display state of the first directory entry, a second directory entry corresponding to the first directory entry includes:
taking a next directory entry of a last directory entry in the first directory entries as the second directory entry when the display state of the first directory entry is a folded state;
and when the display state of the first directory entry is an unfolded state, taking the next directory entry of the first directory entry as the second directory entry.
Optionally, the determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed includes:
determining the starting position of the target text area according to the starting position of the first title in the text of the document to be processed;
and under the condition that the first directory entry before moving does not have the next directory entry, acquiring the end position of the text of the document to be processed, and determining the end position of the target text area according to the end position of the text.
Optionally, the determining the target moving position of the target text area according to the target position of the first directory entry includes:
acquiring a next directory entry of the target position of the first directory entry;
and determining the target moving position according to the starting position of the title corresponding to the next directory entry of the target position in the text of the document to be processed.
Optionally, the determining the target moving position of the target text area according to the target position of the first directory entry includes:
under the condition that the next directory entry does not exist in the target position, acquiring the end position of the text of the document to be processed;
and determining the target moving position according to the ending position of the text of the document to be processed.
Optionally, the determining the target moving position of the target text area according to the target position of the first directory entry includes:
acquiring a previous directory entry of the target position of the first directory entry;
acquiring the display state of the last directory entry of the target position; wherein the display status of the last directory entry of the target location indicates a folding condition of the last directory entry of the target location;
determining a third directory entry according to the display state of the last directory entry of the target position; wherein the third directory entry is a directory entry next to a directory entry previous to the target location displayed before the move;
and determining the target moving position according to the starting position of the title corresponding to the third directory entry in the body of the document to be processed.
Optionally, the determining the target moving position of the target text area according to the target position of the first directory entry includes:
and under the condition that the last directory entry does not exist in the target position, acquiring the initial position of the text of the document to be processed, and taking the initial position of the text of the document to be processed as the target moving position.
Optionally, the method further includes:
responding to the moving operation of a first directory entry in the directory of the document to be processed, and determining a hierarchy corresponding to the moved first directory entry;
and updating the hierarchies of all the titles in the target text area corresponding to the first directory entry according to the hierarchy corresponding to the moved first directory entry.
Optionally, the determining a hierarchy corresponding to the moved first directory entry includes:
acquiring an indentation value of the moved first directory entry;
and determining the corresponding hierarchy of the moved first directory entry according to the indentation value of the moved first directory entry.
Optionally, the determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed includes:
determining whether the target position of the first directory entry is a preset effective position; the preset effective position comprises one or more of the last position of the first directory entry in the directory of the document to be processed, the position between two adjacent directory entries in the directory of the document to be processed and the next position of the last directory entry in the directory of the document to be processed;
and if the target text area is the preset effective position, determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed.
According to a second aspect of embodiments of the present specification, there is provided a document processing apparatus including:
the system comprises a catalog moving module, a first storage module and a second storage module, wherein the catalog moving module is used for responding to the moving operation of a first catalog item in a catalog of a document to be processed and determining the target position of the first catalog item in the catalog; wherein the target position is the position of the moved first directory entry in the directory; the catalog of the document to be processed corresponds to a title in a body of the document to be processed;
the text determining module is used for determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed;
the position determining module is used for determining a target moving position of the target text area according to the target position of the first directory entry;
and the text moving module is used for moving the target text area according to the target moving position.
Optionally, the text determining module is specifically configured to:
determining the starting position of the target text area according to the starting position of the first title in the text of the document to be processed;
determining a second directory entry according to the first directory entry; wherein the second directory entry is a directory entry next to the first directory entry in the directory of the document to be processed displayed before the moving;
and determining the end position of the target text area according to the starting position of the title corresponding to the second directory entry in the text of the document to be processed.
Optionally, the text determining module is further configured to:
acquiring the display state of the first directory entry; wherein the display status of the first directory entry indicates a collapse condition of the first directory entry;
and determining a second directory entry corresponding to the first directory entry according to the display state of the first directory entry.
Optionally, the text determining module is further configured to:
taking a next directory entry of a last directory entry in the first directory entries as the second directory entry when the display state of the first directory entry is a folded state;
and when the display state of the first directory entry is an unfolded state, taking the next directory entry of the first directory entry as the second directory entry.
Optionally, the text determining module is further configured to:
determining the starting position of the target text area according to the starting position of the first title in the text of the document to be processed;
and under the condition that the first directory entry before moving does not have the next directory entry, acquiring the end position of the text of the document to be processed, and determining the end position of the target text area according to the end position of the text.
Optionally, the position determining module is specifically configured to:
acquiring a next directory entry of the target position of the first directory entry;
and determining the target moving position according to the starting position of the title corresponding to the next directory entry of the target position in the text of the document to be processed.
Optionally, the position determining module is further configured to:
under the condition that the next directory entry does not exist in the target position, acquiring the end position of the text of the document to be processed;
and determining the target moving position according to the ending position of the text of the document to be processed.
Optionally, the position determining module is further configured to:
acquiring a previous directory entry of the target position of the first directory entry;
acquiring the display state of the last directory entry of the target position; the display state of the last directory entry of the target position indicates the folding condition of the last directory entry of the target position;
determining a third directory entry according to the display state of the last directory entry in the target position; wherein the third directory entry is a directory entry next to a directory entry previous to the target location displayed before the move;
and determining the target moving position according to the starting position of the title corresponding to the third directory entry in the body of the document to be processed.
Optionally, the position determining module is specifically configured to:
and under the condition that the target position does not have the last directory entry, acquiring the initial position of the text of the document to be processed, and taking the initial position of the text of the document to be processed as the target moving position.
Optionally, the document processing apparatus further includes a hierarchy updating module;
the hierarchy update module is to:
responding to the moving operation of a first directory entry in the directory of the document to be processed, and determining a hierarchy corresponding to the moved first directory entry;
and updating the hierarchies of all the titles in the target text area corresponding to the first directory entry according to the hierarchy corresponding to the moved first directory entry.
Optionally, the hierarchy updating module is specifically configured to:
acquiring an indentation value of the moved first directory entry;
and determining the corresponding hierarchy of the moved first directory entry according to the indentation value of the moved first directory entry.
Optionally, the text determining module is further configured to:
determining whether the target position of the first directory entry is a preset effective position; the preset effective position comprises one or more of the last position of the first directory entry in the directory of the document to be processed, the position between two adjacent directory entries in the directory of the document to be processed and the next position of the last directory entry in the directory of the document to be processed;
and if the target text area is the preset effective position, determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed.
According to a third aspect of embodiments herein, there is provided an electronic apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
responding to the moving operation of a first directory entry in a directory of a document to be processed, and determining the target position of the first directory entry in the directory; wherein the target position is the position of the moved first directory entry in the directory; the catalog of the document to be processed corresponds to a title in a body of the document to be processed;
determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed;
determining a target moving position of the target text area according to the target position of the first directory entry;
and moving the target text area according to the target moving position.
According to a fourth aspect of embodiments herein, there is provided a computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a processor, implement a document processing method as set forth in the first aspect and various possible designs of the first aspect.
According to a fifth aspect of embodiments herein, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a document processing method as set forth above in the first aspect and in various possible designs of the first aspect.
The technical scheme provided by the embodiment of the specification can have the following beneficial effects:
in this embodiment of the present description, when a moving operation of a first directory entry in a directory of a document to be processed is received, it indicates that the document to be processed needs to be typeset, that is, it indicates that a text portion corresponding to a first title corresponding to the first directory entry needs to be moved, and then a position of the first directory entry after the moving operation in the directory is obtained, so as to obtain a target position of the first directory entry. And determining a target text area corresponding to a first title corresponding to the first directory entry from the text of the document to be processed, so as to realize automatic and accurate determination of the text part needing to be moved. And determining a target moving position of the target text area based on the target position of the first directory entry to move the target text area to the target moving position, so that the position of the moved target text area in the text of the document to be processed is matched with the position of the moved first directory entry in the directory of the document to be processed, and the text part to be moved is automatically and accurately moved, so that the automatic typesetting of the document is realized, the time required by typesetting is reduced, the document typesetting efficiency can be effectively improved, and the user experience is high.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the specification.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present specification and together with the description, serve to explain the principles of the specification.
FIG. 1 is a flow diagram of a document processing method shown in the present specification according to an exemplary embodiment.
FIG. 2 is a schematic diagram of a body and directory illustrating a method according to an exemplary embodiment of the present description.
FIG. 3 is a flow diagram illustrating another document processing method according to an exemplary embodiment of the present description.
Fig. 4 is a schematic diagram illustrating a starting position of a title shown in accordance with an exemplary embodiment.
FIG. 5 is a schematic diagram of a text region shown in the present specification according to an example embodiment.
FIG. 6 is a schematic diagram illustrating a collapsing directory entry according to an example embodiment.
FIG. 7 is a schematic diagram of another body and directory shown in the present description according to an exemplary embodiment.
Fig. 8 is a hardware structure diagram of an electronic device in which a document processing apparatus according to an embodiment of the present disclosure is located.
FIG. 9 is a block diagram of a document processing device shown in the present specification according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with this description. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The following provides a detailed description of examples of the present specification.
As shown in FIG. 1, FIG. 1 is a flowchart of a document processing method shown in the present specification according to an exemplary embodiment, including the steps of:
step 101, responding to the moving operation of a first directory entry in a directory of a document to be processed, and determining the target position of the first directory entry in the directory. The target position is the position of the moved first directory entry in the directory, and the directory of the document to be processed corresponds to the title in the text of the document to be processed.
In this embodiment, when a moving operation of a first directory entry in a directory of a document to be processed is received, that is, it indicates that a user has moved the first directory entry, that is, it indicates that a text portion corresponding to a title (that is, a first title) corresponding to the first directory entry needs to be linked, a position of the moved first directory entry in the directory of the document to be processed is determined, and the position is used as a target position of the first directory entry, so that the text portion corresponding to the first title is correspondingly moved by using the target position of the first directory entry, and accordingly, the layout of the document to be processed is achieved.
The document to be processed comprises a catalogue and a text. The catalog of the document to be processed indicates a catalog outline having a hierarchical structure generated based on titles of respective levels in the body of the document to be processed. The catalog of the document to be processed corresponds to the title in the text of the document to be processed, that is, the catalog entries in the catalog of the document to be processed correspond to the titles in the text of the document to be processed one by one, that is, each title corresponds to one catalog entry. For example, the directory shown in (b) in fig. 2 is generated based on the respective titles in the body text shown in (a) in fig. 2, and each title corresponds to one directory entry in the directory.
Optionally, the moving operation includes a moving up and down operation, that is, the first directory entry may be moved up or down in the directory. The first directory entry is any one of the directory entries in the directory.
Optionally, the catalog of the document to be processed may be automatically generated according to the title in the body of the document to be processed, or may be manually added and generated by the relevant person according to the title in the body.
In an embodiment, a title in a body text is a part of the text in the body text, and in order to distinguish from non-title text, a preset label may be used to mark the part of the text as the title in the body text, where the label may be used to determine the part of the text as the title, and may also determine a hierarchy of the title.
For example, a segment of text is labeled with "#" to indicate a primary title, a segment of text is labeled with "# #" to indicate a secondary title, and so on.
For another example, a segment of text is labeled "H1" to indicate a primary title, a segment of text is labeled "H2" to indicate a secondary title, and so on.
It should be noted that the label may not be displayed during the text display process.
Further, in this embodiment, the tag stored in the text may be read; determining a title in the text and the hierarchy of the title according to the label; thereby automatically generating a directory according to the determined title and its hierarchy.
And 102, determining a target text area corresponding to a first title corresponding to a first directory entry in the text of the document to be processed.
In this embodiment, the title corresponding to the first directory entry is used as the first title. And determining a target text area corresponding to the first title from the text of the document to be processed, wherein the target text area indicates a text part needing to be moved in the document to be processed, and the text area needing to be typeset is automatically determined.
And 103, determining the target moving position of the target text area according to the target position of the first directory entry.
And 104, moving the target text area according to the target moving position.
In this embodiment, when the position of the moved first directory entry in the directory is determined, the position to which the target text area needs to be moved is determined, that is, the target moving position of the target text area in the text of the document to be processed is determined. And mapping and moving the target text area based on the target moving position to move the target text area to the target moving position, so that the position of the moved target text area in the text is matched with the position of the moved first directory entry in the directory, thereby realizing the automatic and accurate movement of the text content and further realizing the automatic typesetting of the document.
In this embodiment, the target text area in the text of the document to be processed is moved based on the target position of the first directory entry, that is, the position of the moved first directory entry in the directory, so as to map the movement result of the directory entry to the text, so that the position of the moved target text area in the text of the document to be processed is matched with the target position of the first directory entry, that is, the arrangement positions of the moved first title in all titles of the text are consistent with the arrangement positions of the moved first directory entry in the directory, thereby realizing accurate layout of the document to be processed.
As can be seen from the above description, when the moving operation of the first directory entry in the directory of the document to be processed is received, it indicates that the first directory entry is moved, that is, it indicates that the document to be processed needs to be typeset, that is, it indicates that the text portion corresponding to the first title corresponding to the first directory entry needs to be moved, and then the position of the moved first directory entry in the directory is obtained, so as to obtain the target position of the first directory entry. And determining a target text area corresponding to the first title corresponding to the first directory entry from the text of the processed document, so as to realize automatic and accurate determination of the text part needing to be moved. The target text area is correspondingly moved based on the target position of the first directory entry, namely, the moving result of the directory entry is mapped to the text, so that the position of the moved target text area in the text of the document to be processed is matched with the position of the moved first directory entry in the directory of the document to be processed, and the text part to be moved is automatically and accurately moved, so that the automatic typesetting of the document is realized, the document is not required to be manually typeset, the time required by typesetting is reduced, the document typesetting efficiency is effectively improved, and the user experience is improved.
Fig. 3 is a flowchart of another document processing method according to an exemplary embodiment, and this embodiment describes a process of how to determine a text portion to be moved based on the foregoing embodiment, and this process will be described in detail with reference to a specific embodiment, as shown in fig. 3, and the method includes the following steps: the method comprises the following steps:
step 301, in response to a moving operation of a first directory entry in a directory of a document to be processed, determining a target position of the first directory entry in the directory. The target position is the position of the moved first directory entry in the directory, and the directory of the document to be processed corresponds to the title in the text of the document to be processed.
In this embodiment, when a user needs to insert a text portion corresponding to a certain title into another position of the text, a directory entry corresponding to the title may be selected from the directory, and the selected directory entry is the first directory entry. And moving the first directory entry to a directory location corresponding to the other location, and when the first directory entry is determined to stop moving, acquiring the location of the moved first directory entry in the directory, that is, acquiring the current location of the moved first directory entry, so as to obtain the target location of the first directory entry.
Optionally, in a case that a movement end event for the first directory item is detected, indicating that the first directory item stops moving, the event object is obtained from the movement end event to determine coordinate information (for example, a pageX coordinate value and a pageY coordinate value, where pageX and pageY may represent coordinate values in a directory) of the moved first directory item, and coordinate conversion is performed on the coordinate information of the first directory item, so as to obtain a location of the moved first directory item in the directory.
The movement end event comprises a mouseup event and/or a touchend event and the like. Wherein the mouseup event is triggered in case the mouse is released, i.e. the movement of the first directory entry using the mouse is stopped. the touch event is triggered in the event that the user stops touch moving the first directory entry.
Optionally, the target location of the first directory entry is a valid location. The valid position comprises any one of the last position of the first directory entry in the directory of the document to be processed, the position between two adjacent directory entries in the directory of the document to be processed and the next position of the last directory entry in the directory of the document to be processed.
Correspondingly, under the condition that the first directory entry stops moving, whether the current position of the moved first directory entry is a valid position or not is determined, namely whether the target position of the first directory entry is a preset valid position or not is determined. The preset effective position comprises one or more of the last position of the first directory entry in the directory of the document to be processed, the position between two adjacent directory entries in the directory of the document to be processed and the next position of the last directory entry in the directory of the document to be processed. And if the current movement is the effective movement, determining a target text area corresponding to a first title corresponding to a first directory entry in the text of the document to be processed so as to correspondingly move the target text area.
And under the condition that the target position of the first directory entry is not the preset valid position, indicating that the target position of the first directory entry is the invalid position, namely indicating that the movement is invalid, ignoring the movement operation, and not needing to continuously execute subsequent steps, such as determining a target text area needing to be moved.
Optionally, when the target location of the first directory entry is not the preset valid location, a preset invalid prompt message is displayed to notify the user that the current movement is an invalid movement, and prompt the user how to correctly move.
Step 302, determining the starting position of the target text area according to the starting position of the first title in the text of the document to be processed.
In this embodiment, after the user moves the directory entry (i.e., the first directory entry) in the directory, which indicates that the mapping movement of the partial content in the text is required, the start position and the end position of the target text area are determined. And taking a text area between the starting position and the ending position in the text of the document to be processed as a target text area, namely a text part needing to be moved.
In this embodiment, when the start position of the target text area is determined, the start position of the first title in the text of the document to be processed is obtained, and the start position of the first title is used as the start position of the target text area.
Specifically, a first title is searched from the document to be processed, and the current starting position of the first title is used as the starting position of the text area corresponding to the first title. For example, as shown in fig. 4, if the first directory entry is directory 1.1, the first title is directory 1.1, and the starting position of the first title is the position before the "destination" word in directory 1.1.
Step 303, determining a second directory entry according to the first directory entry. And the second directory entry is the next directory entry of the first directory entry in the directories of the documents to be processed displayed before the movement.
It should be noted that the directory entries in the directory may be set in a collapsed or expanded state. When the directory entry corresponding to a title is set to be in a folded state, only the directory entry corresponding to the title is displayed, and the titles of other hierarchies under the title are set to be in a hidden state, that is, other directory entries under the directory entry corresponding to the title are set to be in the hidden state.
And step 304, determining the end position of the target text area according to the starting position of the title corresponding to the second directory entry in the text of the document to be processed.
In this embodiment, when the ending position of the target text area is determined, a directory entry next to the initial position of the first directory entry in the directory of the displayed to-be-processed document is searched, that is, a directory entry after the first directory entry before the movement and adjacent to the first directory entry is searched in the directory, and the searched directory entry is used as the second directory entry. And acquiring the initial position of the title corresponding to the second directory entry in the text of the document to be processed, and taking the initial position of the title corresponding to the second directory entry as the end position of the target text area.
The initial position of the first directory entry represents the position of the first directory entry in the directory of the document to be processed before the moving operation is performed on the first directory entry.
Optionally, because the directory entries in the directory may be folded, when a directory entry is in a folded state, at least one folded directory entry exists under the directory entry (i.e., in a hidden state), that is, the folded directory entry includes at least two directory entries, in other words, the folded directory entry includes the folded directory entry itself and at least one directory entry in a hidden state. Therefore, when determining the next directory entry of the first directory entry displayed before the move operation, the next directory entry of the first directory entry before the move needs to be searched according to the folding condition of the first directory entry to determine the second directory entry. Wherein the process of determining the second directory entry comprises:
the display state of the first directory entry is obtained. Wherein the display status of the first directory entry indicates a collapsed condition of the first directory entry.
And determining a second directory entry corresponding to the first directory entry according to the display state of the first directory entry.
Specifically, the display state of the first directory entry is obtained, the next directory entry at the initial position of the first directory entry is searched from the directory based on the display state of the first directory entry, and the searched directory entry is used as the second directory entry.
The display state of the first directory entry is the initial display state of the first directory entry, that is, the folding condition of the first directory entry before the moving operation is indicated.
Optionally, since the folding state of the first directory entry is not changed by performing the moving operation on the first directory entry, the folding condition of the currently displayed first directory entry, that is, the display state of the moved first directory entry, may be obtained, and the obtained display state is used as the display state of the first directory entry before performing the moving operation.
Optionally, when the second directory entry is searched based on the display state of the first directory entry, if the display state of the first directory entry is the folded state, the next directory entry of the last directory entry in the first directory entry is used as the second directory entry. In a case where the display state of the first directory entry is an unfolded state, the next directory entry of the first directory entry is taken as the second directory entry.
Specifically, in the case where the display state of the first directory entry is the collapsed state, it indicates that the first directory entry is collapsed, which includes at least two directory entries. The next directory entry of the last directory entry included in the first directory entry before the move is taken as the second directory entry. For example, the first directory entry is directory 1.1 shown in (b) of fig. 2, and when the first directory entry is in a collapsed state (as shown in (a) of fig. 5), the first directory entry includes: directory entry 1.1, directory 1.1.1, and directory 1.1.2. If the last directory entry in the first directory entry is directory 1.1.2, the next directory entry of directory 1.1.2, i.e., directory 1.2, is used as the second directory entry. Accordingly, the body area between the start position of the directory 1.1 and the start position of the directory 1.2 is taken as the target body area (as shown in fig. 5 (b)).
Specifically, in the case where the display state of the first directory entry is the unfolded state, which indicates that the first directory entry is unfolded and does not include the folded directory entry, the actual next directory entry of the first directory entry before the move is directly used as the second directory entry. For example, if the first directory entry is directory 1.1 shown in (b) of fig. 2 and the display state of directory 1.1 is the unfolded state shown in (b) of fig. 2, the next directory entry of directory 1.1 is directory 1.1.1. Accordingly, the text area between the start position of the directory 1.1 and the start position of the directory 1.1.1 is taken as the target text area.
Optionally, in a case that the first directory entry before the movement does not have a next directory entry, that is, in a case that the second directory entry does not exist, it indicates that the first directory entry before the movement is the last directory entry in the displayed directory (e.g., directory 2.1 shown in fig. 5 (a)), the start position of the target text area is determined according to the start position of the first title in the text of the document to be processed; and acquiring the end position of the text of the document to be processed, and determining the end position of the target text area according to the end position of the text, namely directly taking the end position of the text as the end position of the target text area.
And 305, determining the target moving position of the target text area according to the target position of the first directory entry.
In this embodiment, when determining the target movement position of the target body area corresponding to the first title, the determination may be performed in the following two ways.
One way is to obtain, in a directory, the next directory entry to the target location of the first directory entry. And determining the target moving position according to the starting position of the title corresponding to the next directory entry of the target position in the text of the document to be processed.
Specifically, after the first directory entry is moved, that is, after the first directory entry is moved, it is determined whether a directory entry exists after the target location of the first directory entry, that is, it is determined whether a next directory entry exists at the target location, that is, it is determined whether a directory entry exists after the first directory entry is moved. And under the condition that the next directory entry exists in the target position, indicating that the moved first directory entry is not located at the tail position in the directory, acquiring the starting position of the title corresponding to the next directory entry in the target position in the text of the document to be processed, and taking the starting position of the title corresponding to the next directory entry in the target position as the target moving position.
And under the condition that the next directory entry does not exist in the target position, indicating that the moved first directory entry is located at the tail position in the directory, namely indicating that the target text area needs to be moved to the tail of the text, and acquiring the end position of the text of the document to be processed. And determining the target moving position according to the ending position of the text of the document to be processed.
When the target moving position corresponding to the target text area is determined according to the ending position of the text of the document to be processed, the ending position of the text can be directly used as the target moving position, and the initial position of the next line of the ending position of the text can also be used as the target moving position.
In another way, in the directory, a directory entry previous to the target location of the first directory entry is obtained. And acquiring the display state of the last directory entry of the target position. Wherein the display status of the last directory entry of the target location indicates a collapse condition of the last directory entry of the target location. And determining a third directory entry according to the display state of the last directory entry of the target position. Wherein the third directory entry is a directory entry next to a directory entry previous to the target location displayed before the move. And determining the target moving position according to the starting position of the title corresponding to the third directory entry in the text of the document to be processed.
Specifically, whether a directory entry exists before the target position of the first directory entry is judged, that is, whether a previous directory entry exists at the target position is judged, when the previous directory entry does not exist at the target position, it is indicated that the moved first directory entry is located at the starting position in the directory, the moved first directory entry is the first directory entry in the directory, that is, it is indicated that the target text area needs to be moved to the starting position of the text, the starting position of the text of the document to be processed is obtained, and the starting position of the text of the document to be processed is taken as the target moving position.
When the target position has a previous directory entry, it indicates that the moved first directory entry is not at the starting position of the directory, that is, it indicates that the first directory entry is moved to the position below the previous directory entry at the target position in the directory, that is, it indicates that the target text area needs to be moved to the position below the text area corresponding to the title of the previous directory entry, in other words, it needs to move the target text area to the starting position of the title corresponding to the next directory entry (i.e., the third directory entry) of the previous directory entry (i.e., the previous directory entry at the target position) before the first directory entry is moved, and because the folding condition of the previous directory entry at the target position affects the next directory entry of the previous directory entry at the target position to be displayed, the display state of the previous directory entry at the target position is obtained, so that the display state of the previous directory entry at the target position is used to determine before the first directory entry is inserted, the next directory entry to the previous directory entry is displayed, resulting in a third directory entry. And acquiring the starting position of the title corresponding to the third directory entry in the text of the document to be processed, and taking the starting position of the title corresponding to the third directory entry as the target moving position.
The process of determining the third directory entry according to the display state of the last directory entry in the target location is similar to the process of determining the second directory entry according to the display state of the first directory entry, namely, under the condition that the display state of the last directory entry in the target location is a folded state, the next directory entry of the last directory entry in the target location is used as the third directory entry; and in the case that the display state of the last directory entry of the target position is the unfolded state, taking the next directory entry of the last directory entry of the target position as a fifth directory entry.
For example, as shown in fig. 6, the first directory entry is directory 1.1, when directory 1.1 is moved to a location between directories 1.2 and 1.3, the target location is a location between directories 1.2 and 1.3, directory 1.2 is the last directory entry of the target location, and since the display state of directory 1.2 is a folded state, and there is a folded directory entry in directory 1.2, the next directory (i.e., directory 1.3) of the last directory entry in directory 1.2 (i.e., directory 1.2.1 shown in fig. 2 (b)) is used as the third directory entry based on the actual arrangement of directory entries of the directory; for another example, when the directory 1.1 is moved to a position between the directories 1.3 and 2, the last directory entry in the target position is the directory 1.3, and since the display state of the directory 1.3 is an unfolded state, the actual next directory (i.e., the directory 2) of the directory 1.3 is set as the third directory entry directly based on the actual arrangement state of the directory entries of the directory.
And step 306, moving the target text area according to the target moving position.
In this embodiment, after the target moving position corresponding to the target text area is determined, the target text area is moved to insert the target text area to the target moving position, so as to achieve automatic and accurate typesetting of the text of the document to be processed.
Taking a specific application scenario as an example, as shown in (a) in fig. 5, when the user selects the directory 1.1 in the folded state and moves the directory between the directories 1.3 and 2 (as shown in (a) in fig. 7), the target text region corresponding to the directory 1.1 is determined (as shown in (b) in fig. 5), and the target moving position where the target is the current region is determined as the starting position of the directory 2 in the body. The target text area is moved to the start position of the directory 2, and the body of the moved document to be processed is shown in fig. 7 (b).
Optionally, in any embodiment, during the text moving process, the number of the title in the text may also be changed, that is, in response to the moving operation of the first directory entry in the directory of the document to be processed, the order of the moved first directory entry in the directory entries of the same hierarchy is determined. And updating the numbers of all the titles of which the first titles corresponding to the first directory entries belong to the same hierarchy according to the sequence corresponding to the moved first directory entries.
Taking a specific application scenario as an example, as shown in (a) in fig. 5, when the user selects the directory 1.1 in the folded state and moves the directory between the directories 1.3 and 2 (as shown in (a) in fig. 7), the target text region corresponding to the directory 1.1 is determined (as shown in (b) in fig. 5), and the target moving position where the target is the current region is determined as the starting position of the directory 2 in the body. The target text area is moved to the start position of the directory 2, and the body of the moved document to be processed is shown in fig. 7 (c). In any embodiment, optionally, during the text moving process, the hierarchy of the title in the text may also be changed, that is, in response to the moving operation of the first directory entry in the directory of the document to be processed, the hierarchy corresponding to the moved first directory entry is determined. And updating the hierarchies of all the titles in the target text area corresponding to the first directory entry according to the hierarchy corresponding to the moved first directory entry.
Specifically, when the hierarchy of a title needs to be changed, the change can be performed by moving the corresponding directory entry. And under the condition that the moving operation of the first directory entry is received, indicating that the hierarchy of the first directory entry may be changed, acquiring the hierarchy corresponding to the moved first directory entry, and updating the hierarchies of all the titles in the target text area corresponding to the first directory entry to the hierarchy corresponding to the moved first directory entry.
It can be understood that when the display state of the first directory entry is the non-folding state, all the titles in the target text area corresponding to the first directory entry are the first titles corresponding to the first directory entry. For example, the directory 1.1 in (b) in fig. 2 is moved, and the hierarchy of the directory 1.1 in (a) in fig. 2 is modified according to the hierarchy corresponding to the moved directory 1.1.
When the display state of the first directory entry is the folding state, all titles in the target text area corresponding to the first directory entry are titles of other hierarchies under the first title corresponding to the first directory entry, that is, all hierarchies included in the first title. For example, the directory 1.1 in (a) in fig. 5 is moved, and the hierarchies of the directory 1.1, the directory 1.1.1, and the directory 1.1.2 in (b) in fig. 5 are modified according to the hierarchy corresponding to the moved directory 1.1.
Optionally, when determining the hierarchy corresponding to the moved first directory entry, the hierarchy of the first directory entry may be determined by using the indentation value of the moved first directory entry, that is, the indentation value of the moved first directory entry is obtained. And determining the corresponding hierarchy of the moved first directory entry according to the indentation value of the moved first directory entry.
Specifically, the moving operation may further include a forward moving operation and/or a backward moving operation. Accordingly, the hierarchy of directory entries may be changed by moving the directory entries back and forth. And under the condition that the first directory entry stops moving, acquiring an indentation value of the moved first directory entry, searching a hierarchy corresponding to the indentation value of the moved first directory entry from a preset indentation hierarchy mapping table, and taking the hierarchy as the hierarchy corresponding to the moved first directory entry.
The preset indentation level mapping table comprises the levels of the directory entries and the corresponding indentation values. The hierarchy comprises 1 level, 2 levels, … … levels and N levels, wherein N is an integer. For example, as shown in fig. 2, directory 1 in the text is a first-level title, and the corresponding level is 1 level, and correspondingly, the level of directory 1 in the directory is also 1 level, and the corresponding indentation value is 1.
In this embodiment, compared with the text content of the document, the content of the directory of the document is less, and therefore, the hierarchy of the directory entry can be changed by changing the indentation value of the directory entry, and the hierarchy of the title in the text can be changed, so that the fast adjustment of the hierarchy of the title is realized, and the hierarchical relationship of the directory entry can be better embodied by setting the corresponding indentation value for the hierarchy, which is convenient for the user to read.
In this embodiment, when moving the directory entries, the directory entries in the non-folded state may be moved, so that only the text region corresponding to the title corresponding to a single directory entry is mapped and moved, and the directory entries in the folded state may also be moved, so that the text regions corresponding to the titles corresponding to a plurality of directory entries, that is, a plurality of text regions are mapped and moved, thereby improving the moving efficiency, improving the typesetting efficiency of the document, and achieving the flexibility of typesetting.
In this embodiment, since the arrangement order of the directory entries in the directory is consistent with the arrangement order of the titles in the text, when the text region corresponding to a title in the text of the document to be processed needs to be moved to another position in the text, the position of the text region corresponding to the title in the text can be changed in a linkage manner by changing the arrangement position of the directory entry corresponding to the title in the directory of the document to be processed through movement, so as to simplify the operation steps required by the user to typeset the document, effectively shorten the time required for typesetting the document with a complicated title hierarchy or a large content format, and achieve high user experience.
Corresponding to the embodiments of the method, the present specification also provides embodiments of an apparatus and an electronic device to which the apparatus is applied.
The embodiment of the document processing device can be applied to electronic equipment, such as a mobile phone, a computer and the like. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor in which the file processing is located. From a hardware aspect, as shown in fig. 8, which is a hardware structure diagram of an electronic device in which a document processing apparatus is located in an embodiment of the present disclosure, except for the processor 810, the memory 830, the network interface 820 and the nonvolatile memory 840 shown in fig. 8, an electronic device in which a document processing apparatus 831 is located in an embodiment may also include other hardware according to an actual function of the electronic device, and details thereof are not described again.
As shown in FIG. 9, FIG. 9 is a block diagram of a document processing device, shown in the present specification according to an exemplary embodiment, the device comprising:
the directory moving module 910 is configured to determine, in response to a moving operation of a first directory entry in a directory of a document to be processed, a target position of the first directory entry in the directory; the target position is the position of the first directory entry in the directory after movement; the catalog of the document to be processed corresponds to the title in the body of the document to be processed;
a text determining module 920, configured to determine a target text area corresponding to a first title corresponding to a first directory entry in a text of the document to be processed;
a position determining module 930, configured to determine a target moving position of the target text area according to the target position of the first directory entry;
and a text moving module 940, configured to move the target text area according to the target moving position.
Optionally, the text determining module 920 is specifically configured to:
determining the initial position of a target text area according to the initial position of the first title in the text of the document to be processed;
determining a second directory entry according to the first directory entry; the second directory entry is the next directory entry of the first directory entry in the directories of the documents to be processed displayed before movement;
and determining the end position of the target text area according to the starting position of the title corresponding to the second directory entry in the text of the document to be processed.
Optionally, the text determining module 920 is further configured to:
acquiring the display state of the first directory entry; wherein the display status of the first directory entry indicates a folding condition of the first directory entry;
and determining a second directory entry corresponding to the first directory entry according to the display state of the first directory entry.
Optionally, the text determining module 920 is further configured to:
under the condition that the display state of the first directory entry is a folding state, taking the next directory entry of the last directory entry in the first directory entry as a second directory entry;
in a case where the display state of the first directory entry is an unfolded state, the next directory entry of the first directory entry is taken as the second directory entry.
Optionally, the text determining module 920 is further configured to:
and determining the starting position of the target text area according to the starting position of the first title in the text of the document to be processed.
And under the condition that the first directory entry before moving does not have the next directory entry, acquiring the end position of the text of the document to be processed, and determining the end position of the target text area according to the end position of the text.
Optionally, the position determining module 930 is specifically configured to:
acquiring a next directory entry of a target position of the first directory entry;
and determining the target moving position according to the starting position of the title corresponding to the next directory entry of the target position in the text of the document to be processed.
Optionally, the position determining module 930 is further configured to:
under the condition that the next directory entry does not exist in the target position, acquiring the end position of the text of the document to be processed;
and determining the target moving position according to the ending position of the text of the document to be processed.
Optionally, the position determining module 930 is further configured to:
acquiring a previous directory entry of a target position of a first directory entry;
acquiring the display state of the last directory entry of the target position; the display state of the last directory entry of the target position indicates the folding condition of the last directory entry of the target position;
determining a third directory entry according to the display state of the last directory entry of the target position; wherein the third directory entry is a directory entry next to a directory entry at a previous target position displayed before the move;
and determining the target moving position according to the starting position of the title corresponding to the third directory entry in the text of the document to be processed.
Optionally, the position determining module 930 is specifically configured to:
and under the condition that the last directory entry does not exist in the target position, acquiring the initial position of the text of the document to be processed, and taking the initial position of the text of the document to be processed as the target moving position.
Optionally, the document processing apparatus further includes a hierarchy updating module;
the hierarchy update module is to:
responding to the moving operation of a first directory entry in a directory of a document to be processed, and determining a hierarchy corresponding to the moved first directory entry;
and updating the hierarchies of all the titles in the target text area corresponding to the first directory entry according to the hierarchy corresponding to the moved first directory entry.
Optionally, the hierarchy updating module is specifically configured to:
acquiring an indentation value of the moved first directory entry;
and determining the corresponding hierarchy of the moved first directory entry according to the indentation value of the moved first directory entry.
Optionally, the text determining module 920 is further configured to:
determining whether the target position of the first directory entry is a preset effective position; the preset effective position comprises one or more of the last position of the first directory entry in the directory of the document to be processed, the position between two adjacent directory entries in the directory of the document to be processed and the next position of the last directory entry in the directory of the document to be processed;
and if the target text area is the preset effective position, determining a target text area corresponding to a first title corresponding to a first directory entry in the text of the document to be processed.
Correspondingly, the present specification also provides an electronic device, which includes a processor; a memory for storing processor-executable instructions; wherein the processor is configured to:
responding to the moving operation of a first directory entry in a directory of a document to be processed, and determining the target position of the first directory entry in the directory; wherein the target position is the position of the moved first directory entry in the directory; the catalog of the document to be processed corresponds to a title in a body of the document to be processed;
determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed;
determining a target moving position of the target text area according to the target position of the first directory entry;
and moving the target text area according to the target moving position.
In one embodiment, the present application further provides a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement a document processing method as described above.
In one embodiment, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements a document processing method as described above.
The implementation process of the functions and actions of each module in the above device is detailed in the implementation process of the corresponding steps in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the modules described as separate components may or may not be physically separate, and the components displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the present specification. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Other embodiments of the present description will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
It will be understood that the present description is not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the description is limited only by the appended claims.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (15)

1. A method of document processing, comprising:
responding to the moving operation of a first directory entry in a directory of a document to be processed, and determining the target position of the first directory entry in the directory; the target position is the position of the moved first directory entry in the directory; the catalog of the document to be processed corresponds to a title in a body of the document to be processed;
determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed;
determining a target moving position of the target text area according to the target position of the first directory entry;
and moving the target text area according to the target moving position.
2. The method according to claim 1, wherein the determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed includes:
determining the starting position of the target text area according to the starting position of the first title in the text of the document to be processed;
determining a second directory entry according to the first directory entry; wherein the second directory entry is a directory entry next to the first directory entry in the directory of the document to be processed displayed before the moving;
and determining the end position of the target text area according to the starting position of the title corresponding to the second directory entry in the text of the document to be processed.
3. The method of claim 2, wherein determining the second directory entry based on the first directory entry comprises:
acquiring the display state of the first directory entry; wherein the display status of the first directory entry indicates a collapsed condition of the first directory entry;
and determining a second directory entry corresponding to the first directory entry according to the display state of the first directory entry.
4. The method of claim 3, wherein determining the second directory entry corresponding to the first directory entry according to the display status of the first directory entry comprises:
taking a next directory entry of a last directory entry in the first directory entries as the second directory entry when the display state of the first directory entry is a folded state;
and when the display state of the first directory entry is an unfolded state, taking the next directory entry of the first directory entry as the second directory entry.
5. The method according to claim 1, wherein the determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed includes:
determining the starting position of the target text area according to the starting position of the first title in the text of the document to be processed;
and under the condition that the first directory entry before moving does not have the next directory entry, acquiring the end position of the text of the document to be processed, and determining the end position of the target text area according to the end position of the text.
6. The method of claim 1, wherein determining the target movement location of the target body area based on the target location of the first directory entry comprises:
acquiring a next directory entry of the target position of the first directory entry;
and determining the target moving position according to the starting position of the title corresponding to the next directory entry of the target position in the text of the document to be processed.
7. The method of claim 1, wherein determining the target movement location of the target body area based on the target location of the first directory entry comprises:
under the condition that the next directory entry does not exist in the target position, acquiring the end position of the text of the document to be processed;
and determining the target moving position according to the ending position of the text of the document to be processed.
8. The method of claim 1, wherein determining the target movement location of the target body area based on the target location of the first directory entry comprises:
acquiring a previous directory entry of the target position of the first directory entry;
acquiring the display state of the last directory entry of the target position; wherein the display status of the last directory entry of the target location indicates a folding condition of the last directory entry of the target location;
determining a third directory entry according to the display state of the last directory entry of the target position; wherein the third directory entry is a directory entry next to a directory entry previous to the target location displayed before the move;
and determining the target moving position according to the starting position of the title corresponding to the third directory entry in the body of the document to be processed.
9. The method of claim 1, wherein determining the target movement location of the target body area based on the target location of the first directory entry comprises:
and under the condition that the target position does not have the last directory entry, acquiring the initial position of the text of the document to be processed, and taking the initial position of the text of the document to be processed as the target moving position.
10. The method according to any one of claims 1 to 9, further comprising:
responding to the moving operation of a first directory entry in the directory of the document to be processed, and determining a hierarchy corresponding to the moved first directory entry;
and updating the hierarchies of all the titles in the target text area corresponding to the first directory entry according to the hierarchy corresponding to the moved first directory entry.
11. The method of claim 10, wherein determining the hierarchy corresponding to the moved first directory entry comprises:
acquiring an indentation value of the moved first directory entry;
and determining the corresponding hierarchy of the moved first directory entry according to the indentation value of the moved first directory entry.
12. The method according to any one of claims 1 to 9, wherein the determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed includes:
determining whether the target position of the first directory entry is a preset effective position; the preset effective position comprises one or more of the last position of the first directory entry in the directory of the document to be processed, the position between two adjacent directory entries in the directory of the document to be processed and the next position of the last directory entry in the directory of the document to be processed;
and if the target text area is the preset effective position, determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed.
13. A document processing apparatus, comprising:
the system comprises a catalog moving module, a first storage module and a second storage module, wherein the catalog moving module is used for responding to the moving operation of a first catalog item in a catalog of a document to be processed and determining the target position of the first catalog item in the catalog; wherein the target position is the position of the moved first directory entry in the directory; the catalog of the document to be processed corresponds to a title in a body of the document to be processed;
the text determining module is used for determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed;
the position determining module is used for determining a target moving position of the target text area according to the target position of the first directory entry;
and the text moving module is used for moving the target text area according to the target moving position.
14. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the following method when executing the program:
responding to the moving operation of a first directory entry in a directory of a document to be processed, and determining the target position of the first directory entry in the directory; wherein the target position is the position of the moved first directory entry in the directory; the catalog of the document to be processed corresponds to a title in a body of the document to be processed;
determining a target text area corresponding to a first title corresponding to the first directory entry in the text of the document to be processed;
determining a target moving position of the target text area according to the target position of the first directory entry;
and moving the target text area according to the target moving position.
15. A computer-readable storage medium having computer-executable instructions stored therein which, when executed by a processor, implement the document processing method of any one of claims 1 to 12.
CN202210314358.6A 2022-03-28 2022-03-28 Document processing method and device Pending CN114742019A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210314358.6A CN114742019A (en) 2022-03-28 2022-03-28 Document processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210314358.6A CN114742019A (en) 2022-03-28 2022-03-28 Document processing method and device

Publications (1)

Publication Number Publication Date
CN114742019A true CN114742019A (en) 2022-07-12

Family

ID=82276228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210314358.6A Pending CN114742019A (en) 2022-03-28 2022-03-28 Document processing method and device

Country Status (1)

Country Link
CN (1) CN114742019A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115995087A (en) * 2023-03-23 2023-04-21 杭州实在智能科技有限公司 Document catalog intelligent generation method and system based on fusion visual information

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115995087A (en) * 2023-03-23 2023-04-21 杭州实在智能科技有限公司 Document catalog intelligent generation method and system based on fusion visual information

Similar Documents

Publication Publication Date Title
US8645812B1 (en) Methods and apparatus for automated redaction of content in a document
US20060282779A1 (en) Applying a design to a slide using equivalent layouts
CN108762743B (en) Data table operation code generation method and device
CN111209000B (en) Processing method and device of custom control, electronic equipment and storage medium
JP2019520625A (en) Human computer interaction method and device thereof
CN105335052A (en) Information processing method and terminal equipment
CN108459998B (en) Document updating method, document updating device, document format converting method, document updating format converting device, document format converting device and readable storage medium
CN108710601A (en) A kind of text display method and its equipment, storage medium, electronic equipment
US20140089841A1 (en) Device and method for providing application interface based on writing input
CN106598926B (en) Operation revocation method and device
CN106708795A (en) Method and device for setting title formats in batch
CN114742019A (en) Document processing method and device
CN111752447B (en) Information acquisition method and device and computer readable storage medium
JP2010257392A (en) Device and method for inputting character, computer readable program, and recording medium
CN115033822B (en) Element positioning method, device, equipment and readable storage medium
CN116719843A (en) Query method, storage medium and device for database system
JP2005107931A (en) Image search apparatus
CN111190653A (en) Method, computing device and computer readable medium for implementing context menu expansion
CN113987106A (en) Electronic book bookmark adding method, electronic equipment and storage medium
CN113688150A (en) Keyword searching method and device, electronic equipment and storage medium
CN112307716A (en) Document content export method, export device, electronic equipment and storage medium
TWI408564B (en) Method and human-to-machine interface apparatus for searching files
CN114741070B (en) Code generation method, device, electronic equipment and storage medium
JP4847210B2 (en) Input conversion learning program, input conversion learning method, and input conversion learning device
CN109902278B (en) Annotating processing method and device

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