CN115470777A - Text blocking method and device - Google Patents

Text blocking method and device Download PDF

Info

Publication number
CN115470777A
CN115470777A CN202211123800.3A CN202211123800A CN115470777A CN 115470777 A CN115470777 A CN 115470777A CN 202211123800 A CN202211123800 A CN 202211123800A CN 115470777 A CN115470777 A CN 115470777A
Authority
CN
China
Prior art keywords
target
preset
dimensional array
paragraph
array
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
CN202211123800.3A
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 Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202211123800.3A priority Critical patent/CN115470777A/en
Publication of CN115470777A publication Critical patent/CN115470777A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/258Heading extraction; Automatic titling; Numbering
    • 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/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

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 application discloses a text blocking method and device, and relates to the technical field of text processing. One embodiment of the method comprises: extracting element information of each paragraph in a text to be partitioned to generate a target one-dimensional array; and determining the first element in the target one-dimensional array as a target element, and executing the target operation. The implementation mode realizes the semantic-based blocking operation of the selected text, improves the reasonability and effectiveness of the numbering, and improves the user experience.

Description

Text blocking method and device
Technical Field
The application relates to the technical field of cooperative office, in particular to the technical field of text processing, and particularly relates to a text blocking method and device.
Background
With the continuous development of the internet, the requirement on the cooperative office software is higher and higher, and in the existing rich text editor, a list style can be set to number the paragraphs so as to more clearly list the contents, and the selected paragraphs are numbered sequentially from top to bottom by default.
Disclosure of Invention
The embodiment of the application provides a text blocking method, a text blocking device, text blocking equipment and a storage medium.
According to a first aspect, an embodiment of the present application provides a text blocking method, including: extracting element information of each paragraph in a text to be partitioned to generate a target one-dimensional array; and determining the first element in the target one-dimensional array as a target element, and executing the target operation.
According to a second aspect, an embodiment of the present application provides a text blocking apparatus, including: the extraction module is configured to extract element information of each paragraph in the text to be partitioned to generate a target one-dimensional array; and the blocking module is configured to determine a first element in the target one-dimensional array as a target element and execute a target operation.
According to a third aspect, embodiments of the present application provide an electronic device, which includes one or more processors; a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement a text chunking method as in any embodiment of the first aspect.
According to a fourth aspect, embodiments of the present application provide a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements the text blocking method according to any one of the embodiments of the first aspect.
The method comprises the steps of extracting element information of each paragraph in a text to be blocked to generate a target one-dimensional array; the first element in the target one-dimensional array is determined as the target element, the target operation is executed, the semantic-based blocking operation of the selected text is realized, the problem of poor user experience of numbering by simply relying on the indentation level in the prior art is solved, the reasonability and the effectiveness of numbering are improved, and the user experience is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
FIG. 1 is an exemplary system architecture diagram to which the present application may be applied;
FIG. 2a is a flow diagram of one embodiment of a text chunking method according to the present application;
fig. 2b is a schematic diagram of an application scenario of the numbering method according to the prior art;
FIG. 3 is a flow diagram of one embodiment of a text chunking method according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a text chunking method according to the present application;
FIG. 5 is a schematic diagram of an application scenario of a text chunking method according to the present application;
FIG. 6 is a flow diagram of yet another embodiment of a text chunking method according to the present application;
FIG. 7 is a schematic diagram of one embodiment of a text chunking apparatus according to the present application;
FIG. 8 is a schematic block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
FIG. 1 illustrates an exemplary system architecture 100 to which embodiments of the text chunking method of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 interact with a server 105 via a network 104 to receive or send messages or the like. Various communication client applications, such as a text processing application, a communication application, etc., may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen, including but not limited to a mobile phone and a notebook computer. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple software or software modules (e.g., to provide text chunking services) or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, for example, extracting element information of each paragraph in a text to be partitioned to generate a target one-dimensional array; and determining the first element in the target one-dimensional array as a target element, and executing the target operation.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (for example, for providing text blocking service), or may be implemented as a single software or software module. And is not particularly limited herein.
It should be noted that the text blocking method provided by the embodiment of the present disclosure may be executed by the server 105, or may be executed by the terminal devices 101, 102, and 103, or may be executed by the server 105 and the terminal devices 101, 102, and 103 in cooperation with each other. Accordingly, the parts (for example, the units, the sub-units, the modules, and the sub-modules) included in the text blocking apparatus may be all disposed in the server 105, all disposed in the terminal devices 101, 102, and 103, or disposed in the server 105 and the terminal devices 101, 102, and 103, respectively.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2a shows a flow diagram 200 of an embodiment of a text blocking method that can be applied to the present application. In this embodiment, the text blocking method includes the following steps:
step 201, extracting element information of each paragraph in the text to be blocked, and generating a target one-dimensional array.
In this embodiment, since the current editor can set the general paragraphs and the title paragraphs as an ordered list, but does not perform semantic distinction, for all lines set as a list, the number range is distinguished only by the indentation level, and for the same indented title paragraphs and general paragraphs, the numbers are generally numbered sequentially from top to bottom, as shown in fig. 2 b.
But for an article, the headings and paragraphs under the headings are inclusive, and the ordered list under each headline has no dependency on the lists under other headings, has no dependency on the headings themselves, and should not be directly numbered sequentially. Therefore, the user needs to manually set renumbering every time, and interaction and experience are not good.
In order to solve the problems, the execution main body can monitor the selection operation of the user on the original text in real time or periodically, respond to the monitored selection operation of the user, acquire the selected text, namely the text to be blocked, extract the element information of each paragraph in the text to be blocked, and generate the target one-dimensional array according to the paragraph sequence by using each element information.
Wherein, the element information may include: paragraph classes and class parameters.
Here, the selecting operation is used to indicate that the start position and the end position of the selected text are determined in the original text. Here, the start position may be at the beginning of the paragraph, or at the middle of the paragraph, and the end position may be at the end of the paragraph, or at the middle of the paragraph, which is not limited in this application.
Specifically, the execution main body may first obtain a paragraph at a start position of the selected text, record the paragraph as a start point, then obtain a paragraph at an end position, and record an end point of the paragraph. Intercepting data between the starting point and the ending point, converting the intercepted data into a list paragraph (namely a text paragraph) and a title paragraph, extracting element information of each paragraph, and generating a target one-dimensional array.
Wherein, the paragraph categories may include: text paragraphs, title paragraphs, reference paragraphs, etc. The category parameter corresponds to a paragraph category, for example, if the paragraph category is a text paragraph, the category parameter is an indentation value, and if the paragraph category is a title paragraph, the category parameter is a title level.
Step 202, determining the first element in the target one-dimensional array as a target element, and executing the target operation.
In this embodiment, the execution agent may determine a first element in the one-dimensional array, that is, an element corresponding to a first paragraph, as a target element, and execute the target operation.
Wherein the target operation comprises:
1. a blocking operation is performed.
The blocking operation comprises:
(1) And in response to determining that the preset one-dimensional array corresponding to the paragraph class of the target element is empty, storing the target element into the preset one-dimensional array.
Here, if the paragraph types of the elements are different, the corresponding preset one-dimensional arrays are different.
Specifically, the paragraph type of the target element is a title paragraph, the preset one-dimensional array corresponding to the paragraph type of the target element is a first one-dimensional array, the paragraph type of the target element is a text paragraph, the preset one-dimensional array corresponding to the paragraph type of the target element is a second one-dimensional array, the paragraph type of the target element is a reference paragraph, and the preset one-dimensional array corresponding to the paragraph type of the target element is a third one-dimensional array.
The first one-dimensional array, the second one-dimensional array and the third one-dimensional array are different from each other.
(2) And in response to determining that the preset one-dimensional array corresponding to the paragraph category of the target element is not empty, executing a preset operation according to a comparison result of the category parameter of the target element and the category parameters of the elements in the preset one-dimensional array.
Wherein, the preset operation comprises:
and in response to the comparison result is determined to be larger than the preset one-dimensional array, pushing (last-in first-out) the preset one-dimensional array into a preset queue corresponding to the paragraph class of the target element, and storing the target element into the reset preset one-dimensional array.
2. And in response to the blocking operation ending and the next element in the target one-dimensional array, determining the next element as the target element and continuing to execute the target operation.
Here, the execution subject may determine whether the blocking operation is ended in real time or periodically, and if the blocking operation is ended and a next element exists in the target one-dimensional array, determine the next element as the target element, and continue to execute the target operation.
3. And in response to the fact that the blocking operation is determined to be finished and the next element does not exist in the target one-dimensional array, storing a preset one-dimensional array corresponding to the paragraph class of the target element and each array in a preset queue as independent blocks into a preset mapping object corresponding to the paragraph class of the target element respectively to obtain the target mapping object.
Here, the execution main body may determine whether the blocking operation is ended in real time or periodically, and if the blocking operation is ended and the next element does not exist in the target one-dimensional array, add the preset one-dimensional array corresponding to the paragraph category of the target element and the elements in the preset queue to the corresponding preset mapping object according to the category parameters corresponding to the elements, so as to obtain the target mapping object.
It should be noted that, since the target one-dimensional array may include elements corresponding to different paragraph classes, the target mapping object may include one mapping object or may include a plurality of mapping objects.
Specifically, the target one-dimensional array includes 4 elements, the paragraph categories of 2 elements are title paragraphs, the paragraph categories of 2 elements are text paragraphs, and different paragraph categories correspond to different mapping objects, so that the target mapping object includes two preset mapping objects.
In addition, it should be noted that, before the execution subject performs the blocking operation, an initialization operation needs to be performed, and the initialization operation may include: the execution main body initializes a preset one-dimensional array, such as currArr, the preset one-dimensional array is used for storing target elements, and the category parameters of all elements in the array are equal. A pre-set queue, e.g., queue, is initialized as a stack, the pre-set queue being used for temporarily storing arrays. A map object, such as a map object, is initialized for storing independent partitions corresponding to different classes of parameters.
It should be noted that the preset one-dimensional array is stored as an independent block in the preset mapping object, and each time the independent block is stored in the preset mapping object, the elements in the independent block are renumbered.
In some optional manners, the presetting operation further includes: and in response to determining that the category parameter of the target element is equal to the category parameter of the elements in the preset one-dimensional array, storing the target element in the preset one-dimensional array.
In this implementation manner, the execution main body may determine whether the preset one-dimensional array is empty, and if it is determined that the preset one-dimensional array is not empty, execute a preset operation according to a comparison result between the category parameter of the target element and the category parameters of the elements in the preset one-dimensional array; the preset operation comprises the following steps: and if the comparison result is determined to be equal, namely the category parameter of the target element is equal to the category parameter of the element in the preset one-dimensional array, directly storing the target element into the preset one-dimensional array.
The implementation implements a processing operation of the target element whose comparison result is equal by storing the target element in the preset one-dimensional array in response to determining that the comparison result is equal.
In some optional manners, the presetting operation further includes: in response to the fact that the class parameters of the target elements are smaller than the class parameters of the elements in the preset one-dimensional array and no array exists in a preset queue corresponding to the paragraph classes of the target elements, storing the preset one-dimensional array as an independent block into a preset mapping object corresponding to the paragraph classes of the target elements; and in response to the fact that the class parameters of the target elements are smaller than the class parameters of the elements in the preset one-dimensional array and an array exists in a preset queue corresponding to the paragraph class of the target elements, storing the preset one-dimensional array as an independent block into a preset mapping object corresponding to the paragraph class of the target elements, determining the array at the top of the stack as an initial array, and executing the stack popping operation.
In this implementation manner, the execution main body may judge whether the preset one-dimensional array is empty, and if it is determined that the preset one-dimensional array is not empty, execute a preset operation according to a comparison result between the category parameter of the target element and the category parameters of the elements in the preset one-dimensional array; the preset operation comprises the following steps: and in response to determining that the comparison result is less than and that no array exists in the preset queue corresponding to the paragraph category of the target element, storing a preset one-dimensional array as an independent block into a preset mapping object corresponding to the paragraph category of the target element.
Here, the way that the execution subject stores the elements in the preset one-dimensional array as an independent partition into the preset mapping object corresponding to the paragraph class of the target element may be: and constructing key value pairs according to the elements in the preset one-dimensional array and the corresponding category parameters, and storing the key value pairs as independent blocks into a preset mapping object.
Further, the execution subject resets the preset one-dimensional array, and stores the target element into the reset preset one-dimensional array.
And if the comparison result is smaller than the preset value and an array exists in the preset queue corresponding to the paragraph type of the target element, storing the preset one-dimensional array as an independent block into a preset mapping object corresponding to the paragraph type of the target element, determining the array at the top of the stack as an initial array, and executing pop-up operation.
Wherein the pop operation comprises: in response to the fact that the class parameters of the elements in the initial array are larger than the class parameters of the target elements, the initial array is popped out as independent blocks to be stored in a preset mapping object, and whether a next array exists in a preset queue or not is judged; in response to the fact that the class parameters of the elements in the initial array are equal to the class parameters of the target elements, popping the initial array, assigning a preset one-dimensional array, determining the assigned preset one-dimensional array as a new preset one-dimensional array, and judging whether a next array exists in a preset queue; and in response to determining that the next array exists, determining the next element as the initial array, and continuing to execute the pop operation.
And in response to determining that the class parameter of the element in the initial array is smaller than the class parameter of the target element or that no next array exists, storing the target element into a preset one-dimensional array corresponding to the paragraph class of the target element.
Here, the array stored in the preset mapping object in the pop operation is popped up as an independent block, and elements in the independent block are numbered again.
In response to the comparison result is determined to be smaller and no array exists in the preset queue corresponding to the paragraph class of the target element, storing the preset one-dimensional array as an independent block into a preset mapping object corresponding to the paragraph class of the target element, and storing the target element into a reset preset one-dimensional array; and in response to the comparison result is determined to be smaller and the array exists in the preset queue, determining the array at the top of the stack as the initial array, and executing the stack popping operation, so that the array in the preset queue is blocked when the comparison result is smaller and the array does not exist in the preset queue or exists in the preset queue.
In some optional ways, the blocking operation further includes: in response to the fact that the paragraph category of the target element is determined to be a title paragraph and the preset one-dimensional array corresponding to the text paragraph is not empty, the preset one-dimensional array corresponding to the text paragraph is pushed into the preset queue corresponding to the text paragraph to obtain the pushed preset queue; and storing each array in the pushed preset queue as an independent block into a preset mapping object corresponding to the text paragraph according to the category parameter.
In this implementation manner, in response to determining that the paragraph category of the target element is a title paragraph and the preset one-dimensional array corresponding to the text paragraph is not empty, the execution main body pushes the preset one-dimensional array corresponding to the text paragraph, such as the second one-dimensional array, into the corresponding preset queue, such as the second preset queue, to obtain the pushed preset queue, and stores each array in the pushed preset queue as an independent block into the preset mapping object corresponding to the text paragraph according to the category parameter.
In the implementation mode, in response to the fact that the paragraph category of the target element is determined to be a title paragraph and the preset one-dimensional array corresponding to the text paragraph is not empty, the preset one-dimensional array corresponding to the text paragraph is pushed into the preset queue corresponding to the text paragraph to obtain the pushed preset queue; and storing each array in the pushed preset queue as an independent block into a preset mapping object corresponding to the text paragraph according to the category parameters, thereby effectively avoiding the serial numbering of the text paragraphs under different titles and further improving the effectiveness of text blocking.
In some optional ways, the method further comprises: and generating target block texts based on the target mapping objects.
In this implementation manner, after the execution main body obtains the target mapping object, the execution main body may directly generate the target block text according to the target mapping object, or may further renumber the elements in each independent block according to the attribute set by the first element in each independent block in the target mapping object, and generate the target block text based on the renumbered elements, that is, the renumbered text based on the dependency relationship between the paragraphs.
The implementation mode generates the target block text based on the target mapping object, and realizes that the target mapping object generates the corresponding target block text.
In some alternatives, the paragraph category is a title paragraph and the category parameter is a title level.
In this implementation manner, the execution main body may determine the paragraph category of the target element, and if the paragraph category of the target element is a title paragraph and the category parameter is a title level, execute an operation in a preset one-dimensional array, a preset queue, and a preset mapping object corresponding to the title paragraph.
Specifically, as shown in fig. 3, the target one-dimensional array includes six elements, where a category parameter of a first element is a primary title, a category parameter of a second element is a secondary title, a category parameter of a third element is a secondary title, a category parameter of a fourth element is a tertiary title, a category parameter of a fifth element is a secondary title, and a category parameter of a sixth element is a primary title.
The execution agent may first determine a first element in the target one-dimensional array as the target element and execute the target operation. Wherein the target operation comprises: executing blocking operation, wherein the blocking operation comprises the following steps: and in response to the fact that the paragraph category of the target element is determined to be the title paragraph and the preset one-dimensional array corresponding to the title paragraph is empty, if the first one-dimensional array is empty, storing the target element into the first one-dimensional array, in response to the end of the blocking operation, determining the second element as the target element, and continuing to execute the target operation.
In response to the fact that the paragraph type of the target element is determined to be a title paragraph and the first one-dimensional array corresponding to the title paragraph is not empty, comparing the category parameter of the target element, namely the second level, with the category parameter of the element in the first one-dimensional array, namely the first level, pressing the first one-dimensional array into the first queue corresponding to the title paragraph due to the fact that the second level is larger than the first level, resetting the first one-dimensional array, storing the target element into the reset first one-dimensional array to obtain a new preset one-dimensional array, namely the new first one-dimensional array, in response to the end of the blocking operation, determining the third element to be the target element, and continuing to execute the target operation.
And in response to the fact that the paragraph class of the target element is determined to be the title paragraph and the first one-dimensional array corresponding to the title paragraph is not empty, comparing the class parameter, namely the second level, of the target element with the class parameter, namely the second level, of the element in the first one-dimensional array, directly storing the target element into the first one-dimensional array as the second level is equal to the second level, in response to the end of the blocking operation, determining the fourth element as the target element, and continuing to execute the target operation.
In response to determining that the paragraph category of the target element is a title paragraph and the first one-dimensional array corresponding to the title paragraph is not empty, comparing the category parameter of the target element, namely, the third level, with the category parameter of the element in the first one-dimensional array, namely, the second level, wherein the third level is greater than the second level, pushing the first one-dimensional array into the first queue corresponding to the title paragraph (at this time, the first queue comprises two arrays, namely, an array comprising one first-level title and an array comprising two second-level titles, wherein the array comprising the two second-level titles is a top-of-stack array), resetting the first one-dimensional array, storing the target element into the reset first one-dimensional array, obtaining a new preset one-dimensional array, namely, the new first one-dimensional array, in response to the end of the blocking operation, determining the fifth element as the target element, and continuing to execute the target operation.
In response to determining that the paragraph category of the target element is a title paragraph and the first one-dimensional array corresponding to the title paragraph is not empty, comparing the category parameter of the target element, namely, the second level, with the category parameter of the element in the first one-dimensional array, namely, the third level, storing the current first one-dimensional array (including a third level title) as an independent partition into a first mapping object corresponding to the paragraph category of the target element because the second level is less than the third level, further, performing a pop-up operation with the top-of-stack array as an initial array because the first array has an array, popping the initial array and assigning the first one-dimensional array in response to determining that the category parameter of the element in the initial array is equal to the category parameter of the target element (both are the second level), and determining whether the preset array exists in the next array; in response to determining that the next array (the array including a one-level header) exists, the next element is determined to be the initial array, and the pop operation continues.
And in response to the fact that the class parameter (primary) of the element in the initial array is smaller than the class parameter (secondary) of the target element, storing the target element into a preset one-dimensional array corresponding to the paragraph class of the target element, namely storing the target element into the current first one-dimensional array to obtain a new first one-dimensional array (the first one-dimensional array comprising three secondary titles). And in response to the end of the blocking operation, determining the sixth element as the target element, and continuing to execute the target operation.
In response to the fact that the paragraph type of the target element is determined to be a title paragraph and the first one-dimensional array corresponding to the title paragraph is not empty, comparing the category parameter of the target element, namely the first level, with the category parameter of the elements in the first one-dimensional array, namely the second level, and storing the first one-dimensional array (including three second-level titles) into the first mapping object as independent blocks according to the corresponding category parameters (second levels) because the first level is smaller than the second level. The method comprises the steps that a first array exists in a first queue, a stack top array is used as an initial array to perform a stack popping operation, the initial array is popped and assigned with a first one-dimensional array in response to the fact that the class parameter (first level) of an element in the initial array is equal to the class parameter (first level) of a target element, and whether the preset array exists in a next array or not is judged; in response to the absence of the next array, the target element is stored in the first one-dimensional array, resulting in a new first one-dimensional array (comprising two first-level headers).
And responding to the end of the blocking operation and the absence of the next element, and storing the new first one-dimensional dimension as an independent block into the first mapping object according to the corresponding class parameter (because the element does not exist in the first queue) to obtain a target mapping object corresponding to the paragraph class. Further, based on the target mapping object, a target block text is generated.
According to the implementation mode, when the paragraph category of the target element is a title paragraph and the category parameter is a title level, the operations are executed in the preset one-dimensional array, the preset queue and the preset mapping object corresponding to the title paragraph, so that the blocking of the title paragraph is realized.
In some optional modes, the paragraph category is a text paragraph, and the category parameter is an indentation value.
In this implementation manner, the execution main body may determine the paragraph category of the target element, and if the paragraph category of the target element is a text paragraph and the category parameter is an indentation value, that is, a paragraph indentation value, execute an operation in a preset one-dimensional array, a preset queue, and a preset mapping object corresponding to the text paragraph.
Specifically, as shown in fig. 4, the target one-dimensional array includes four elements, the first element has an indentation value of 1 as the class parameter, the second element has an indentation value of 3 as the class parameter, the third element has an indentation value of 2 as the class parameter, and the fourth element has an indentation value of 1 as the class parameter.
The execution agent may first determine a first element in the target one-dimensional array as the target element and execute the target operation. Wherein the target operation comprises: executing blocking operation, wherein the blocking operation comprises the following steps: and in response to the fact that the paragraph type of the target element is determined to be the text paragraph, and the preset one-dimensional array corresponding to the text paragraph is empty, if the second one-dimensional array is empty, storing the target element into the second one-dimensional array, in response to the end of the blocking operation, determining the second element as the target element, and continuing to execute the target operation.
In response to the fact that the paragraph type of the target element is determined to be a text paragraph and the second one-dimensional array corresponding to the text paragraph is not empty, comparing the type parameter of the target element, namely the indentation value 3, with the type parameter of the element in the second one-dimensional array, namely the indentation value 1, and since 3 is larger than 1, pushing the second one-dimensional array into a second queue corresponding to the second one-dimensional array, resetting the second one-dimensional array, storing the target element into the reset second one-dimensional array, in response to the end of the blocking operation, determining the third element to be the target element, and continuing to execute the target operation.
And in response to the fact that the paragraph type of the target element is determined to be a text paragraph and the second one-dimensional array corresponding to the text paragraph is not empty, comparing the type parameter of the target element, namely the indentation value 2, with the type parameter of the element in the second one-dimensional array, namely the indentation value 3, wherein the type parameter of the second one-dimensional array is used as an independent block according to the corresponding type parameter because 2 is less than 3, the second one-dimensional array is stored into the second mapping object corresponding to the second queue, and meanwhile, the type parameter of the element in the array in the second queue is less than the type parameter of the target element, so that the stack is not required. Further, the second one-dimensional array is reset, and the target elements are stored in the reset second one-dimensional array. And in response to the end of the blocking operation, determining the fourth element as a target element and continuing to execute the target operation.
In response to the fact that the paragraph type of the target element is determined to be a text paragraph and the second one-dimensional array corresponding to the text paragraph is not empty, comparing the class parameter of the target element, namely the indentation value 1, with the class parameter of the element in the second one-dimensional array, namely the indentation value 2, wherein the class parameter of the second one-dimensional array is used as an independent block as 1 is smaller than 2, the second one-dimensional array is stored into the second mapping object corresponding to the second queue according to the corresponding class parameter, meanwhile, the array in the first queue is popped up as the class parameter (the indentation value 1) of the element in the array in the second queue is equal to the class parameter of the target element, the second one-dimensional array is assigned to obtain a new second one-dimensional array, and further, the target element is stored into the new second one-dimensional array. And responding to the end of the blocking operation and the absence of the next element, and storing the second one-dimensional array into the second mapping object according to the corresponding class parameters as independent blocks (because the elements do not exist in the first queue) to obtain a target mapping object corresponding to the paragraph class. Further, based on the target mapping object, a target block text is generated.
According to the implementation mode, when the paragraph category of the target element is a text paragraph and the category parameter is an indentation value, the operation is executed in the preset one-dimensional array, the preset queue and the preset mapping object corresponding to the text paragraph, and the segmentation of the text paragraph is realized.
With continued reference to fig. 5, fig. 5 is a schematic diagram of an application scenario of the text blocking method according to the present embodiment.
In the application scenario of fig. 5, an execution subject 501 may extract element information of each paragraph in a text to be partitioned, and generate a target one-dimensional array 502, where the element information includes: paragraph classes and class parameters. Determining the first element in the target one-dimensional array 502 as a target element, and performing a target operation, wherein the target operation comprises: performing a blocking operation 503, the blocking operation comprising: judging whether a preset one-dimensional array corresponding to the paragraph type of the target element is empty 504, and storing the target element into a preset one-dimensional array 505 in response to determining that the preset one-dimensional array corresponding to the paragraph type of the target element is empty; in response to determining that the preset one-dimensional array corresponding to the paragraph category of the target element is not empty, performing a preset operation 506 according to a comparison result of the category parameter of the target element and the category parameters of the elements in the preset one-dimensional array; the preset operation comprises the following steps: in response to the comparison result is determined to be greater than the preset one-dimensional array, pushing the preset one-dimensional array into a preset queue corresponding to the paragraph category of the target element, and storing the target element into the reset preset one-dimensional array; in response to determining that the blocking operation is finished and that a next element exists in the target one-dimensional array, determining the next element as a target element, and continuing to execute the target operation; in response to determining that the blocking operation is finished 507 and that the next element does not exist in the target one-dimensional array, storing a preset one-dimensional array corresponding to the paragraph category of the target element and each array in a preset queue as independent blocks into a preset mapping object corresponding to the paragraph category of the target element, respectively, to obtain a target mapping object 508.
The text blocking method generates a target one-dimensional array by extracting element information of each paragraph in a text to be blocked; the first element in the target one-dimensional array is determined as the target element, the target operation is executed, the semantic-based blocking operation of the selected text is realized, the problem of poor user experience of numbering by simply relying on the indentation level in the prior art is solved, the reasonability and the effectiveness of numbering are improved, and the user experience is improved.
With further reference to FIG. 6, a flow 600 of yet another embodiment of the text chunking method shown in FIG. 2 is illustrated. In this embodiment, the flow 600 of the text blocking method may include the following steps:
step 601, extracting element information of each paragraph in the text to be partitioned, and generating a target one-dimensional array.
In this embodiment, details of implementation and technical effects of step 601 may refer to the description of step 601, and are not described herein again.
Step 602, determining the first element in the target one-dimensional array as a target element, and executing a target operation.
In this embodiment, details of implementation and technical effects of step 602 may refer to the description of step 202, and are not described herein again.
Step 603, for each independent partition in the target mapping object, updating the number of the specified element in response to detecting a number update operation for the specified element in the independent partition.
In this embodiment, for each independent partition in the target mapping object, the execution main body may monitor, in real time or periodically, a number update operation of a user for a specified element in the independent partition, and in response to detecting the number update operation for the specified element, update the number of the specified element to obtain an updated number of the specified element.
Wherein, the number updating operation for the specified element may include setting the attribute of the specified element to be a continue number attribute, a renumbering attribute, a null attribute, and the like.
Specifically, if the number update operation is to set the attribute of the specified element to an empty attribute, the element is numbered according to the original number in the independent partition.
Here, the specified element may be any element in an independent block, which is not limited in the present application.
In some optional manners, the number of the specified element is updated, including: and in response to determining that the designated element is the first element in the corresponding independent block, setting the number of the designated element to be the sum of the number of the last element of the last independent block and the preset step size.
In this implementation, the number updating operation is to set the attribute of the specified element as the continuation number attribute, the execution main body determines whether the specified element is the first element in the corresponding independent partition, and if the specified element is the first element, the number of the specified element is set to be the sum of the number of the last element of the previous independent partition and the preset step length.
The preset step length can be set according to experience and actual requirements, for example, 1, 2, 3, etc., which is not limited in this application.
According to the implementation mode, when the number updating operation is to set the attribute of the specified element as the attribute of the continuous number, the number of the specified element is set to be the sum of the number of the last element of the previous independent block and the preset step length, so that the flexibility of number setting is effectively improved.
In some optional ways, the number of the specified element is updated, including: the number of the specified element is set to the initial number.
In this implementation, the number update operation is to set the attribute of the specified element to the renumbering attribute, and the execution body may set the number of the specified element to the initial number.
The initial number may be any number that characterizes the beginning, for example, 1,a, a, (1), etc., and is not limited in this application.
According to the implementation mode, the attribute of the specified element is set to be the renumbering attribute in the number updating operation, and the number of the specified element is set to be the initial number, so that the flexibility of number setting is further improved.
Step 604, in response to determining that the remaining elements sorted after the specified element exist in the independent partition, updating the numbers of the remaining elements based on the updated numbers of the specified element to obtain an updated target mapping object.
In this embodiment, the execution subject may determine that there are remaining elements ordered after the specified element in the independent partition, and if there are no remaining elements, the execution subject may generate the target partition text directly based on the updated target mapping object. If the number of the specified element exists, the execution main body can update the numbers of the rest elements based on the updated number of the specified element to obtain an updated target mapping object.
Specifically, the execution main body may further determine whether a next element of the specified element exists in the independent partition, and if it is determined that the next element of the specified element does not exist in the independent partition, the execution main body may generate the target partition text directly based on the updated target mapping object.
And if the next element of the specified element exists, determining the next element of the specified element as the target element, and then executing the numbering operation.
Wherein the numbering operation comprises: determining the sum of the number of the last element and the preset step length as the number of the target element to obtain a new number of the target element; in response to the existence of the next element of the target element (i.e., the next element ordered after the target element) in the independent partition, the next element of the target element is determined as the target element, and the numbering operation is continued. And in response to the next element without the target element, generating the target block text based on the target mapping object after the numbering operation, namely the updated target mapping object.
Step 605, generating a target block text based on the updated target mapping object
In this embodiment, the execution main body determines whether the next element of the target element exists in the independent partition, and if the next element of the target element does not exist, the execution main body may perform mapping rendering according to a set list style, for example, english letters a/b/c/d, arabic numerals 1/2/3/4, roman numerals, and the like, on each independent partition in the updated target mapping object, to generate a target partition text.
As can be seen from fig. 6, compared with the embodiment corresponding to fig. 2, the process 600 of the text blocking method in this embodiment embodies that, for each independent block in the target mapping object, in response to detecting a number update operation for a specified element in the independent block, a number of the specified element is updated, so as to obtain an updated number of the specified element; in response to determining that the remaining elements sequenced after the designated element exist in the independent partition, updating the numbers of the remaining elements based on the updated numbers of the designated element to obtain an updated target mapping object; and a target block text is generated based on the updated target mapping object, so that the flexibility of numbering is effectively improved, and the interaction experience of a user is further improved.
With further reference to fig. 7, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of a text segmentation apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 7, the text blocking apparatus 700 of the present embodiment includes: an extraction module 701 and a blocking module 702.
The extracting module 701 may be configured to extract element information of each paragraph in the text to be partitioned, and generate a target one-dimensional array.
The blocking module 702 may be configured to determine a first element in the target one-dimensional array as a target element and perform the target operation.
In some optional manners of this embodiment, the apparatus further includes a generation module, which may be configured to generate a target block text based on the target mapping object.
In some alternatives of this embodiment, the generating module is further configured to: for each independent block in the target mapping object, in response to detecting the number updating operation aiming at the specified element in the independent block, updating the number of the specified element to obtain the updated number of the specified element; in response to determining that the remaining elements sequenced after the designated element exist in the independent partition, updating the numbers of the remaining elements based on the updated numbers of the designated element to obtain an updated target mapping object; and generating a target block text based on the updated target mapping object.
In some optional manners of this embodiment, the updating the number of the specified element includes: and in response to determining that the designated element is the first element in the corresponding independent block, setting the number of the designated element to be the sum of the number of the last element of the last independent block and the preset step size.
In some optional manners of this embodiment, the updating the number of the specified element includes: the number of the specified element is set to the initial number.
In some optional manners of this embodiment, the preset operation further includes: and in response to determining that the category parameter of the target element is equal to the category parameter of the elements in the preset one-dimensional array, storing the target element in the preset one-dimensional array.
In some optional manners of this embodiment, the preset operation further includes: in response to the fact that the class parameter of the target element is smaller than the class parameter of the element in the preset one-dimensional array and no array exists in the preset queue corresponding to the paragraph class of the target element, storing the preset one-dimensional array as an independent block into a preset mapping object corresponding to the paragraph class of the target element, and storing the target element into a reset preset one-dimensional array; and in response to the fact that the comparison result is smaller and an array exists in a preset queue corresponding to the paragraph category of the target element, storing a preset one-dimensional array as an independent block into a preset mapping object corresponding to the paragraph category of the target element, determining a top array as an initial array, and executing a pop operation.
In some optional manners of this embodiment, the blocking operation further includes: in response to the fact that the paragraph category of the target element is determined to be a title paragraph and the preset one-dimensional array corresponding to the text paragraph is not empty, the preset one-dimensional array corresponding to the text paragraph is pushed into the preset queue corresponding to the text paragraph to obtain the pushed preset queue; storing each array in the pushed preset queue as an independent block into a preset mapping object corresponding to the text paragraph according to the category parameters
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 8 is a block diagram of an electronic device according to the text blocking method in the embodiment of the present application.
800 is a block diagram of an electronic device for a text chunking method according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 8, the electronic apparatus includes: one or more processors 801, memory 802, and interfaces for connecting the various components, including a high speed interface and a low speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). Fig. 8 illustrates an example of a processor 801.
The memory 802 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the text blocking method provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the text chunking method provided herein.
The memory 802, as a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules (e.g., the extraction module 701 and the segmentation module 702 shown in fig. 7) corresponding to the text segmentation method in the embodiments of the present application. The processor 801 executes various functional applications of the server and data processing, i.e., implements the text blocking method in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 802.
The memory 802 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of the electronic device for text blocking, and the like. Further, the memory 802 may include high speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 802 optionally includes memory located remotely from the processor 801, which may be connected to the electronic device of the text block via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the text blocking method may further include: an input device 803 and an output device 804. The processor 801, the memory 802, the input device 803, and the output device 804 may be connected by a bus or other means, and are exemplified by a bus in fig. 8.
The input device 803 may receive input numeric or character information, such as a touch screen, keypad, mouse, track pad, touch pad, pointer, one or more mouse buttons, track ball, joystick, or other input device. The output devices 804 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, the selected text is subjected to semantic-based blocking operation, the reasonability and the effectiveness of numbering are improved, and the user experience is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (11)

1. A method of text chunking, the method comprising:
extracting element information of each paragraph in a text to be blocked to generate a target one-dimensional array, wherein the element information comprises: paragraph classes and class parameters;
determining a first element in the target one-dimensional array as a target element, and executing target operation; the target operation comprises: performing a blocking operation, the blocking operation comprising: in response to determining that a preset one-dimensional array corresponding to the paragraph category of the target element is empty, storing the target element in the preset one-dimensional array; in response to determining that a preset one-dimensional array corresponding to the paragraph category of the target element is not empty, executing a preset operation according to a comparison result of the category parameter of the target element and the category parameters of the elements in the preset one-dimensional array; the preset operation comprises the following steps: in response to the fact that the class parameters of the target elements are larger than the class parameters of the elements in the preset one-dimensional array, the preset one-dimensional array is pushed into a preset queue corresponding to the paragraph class of the target elements, and the target elements are stored into the reset preset one-dimensional array;
in response to determining that the blocking operation is finished and that a next element exists in the target one-dimensional array, determining the next element as a target element, and continuing to execute the target operation;
and in response to the fact that the blocking operation is determined to be finished and the next element does not exist in the target one-dimensional array, storing a preset one-dimensional array corresponding to the paragraph category of the target element and each array in a preset queue as independent blocks into a preset mapping object corresponding to the paragraph category of the target element, and obtaining the target mapping object.
2. The method of claim 1, further comprising:
and generating a target block text based on the target mapping object.
3. The method of claim 2, wherein generating a target block text based on the target mapping object comprises:
for each independent block in the target mapping object, in response to detecting a number updating operation for a specified element in the independent block, updating the number of the specified element to obtain an updated number of the specified element;
in response to determining that the remaining elements sequenced after the specified element exist in the independent block, updating the numbers of the remaining elements based on the updated numbers of the specified element to obtain an updated target mapping object;
and generating a target block text based on the updated target mapping object.
4. The method of claim 3, the number update operation to set an attribute of a specified element to a continue number attribute, and the updating the number of the specified element, comprising:
and in response to determining that the designated element is the first element in the corresponding independent block, setting the number of the designated element as the sum of the number of the last element of the last independent block and a preset step size.
5. The method of claim 3, the numbering update operation being setting an attribute of a specified element to a renumbered attribute and the updating of the number of the specified element, comprising:
and setting the number of the specified element as an initial number.
6. The method of claim 1, wherein the preset operations further comprise:
and in response to determining that the category parameter of the target element is equal to the category parameter of the element in the preset one-dimensional array, storing the target element in the preset one-dimensional array.
7. The method of claim 1, wherein the presetting operation further comprises:
in response to the fact that the class parameter of the target element is smaller than the class parameter of the element in the preset one-dimensional array and no array exists in a preset queue corresponding to the paragraph class of the target element, storing the preset one-dimensional array as an independent block into a preset mapping object corresponding to the paragraph class of the target element, and storing the target element into a reset preset one-dimensional array;
in response to the fact that the category parameter of the target element is smaller than the category parameter of the elements in the preset one-dimensional array and an array exists in a preset queue corresponding to the paragraph category of the target element, storing the preset one-dimensional array as an independent block into a preset mapping object corresponding to the paragraph category of the target element, determining a top array of a stack as an initial array, and executing a pop operation, wherein the pop operation comprises the following steps:
in response to the fact that the class parameters of the elements in the initial array are larger than the class parameters of the target elements, the initial array is popped out as independent blocks to be stored in a preset mapping object, and whether a next array exists in a preset queue or not is judged;
in response to the fact that the class parameters of the elements in the initial array are equal to the class parameters of the target elements, popping the initial array, assigning a preset one-dimensional array, determining the assigned preset one-dimensional array as a new preset one-dimensional array, and judging whether a next array exists in a preset queue;
in response to determining that the next array exists, determining the next element as the initial array, and continuing to execute the pop operation;
and in response to determining that the class parameter of the element in the initial array is smaller than the class parameter of the target element or that no next array exists, storing the target element into a preset one-dimensional array corresponding to the paragraph class of the target element.
8. The method of claim 1, wherein the blocking operation further comprises:
in response to the fact that the paragraph category of the target element is determined to be a title paragraph and the preset one-dimensional array corresponding to the text paragraph is not empty, the preset one-dimensional array corresponding to the text paragraph is pushed into the preset queue corresponding to the text paragraph to obtain the pushed preset queue;
and storing each array in the pushed preset queue as an independent block into a preset mapping object corresponding to the text paragraph according to the category parameter.
9. A text chunking apparatus, the apparatus comprising:
the extraction module is configured to extract element information of each paragraph in a text to be blocked, and generate a target one-dimensional array, where the element information includes: paragraph classes and class parameters;
a blocking module configured to determine a first element in the target one-dimensional array as a target element, and perform a target operation, the target operation including: performing a blocking operation, the blocking operation comprising: in response to determining that a preset one-dimensional array corresponding to the paragraph category of the target element is empty, storing the target element in the preset one-dimensional array; in response to determining that a preset one-dimensional array corresponding to the paragraph category of the target element is not empty, executing a preset operation according to a comparison result of the category parameter of the target element and the category parameters of the elements in the preset one-dimensional array; the preset operation comprises the following steps: in response to the fact that the class parameters of the target elements are larger than the class parameters of the elements in the preset one-dimensional array, the preset one-dimensional array is pushed into a preset queue corresponding to the paragraph class of the target elements, and the target elements are stored into the reset preset one-dimensional array; in response to determining that the blocking operation is finished and a next element exists in the target one-dimensional array, determining the next element as a target element, and continuing to execute the target operation; and in response to the fact that the blocking operation is determined to be finished and the next element does not exist in the target one-dimensional array, storing a preset one-dimensional array corresponding to the paragraph category of the target element and each array in a preset queue as independent blocks into a preset mapping object corresponding to the paragraph category of the target element, and obtaining the target mapping object.
10. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory is stored with instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
11. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
CN202211123800.3A 2022-09-15 2022-09-15 Text blocking method and device Pending CN115470777A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211123800.3A CN115470777A (en) 2022-09-15 2022-09-15 Text blocking method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211123800.3A CN115470777A (en) 2022-09-15 2022-09-15 Text blocking method and device

Publications (1)

Publication Number Publication Date
CN115470777A true CN115470777A (en) 2022-12-13

Family

ID=84332647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211123800.3A Pending CN115470777A (en) 2022-09-15 2022-09-15 Text blocking method and device

Country Status (1)

Country Link
CN (1) CN115470777A (en)

Similar Documents

Publication Publication Date Title
CN106943747B (en) Virtual role name recommendation method and device, electronic equipment and storage medium
CN111694646A (en) Resource scheduling method and device, electronic equipment and computer readable storage medium
US11789586B2 (en) Method for displaying view and terminal device
CN110992112A (en) Method and device for processing advertisement information
CN111125057B (en) Method and device for processing service request and computer system
CN112269706A (en) Interface parameter checking method and device, electronic equipment and computer readable medium
CN111831752A (en) Distributed database space arrangement method, device, equipment and storage medium
CN110782272A (en) Advertisement display method and device for application program
CN114330249A (en) Information editing method, device, equipment and storage medium
CN114398023A (en) File generation method and page configuration method and device
US20100100824A1 (en) Graphical user interface for resource management
EP3889770A1 (en) Mini program material processing method and apparatus, electronic device, and medium
CN111881339A (en) Resource information pushing and informing method and device, electronic equipment and storage medium
CN115470777A (en) Text blocking method and device
CN113656731A (en) Advertisement page processing method and device, electronic equipment and storage medium
CN113691403A (en) Topological node configuration method, related device and computer program product
JP2022003514A (en) Tag mining method, apparatus, electronic device, computer-readable storage medium and computer program
CN112379954A (en) Data processing method, device and equipment of application program and storage medium
CN112597377A (en) Information extraction module generation method, information extraction method and device
CN105069064A (en) Vocabulary acquisition method and apparatus and vocabulary push method and apparatus
CN111723318A (en) Page data processing method, device, equipment and storage medium
CN112565472A (en) Static resource processing method and device
CN114449031B (en) Information acquisition method, device, equipment and storage medium
CN113127512B (en) Multi-data stream data splicing triggering method and device, electronic equipment and medium
US20210216597A1 (en) Method and apparatus for processing mini app material, electronic device 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