CN113988007A - Text display method and device, electronic equipment and storage medium - Google Patents

Text display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113988007A
CN113988007A CN202111624757.4A CN202111624757A CN113988007A CN 113988007 A CN113988007 A CN 113988007A CN 202111624757 A CN202111624757 A CN 202111624757A CN 113988007 A CN113988007 A CN 113988007A
Authority
CN
China
Prior art keywords
character string
target
cell
display
original
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
CN202111624757.4A
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111624757.4A priority Critical patent/CN113988007A/en
Publication of CN113988007A publication Critical patent/CN113988007A/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/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a text display method, a text display device, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring the display width requirement of an original character string in the current data item; when the display width requirement of the original character string exceeds the cell width of the current data item, detecting a public prefix code of the original character string; when the character length of the public prefix code reaches a preset threshold value, replacing the public prefix code of the original character string with an omitted identifier to obtain a corresponding target character string; wherein the display width requirement of the target character string is not more than the cell width; and displaying the target character string in the cell contained in the current data item. According to the method provided by the scheme, the public prefix code of the character string with the display width requirement exceeding the cell width in the current data item is omitted, the effective information of the character string is reserved, and meanwhile, the requirement on the display width of the character string is reduced, so that the occupation amount of the character string on the display space is prevented from increasing.

Description

Text display method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a text display method and apparatus, an electronic device, and a storage medium.
Background
With the development of computer technology and the popularization of information electronization technology, especially with the development of cloud computing and WEB technology in recent years, information management systems are widely applied in various industries, and digital management of information is realized.
However, the display width of the cells in the information management system is limited, and when an overlong data item appears, the cells are usually automatically wrapped, so that the row height of the table is increased, and the occupation amount of the display space is increased.
Disclosure of Invention
The application provides a text display method and device, electronic equipment and a storage medium, and aims to overcome the defects that the occupancy amount of a display space is increased by an ultra-long data item in the prior art.
A first aspect of the present application provides a text display method, including:
acquiring the display width requirement of an original character string in the current data item;
when the display width requirement of the original character string exceeds the cell width of the current data item, detecting a public prefix code of the original character string;
when the character length of the public prefix code reaches a preset threshold value, replacing the public prefix code of the original character string with an omitted identifier to obtain a corresponding target character string; wherein the display width requirement of the target character string is not greater than the cell width;
and displaying the target character string in a cell contained in the current data item.
Optionally, the detecting the common prefix code of the original character string includes:
traversing from an initial character to each original character string to obtain element feature vectors of each original character string;
and determining the common prefix code of the original character string according to the difference calculation result between the element feature vectors of the original character strings.
Optionally, before displaying the target character string, the method further includes:
judging whether the character length of the target character string meets a preset length standard or not;
and if so, executing the step of displaying the target character string in the cell contained in the current data item.
Optionally, the method further includes:
when the character length of the common prefix code does not reach a preset threshold value, or when the character length of the target character string does not accord with a preset length standard, detecting a common suffix code of the target character string;
and replacing the public suffix code of the target character string with an omitted identifier to obtain a new target character string.
Optionally, the method further includes:
acquiring the position coordinate of the current mouse cursor;
determining a target cell positioned by the current mouse cursor according to the position coordinate of the current mouse cursor;
generating a mouse suspension window according to the currently displayed target character string of the target cell; and displaying an original character string corresponding to the target character string in the mouse suspension window.
Optionally, the determining the target cell located by the current mouse cursor according to the position coordinate of the current mouse cursor includes:
positioning a target column from the current display interface according to the abscissa of the position coordinate of the current mouse cursor;
and positioning the target cell from the target column according to the vertical coordinate of the position coordinate of the current mouse cursor.
Optionally, the generating a mouse floating window according to the currently displayed target character string of the target cell includes:
determining a common prefix code represented by an omitted identifier in a target character string currently displayed by the target cell according to the data item to which the target cell belongs;
replacing the omitted identification in the target character string with the public prefix code to obtain a corresponding original character string;
and generating a mouse suspension window according to the display width requirement of the original character string so as to display the original character string in the mouse suspension window.
A second aspect of the present application provides a text display apparatus comprising:
the acquisition module is used for acquiring the display width requirement of the original character string in the current data item;
the detection module is used for detecting the public prefix code of the original character string when the display width requirement of the original character string exceeds the cell width of the current data item;
the replacing module is used for replacing the public prefix code of the original character string with an omitted identifier when the character length of the public prefix code reaches a preset threshold value, so as to obtain a corresponding target character string; wherein the display width requirement of the target character string is not greater than the cell width;
and the display module is used for displaying the target character string in the cell contained in the current data item.
Optionally, the detection module is specifically configured to:
traversing from an initial character to each original character string to obtain element feature vectors of each original character string;
and determining the common prefix code of the original character string according to the difference calculation result between the element feature vectors of the original character strings.
Optionally, the apparatus further comprises:
the judging module is used for judging whether the character length of the target character string meets a preset length standard or not; and if so, executing the step of displaying the target character string in the cell contained in the current data item.
Optionally, the determining module is further configured to:
when the character length of the common prefix code does not reach a preset threshold value, or when the character length of the target character string does not accord with a preset length standard, detecting a common suffix code of the target character string;
and replacing the public suffix code of the target character string with an omitted identifier to obtain a new target character string.
Optionally, the apparatus further comprises:
the mouse suspension window display module is used for acquiring the position coordinate of the current mouse cursor; determining a target cell positioned by the current mouse cursor according to the position coordinate of the current mouse cursor; generating a mouse suspension window according to the currently displayed target character string of the target cell; and displaying an original character string corresponding to the target character string in the mouse suspension window.
Optionally, the mouse floating window display module is specifically configured to:
positioning a target column from the current display interface according to the abscissa of the position coordinate of the current mouse cursor;
and positioning the target cell from the target column according to the vertical coordinate of the position coordinate of the current mouse cursor.
Optionally, the mouse floating window display module is specifically configured to:
determining a common prefix code represented by an omitted identifier in a target character string currently displayed by the target cell according to the data item to which the target cell belongs;
replacing the omitted identification in the target character string with the public prefix code to obtain a corresponding original character string;
and generating a mouse suspension window according to the display width requirement of the original character string so as to display the original character string in the mouse suspension window.
A third aspect of the present application provides an electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored by the memory to cause the at least one processor to perform the method as set forth in the first aspect above and in various possible designs of the first aspect.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon computer-executable instructions that, when executed by a processor, implement a method as set forth in the first aspect and various possible designs of the first aspect.
This application technical scheme has following advantage:
the application provides a text display method, a text display device, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring the display width requirement of an original character string in the current data item; when the display width requirement of the original character string exceeds the cell width of the current data item, detecting a public prefix code of the original character string; when the character length of the public prefix code reaches a preset threshold value, replacing the public prefix code of the original character string with an omitted identifier to obtain a corresponding target character string; wherein the display width requirement of the target character string is not more than the cell width; and displaying the target character string in the cell contained in the current data item. According to the method provided by the scheme, the public prefix code of the character string with the display width requirement exceeding the cell width in the current data item is omitted, the effective information of the character string is reserved, and meanwhile, the requirement on the display width of the character string is reduced, so that the occupation amount of the character string on the display space is prevented from increasing.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art according to these drawings.
Fig. 1 is a schematic structural diagram of a text display system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a text display method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a text display device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following examples, "plurality" means two or more unless specifically limited otherwise.
The table/list has the advantages of large information carrying capacity, convenience in sorting and batch operation and the like in the display form. In WEB systems, especially backend WEB systems that are biased towards management, there are a large number of tables/lists applied. In a typical cloud management platform system and information management system, a host list, a virtual machine list, an organization list, a personnel list, and the like are shown in a form/list. In actual development and application practice, it is often found that although tables/lists have many advantages, a situation that a single cell display space is limited occurs, and a problem that effective information acquisition is difficult and the like due to the fact that long data items are displayed in an unattractive manner or cannot be displayed completely exists. The common processing mode is that the character strings in the overlong data items are automatically wrapped, the height of the row in the table and the list is increased, and the occupation amount of the display space is increased. Or, by controlling through a CSS style (overlap: hidden; text-overlap: encapsulating), the embodiments of the present application arrange from left to right and control the tail bytes of the character string to be displayed as ellipses, but in a scenario where the character string has a long common prefix, such a processing manner has a problem of difficulty in obtaining effective information.
In view of the above problems, the text display method, the text display device, the electronic device, and the storage medium provided in the embodiments of the present application obtain a display width requirement of an original character string in a current data item; when the display width requirement of the original character string exceeds the cell width of the current data item, detecting a public prefix code of the original character string; when the character length of the public prefix code reaches a preset threshold value, replacing the public prefix code of the original character string with an omitted identifier to obtain a corresponding target character string; wherein the display width requirement of the target character string is not more than the cell width; and displaying the target character string in the cell contained in the current data item. According to the method provided by the scheme, the public prefix code of the character string with the display width requirement exceeding the cell width in the current data item is omitted, the effective information of the character string is reserved, and meanwhile, the requirement on the display width of the character string is reduced, so that the occupation amount of the character string on the display space is prevented from increasing.
The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
First, a structure of a text display system based on the present application will be described:
the text display method and device, the electronic equipment and the storage medium are suitable for displaying the long text character string to the information management list of the web system. As shown in fig. 1, the structure diagram of a text display system based on the embodiment of the present application mainly includes a data acquisition device, a web system, and a text display device. Specifically, a data acquisition device acquires an original character string and a display width requirement corresponding to a certain data item in an information management list of the web system, then the acquired data are sent to a text display device, the device processes the original character string according to the information and the cell width of the data item to obtain a target character string, and finally the target character string is displayed in a corresponding cell.
The embodiment of the application provides a text display method, which is used for displaying a long text character string to an information management list of a web system, wherein a network architecture of the web system adopts a B/S architecture, and an execution main body of the embodiment of the application is an electronic device, such as a server, a desktop computer, a notebook computer, a tablet computer and other electronic devices which can be used for character string management.
As shown in fig. 2, a schematic flow chart of a text display method provided in an embodiment of the present application is shown, where the method includes:
step 201, obtaining the display width requirement of the original character string in the current data item.
It should be noted that the display width requirement is different from the length of the character string, the length of the character string represents the number of characters included in the character string, and the display width requirement represents a display width required when the character string is displayed according to a preset font size and a preset font style, that is, the display width requirement may be pixel size information.
Step 202, when the display width requirement of the original character string exceeds the cell width of the current data item, detecting the common prefix code of the original character string.
The data item may refer to a header of the list, such as a model number or a name, and the cell width of the data item may refer to a display width of a cell for recording data under the data item.
Specifically, when the display width requirement of the original character string exceeds the cell width of the current data item, it may be determined that the cell of the current data item cannot be completely displayed without changing its size, and therefore, in order to reduce the display width requirement of the original character string, the common prefix code of the original character string may be detected.
Conversely, when the display width requirement of the original character string does not exceed the cell width of the current data item, the original character string can be directly and completely displayed in the corresponding cell.
And 203, when the character length of the public prefix code reaches a preset threshold value, replacing the public prefix code of the original character string with an omitted identifier to obtain a corresponding target character string.
And the display width requirement of the target character string is not more than the cell width. The preset threshold corresponding to the character length of the public prefix code can be set according to the actual cell width, and the embodiment of the application is not limited.
Specifically, a plurality of character strings are recorded under any data item, and under the condition that the common prefix codes of all the original character strings corresponding to the current data item are determined, if the character length of the common prefix codes reaches a preset threshold value, the common prefix codes of the original character strings can be uniformly replaced by omitted identifiers, such as ellipses, to obtain corresponding target character strings, so that the display width requirement of the original character strings is reduced, and the display width requirement of the current target character strings is not greater than the cell width.
Illustratively, if the current data item is "device name", the corresponding original character strings include Sdgxt-vdc1-bgxt, Sdgxt-vdc 1-wxt, Sdgxt-vdc1-nbwz, Sdgxt-vcd1-ywxt, Sdgxt-vdc1-sjkxt, Sdgxt-vdc1-mysql and Sdgxt-vdc1-redis, the common prefix codes of the original character strings can be determined to be "Sdgxt-vgdc 1-and" character length is 11, if the preset threshold is 8, the common prefix codes can be replaced by omitting identifiers, and the obtained target character strings include … bgxt, … wxt, … nbwz, … ywxt, … sjkxt, … mysll and … redis, and the required character string display width is reduced while the valid character string information is retained.
And step 204, displaying the target character string in the cell contained in the current data item.
Specifically, the obtained target character string may be displayed in an information management list of the web system, specifically in a cell included in the current data item, so as to record the target character string under the current data item.
It should be noted that, in practical applications, a situation that the display width requirement of an original character string corresponding to a certain data item is inconsistent due to different character lengths may occur, in this case, only the display width requirement of a part of the original character string may exceed the cell width, and at this time, the character string management may be performed by taking an array as a unit. For example, setting the cell width as VW, traversing the original text array (length is len), calculating the display width requirement (denoted as TWn) of each original character string in the original text array, and for the set TW = { TWn | n ≧ 1, n ≦ len }, if any TWn > VW exists, performing common prefix detection on all original character strings in the original text array, and further obtaining the corresponding target character string.
On the basis of the foregoing embodiment, as an implementable manner, in an embodiment, detecting the common prefix code of the original character string includes:
step 2021, for each original character string, traversing from the first character to obtain an element feature vector of each original character string;
step 2022, determining the common prefix code of the original character string according to the difference calculation result between the element feature vectors of each original character string.
Specifically, after obtaining the element feature vectors of all the original character strings, differences can be made between every two character strings to obtain difference calculation results, and the character lengths of the public prefix codes of the whole original character strings are determined according to the position of the first non-0 character in the difference calculation results, so that the corresponding public prefix codes are determined.
Illustratively, when the original character string includes Sdgxt-vdc1-bgxt and Sdgxt-vdc1-wwxt, corresponding element feature vectors are (S, d, g, x, t, -, v, d, c,1, -, b, g, x, t) and (S, d, g, x, t, -, v, d, c,1, -, w, w, x, t), respectively, and the difference calculation result of the two is (0, 0,0,0,0,0,0,0, (b-w), (g-w),0, 0), and the position of the first non-0 character (b-w) is 12, the character length of the common prefix code of the two original character strings can be determined to be 11, and therefore the first 11 characters of the two original character strings can be determined to be the common prefix code.
Similarly, a string matching algorithm (Z algorithm) may also be used to calculate the common prefix length of all the original strings, and the specific calculation process may refer to the prior art, which is not limited in the embodiment of the present application.
On the basis of the foregoing embodiment, to ensure that the display width requirement of the obtained target character string is not greater than the cell width, as an implementable manner, in an embodiment, before displaying the target character string, the method further includes:
step 301, judging whether the character length of the target character string meets a preset length standard;
step 302, if yes, executing the step of displaying the target character string in the cell included in the current data item.
Specifically, the maximum character length that can be displayed by the current cell width may be determined according to the current cell width and the character size and font set by the current information management list, and then, according to a size relationship between the maximum character length (preset length standard) and the current character length of the target character string, it is determined whether the character length of the target character string meets the preset length standard.
Accordingly, in one embodiment, when the character length of the common prefix code does not reach the preset threshold, or when the character length of the target character string does not meet the preset length standard, the common suffix code of the target character string is detected; and replacing the public suffix code of the target character string with the omitted identifier to obtain a new target character string.
The determination process of the common suffix code may refer to the determination process of the common prefix code provided in the foregoing embodiment, and the implementation principles of the two are the same, which is not described again.
On the basis of the foregoing embodiment, in order to facilitate the user to read the complete character string information, as an implementable manner, in an embodiment, the method further includes:
step 401, obtaining the position coordinates of the current mouse cursor;
step 402, determining a target cell positioned by the current mouse cursor according to the position coordinate of the current mouse cursor;
and step 403, generating a mouse floating window according to the target character string currently displayed by the target cell.
And the original character string corresponding to the target character string is displayed in the mouse floating window.
Specifically, the position coordinate of the current mouse cursor of the user may be captured, then the target cell to be read by the current user is determined according to the position coordinate, and then a mouse floating window is generated near the current mouse cursor, that is, near the target cell, so as to display the original character string corresponding to the target character string currently displayed by the target cell.
Illustratively, a tip tool (tooltip) may be utilized to automatically appear or pop up a tip window (mouse hover window) when a user pauses the mouse pointer at some UI element (e.g., cell), and to close the mouse hover window when the mouse is moved out of the element (target cell) or tip window desired to be pointed.
Specifically, in an embodiment, the target column may be located from the current display interface according to an abscissa of a position coordinate of the current mouse cursor; and positioning the target cell from the target column according to the vertical coordinate of the position coordinate of the current mouse cursor.
The position coordinate of the current mouse cursor specifically refers to a position coordinate of the current mouse cursor on a current web interface (display interface).
Specifically, the current display interface displays an information management list, and may locate a target column from the current display interface according to the position information of each column of the information management list and the abscissa of the position coordinate of the current mouse cursor, and then locate a target cell from the target column according to the position information of each cell in the target column and the ordinate of the position coordinate of the current mouse cursor.
Specifically, in an embodiment, a common prefix code represented by an omitted identifier in a target character string currently displayed by a target cell may be determined according to a data item to which the target cell belongs; replacing the omitted identification in the target character string with a public prefix code to obtain a corresponding original character string; and generating a mouse floating window according to the display width requirement of the original character string so as to display the original character string in the mouse floating window.
It should be noted that, after replacing the common prefix code of the original character string of the data item with the omission identifier, a character string modification log may be generated for the data item to record the common prefix code characterized by the omission identifier in the modified target character string.
Specifically, after a data item to which a target cell belongs is determined, a character string modification log of the data item can be read, a common prefix code represented by an omission identifier in a target character string currently displayed by the target cell is determined according to the content of the read character string modification log, the omission identifier in the target character string is replaced by the common prefix code to restore a corresponding original character string, and finally, the size of a mouse floating window to be generated is determined according to the display width requirement of the original character string to ensure that the final generated mouse floating window can completely display the original character string.
According to the text display method provided by the embodiment of the application, the display width requirement of the original character string in the current data item is acquired; when the display width requirement of the original character string exceeds the cell width of the current data item, detecting a public prefix code of the original character string; when the character length of the public prefix code reaches a preset threshold value, replacing the public prefix code of the original character string with an omitted identifier to obtain a corresponding target character string; wherein the display width requirement of the target character string is not more than the cell width; and displaying the target character string in the cell contained in the current data item. According to the method provided by the scheme, the public prefix code of the character string with the display width requirement exceeding the cell width in the current data item is omitted, the effective information of the character string is reserved, and meanwhile, the requirement on the display width of the character string is reduced, so that the occupation amount of the character string on the display space is prevented from increasing. And a mouse floating window capable of displaying the complete original character string is generated for the user, so that the user can read the complete character string information conveniently.
The embodiment of the application provides a text display device, which is used for executing the text display method provided by the embodiment.
Fig. 3 is a schematic structural diagram of a text display device according to an embodiment of the present application. The text display device 30 includes: an acquisition module 301, a detection module 302, a replacement module 303, and a display module 304.
The acquisition module is used for acquiring the display width requirement of an original character string in the current data item; the detection module is used for detecting the public prefix code of the original character string when the display width requirement of the original character string exceeds the cell width of the current data item; the replacing module is used for replacing the public prefix code of the original character string with the omitted identifier when the character length of the public prefix code reaches a preset threshold value, so as to obtain a corresponding target character string; wherein the display width requirement of the target character string is not more than the cell width; and the display module is used for displaying the target character string in the cell contained in the current data item.
Specifically, in an embodiment, the detection module is specifically configured to:
traversing from the first character to each original character string to obtain element feature vectors of each original character string;
and determining the common prefix code of the original character string according to the difference calculation result between the element feature vectors of the original character strings.
Specifically, in one embodiment, the apparatus further comprises:
the judging module is used for judging that the character length of the target character string meets a preset length standard; if yes, the step of displaying the target character string in the cell contained in the current data item is executed.
Specifically, in an embodiment, the determining module is further configured to:
when the character length of the common prefix code does not reach a preset threshold value, or when the character length of the target character string does not accord with a preset length standard, detecting the common suffix code of the target character string;
and replacing the public suffix code of the target character string with the omitted identifier to obtain a new target character string.
Specifically, in one embodiment, the apparatus further comprises:
the mouse suspension window display module is used for acquiring the position coordinate of the current mouse cursor; determining a target cell positioned by the current mouse cursor according to the position coordinate of the current mouse cursor; generating a mouse suspension window according to a target character string currently displayed by a target cell; and the original character string corresponding to the target character string is displayed in the mouse floating window.
Specifically, in an embodiment, the mouse floating window display module is specifically configured to:
positioning a target column from the current display interface according to the abscissa of the position coordinate of the current mouse cursor;
and positioning the target cell from the target column according to the vertical coordinate of the position coordinate of the current mouse cursor.
Specifically, in an embodiment, the mouse floating window display module is specifically configured to:
determining a common prefix code represented by an omitted identifier in a target character string currently displayed by the target cell according to the data item to which the target cell belongs;
replacing the omitted identification in the target character string with a public prefix code to obtain a corresponding original character string;
and generating a mouse floating window according to the display width requirement of the original character string so as to display the original character string in the mouse floating window.
With regard to the text display device in the present embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The text display device provided in the embodiment of the present application is configured to execute the text display method provided in the above embodiment, and an implementation manner of the text display device is the same as a principle, and is not described again.
The embodiment of the application provides electronic equipment which is used for executing the text display method provided by the embodiment.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 40 includes: at least one processor 41 and memory 42;
the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored by the memory to cause the at least one processor to perform the text display method as provided by the above embodiments.
The electronic device provided by the embodiment of the application is used for executing the text display method provided by the embodiment, and the implementation manner and the principle of the electronic device are the same, and are not described again.
The embodiment of the application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the text display method provided in any one of the above embodiments is implemented.
The storage medium containing the computer-executable instructions of the embodiment of the present application may be used to store the computer-executable instructions of the text display method provided in the foregoing embodiment, and the implementation manner and the principle thereof are the same and are not described again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A text display method, comprising:
acquiring the display width requirement of an original character string in the current data item;
when the display width requirement of the original character string exceeds the cell width of the current data item, detecting a public prefix code of the original character string;
when the character length of the public prefix code reaches a preset threshold value, replacing the public prefix code of the original character string with an omitted identifier to obtain a corresponding target character string; wherein the display width requirement of the target character string is not greater than the cell width;
and displaying the target character string in a cell contained in the current data item.
2. The method of claim 1, wherein the detecting the common prefix code of the original string comprises:
traversing from an initial character to each original character string to obtain element feature vectors of each original character string;
and determining the common prefix code of the original character string according to the difference calculation result between the element feature vectors of the original character strings.
3. The method of claim 1, wherein prior to displaying the target string, the method further comprises:
judging whether the character length of the target character string meets a preset length standard or not;
and if so, executing the step of displaying the target character string in the cell contained in the current data item.
4. The method of claim 3, further comprising:
when the character length of the common prefix code does not reach a preset threshold value, or when the character length of the target character string does not accord with a preset length standard, detecting a common suffix code of the target character string;
and replacing the public suffix code of the target character string with an omitted identifier to obtain a new target character string.
5. The method of claim 1, further comprising:
acquiring the position coordinate of the current mouse cursor;
determining a target cell positioned by the current mouse cursor according to the position coordinate of the current mouse cursor;
generating a mouse suspension window according to the currently displayed target character string of the target cell; and displaying an original character string corresponding to the target character string in the mouse suspension window.
6. The method of claim 5, wherein determining the target cell located by the current mouse cursor according to the position coordinates of the current mouse cursor comprises:
positioning a target column from the current display interface according to the abscissa of the position coordinate of the current mouse cursor;
and positioning the target cell from the target column according to the vertical coordinate of the position coordinate of the current mouse cursor.
7. The method of claim 5, wherein generating a mouse hover window based on a target string currently displayed by the target cell comprises:
determining a common prefix code represented by an omitted identifier in a target character string currently displayed by the target cell according to the data item to which the target cell belongs;
replacing the omitted identification in the target character string with the public prefix code to obtain a corresponding original character string;
and generating a mouse suspension window according to the display width requirement of the original character string so as to display the original character string in the mouse suspension window.
8. A text display apparatus, comprising:
the acquisition module is used for acquiring the display width requirement of the original character string in the current data item;
the detection module is used for detecting the public prefix code of the original character string when the display width requirement of the original character string exceeds the cell width of the current data item;
the replacing module is used for replacing the public prefix code of the original character string with an omitted identifier when the character length of the public prefix code reaches a preset threshold value, so as to obtain a corresponding target character string; wherein the display width requirement of the target character string is not greater than the cell width;
and the display module is used for displaying the target character string in the cell contained in the current data item.
9. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of any of claims 1-7.
10. A computer-readable storage medium having computer-executable instructions stored thereon which, when executed by a processor, implement the method of any one of claims 1 to 7.
CN202111624757.4A 2021-12-29 2021-12-29 Text display method and device, electronic equipment and storage medium Pending CN113988007A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111624757.4A CN113988007A (en) 2021-12-29 2021-12-29 Text display method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111624757.4A CN113988007A (en) 2021-12-29 2021-12-29 Text display method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113988007A true CN113988007A (en) 2022-01-28

Family

ID=79734782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111624757.4A Pending CN113988007A (en) 2021-12-29 2021-12-29 Text display method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113988007A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114912416A (en) * 2022-07-18 2022-08-16 北京亮亮视野科技有限公司 Voice translation result display method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708774A (en) * 2012-04-19 2012-10-03 广东威创视讯科技股份有限公司 Display method of character strings and system thereof
CN102902659A (en) * 2012-09-18 2013-01-30 珠海金山办公软件有限公司 Method and terminal for processing numeric character strings in electronic form
CN109002505A (en) * 2018-06-29 2018-12-14 郑州云海信息技术有限公司 A kind of display methods and relevant apparatus of target string

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708774A (en) * 2012-04-19 2012-10-03 广东威创视讯科技股份有限公司 Display method of character strings and system thereof
CN102902659A (en) * 2012-09-18 2013-01-30 珠海金山办公软件有限公司 Method and terminal for processing numeric character strings in electronic form
CN109002505A (en) * 2018-06-29 2018-12-14 郑州云海信息技术有限公司 A kind of display methods and relevant apparatus of target string

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114912416A (en) * 2022-07-18 2022-08-16 北京亮亮视野科技有限公司 Voice translation result display method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US9348799B2 (en) Forming a master page for an electronic document
CN110705503B (en) Method and device for generating directory structured information
CN113988007A (en) Text display method and device, electronic equipment and storage medium
CN109347899B (en) Method for writing log data in distributed storage system
CN117369731B (en) Data reduction processing method, device, equipment and medium
CN107704341A (en) File access pattern method, apparatus and electronic equipment
CN111414728B (en) Numerical data display method, device, computer equipment and storage medium
CN112084103B (en) Interface test method, device, equipment and medium
CN113762455A (en) Detection model training method, single character detection method, device, equipment and medium
CN111597336A (en) Processing method and device of training text, electronic equipment and readable storage medium
WO2022105120A1 (en) Text detection method and apparatus from image, computer device and storage medium
CN112506976B (en) Data flow display method and device, electronic equipment and storage medium
CN112148486B (en) Memory page management method, device, equipment and readable storage medium
CN110826488B (en) Image identification method and device for electronic document and storage equipment
CN109299294B (en) Resource searching method and device in application, computer equipment and storage medium
CN110765377B (en) Data loading method and device
CN109460511B (en) Method and device for acquiring user portrait, electronic equipment and storage medium
CN107741992B (en) Network storage method and device for conference records, intelligent tablet and storage medium
CN112463844A (en) Data processing method and device, electronic equipment and storage medium
CN112861504A (en) Text interaction method, device, equipment, storage medium and program product
CN111667562B (en) Picture material-based dynamic effect interface generation method and device
CN112801030B (en) Target text region positioning method and device
CN111723052B (en) Editing method and device for large file data
CN111368113B (en) Commodity data display method, system, medium and equipment
CN109933985B (en) Method, device and equipment for bypassing hook and computer storage 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220128