Unlock instant, AI-driven research and patent intelligence for your innovation.

Text data storage method and device

A text data and data structure technology, applied in the field of text processing, can solve the problem of low efficiency of target characters

Active Publication Date: 2020-06-30
HANGZHOU ANHENG INFORMATION TECH CO LTD
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In view of this, the purpose of the present invention is to provide a text data storage method and device to alleviate the technical problem of low efficiency in the prior art when locating target characters in text

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Text data storage method and device
  • Text data storage method and device
  • Text data storage method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0110] The embodiment of the present invention provides a storage method for the number of text characters, such as figure 2 shown, including:

[0111] Step S12, acquiring the text data and the data to be stored in the text data at the current moment.

[0112] Step S14, read the number of characters of the data to be stored, and read the position of the data to be stored in the text data, the position includes: the number of rows or the number of columns.

[0113] Specifically, in the case of text data sorted by row, the position includes row; and in the case of text data sorted by column, the position includes column.

[0114] Step S16, search for the node corresponding to the position in the pre-built binary tree data structure, and determine the number of characters as the node value of the corresponding node to store the number of characters, wherein the binary tree data structure is pre-ordered according to the middle order of the binary tree The traversal order specif...

Embodiment 2

[0169] The embodiment of the present invention also provides a storage device for text data, such as Figure 9 shown, including:

[0170] Acquisition module 100, for obtaining the data to be stored in the text data and the text data at the current moment;

[0171] The reading module 200 is used to read the number of characters of the data to be stored, and read the position of the data to be stored in the text data, the position includes: the number of rows or the number of columns;

[0172] The determination module 300 is used to search for the node corresponding to the position in the pre-built binary tree data structure, and determine the number of characters as the node value of the corresponding node, so as to store the number of characters, wherein the binary tree data structure is in advance according to the binary tree The inorder traversal order of specifies the storage order of the nodes.

[0173] In the embodiment of the present invention, the acquisition module 1...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a text data storage method and apparatus, and relates to the technical field of text processing. The method comprises the steps of obtaining text data and to-be-stored data in the text data at a current moment; reading a character number of the to-be-stored data, and reading the position of the to-be-stored data in the text data, wherein the position comprises a row number or a column number; and searching for a node corresponding to the position in a pre-built binary tree data structure, and determining the character number as a node value of the corresponding node, thereby storing the character number, wherein the binary tree data structure defines a storage sequence of nodes previously according to an inorder traversal sequence of a binary tree. The character number of each row or each column in the text data is stored by utilizing the binary tree data structure, so that the technical problem of relatively low efficiency of locating target characters in a text in the prior art is relieved.

Description

technical field [0001] The present invention relates to the technical field of text processing, in particular to a text data storage method and device. Background technique [0002] The storage of text characters is essentially the storage of continuous character sequences. The traditional continuous character sequence storage methods include arrays and linked lists. In these two storage methods, after characters are inserted or deleted in the text, the text after the modified position needs to be shifted, so that the characters and characters in the text The correspondence between the number of rows at has changed. [0003] However, for modern text editors, the continuous maintenance of the corresponding relationship between text characters and their line numbers is conducive to quickly locating the target characters when the text is read and edited, and has high practicality in scenarios such as code editing. the value of. The positioning method in the prior art is to s...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/31
CPCG06F16/322
Inventor 孔令威范渊吴鸣旦
Owner HANGZHOU ANHENG INFORMATION TECH CO LTD