CN110609981A - Text processing method and device, electronic equipment and computer readable storage medium - Google Patents

Text processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN110609981A
CN110609981A CN201910813197.3A CN201910813197A CN110609981A CN 110609981 A CN110609981 A CN 110609981A CN 201910813197 A CN201910813197 A CN 201910813197A CN 110609981 A CN110609981 A CN 110609981A
Authority
CN
China
Prior art keywords
text
character
characters
content
text content
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
CN201910813197.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 Dike Technology Co Ltd
Original Assignee
Beijing Dike 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 Dike Technology Co Ltd filed Critical Beijing Dike Technology Co Ltd
Priority to CN201910813197.3A priority Critical patent/CN110609981A/en
Publication of CN110609981A publication Critical patent/CN110609981A/en
Pending legal-status Critical Current

Links

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure relates to a text processing method, a text processing device, an electronic device and a storage medium. Wherein, the method comprises the following steps: acquiring first text content to be displayed, wherein the first text content comprises at least one text character which accords with the condition of a text to be processed; determining character characteristics of text characters in the first text content, and preprocessing the text characters according to the character characteristics to obtain second text content comprising standard text characters; and drawing the second text content to the appointed position of the canvas according to the preset drawing attribute. According to the method and the device, reasonable display of the composite text is achieved through preprocessing of the text to be displayed, and user experience is improved.

Description

Text processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of text processing, and in particular, to a text processing method, apparatus, electronic device, and computer-readable storage medium.
Background
On electronic equipment such as mobile phones and computers, text display is one of the most basic and important functions, but if mixed arrangement of Chinese and English is met in text input, the phenomenon of text accidental line feed due to overlong English words can be caused, on one hand, text display is discontinuous and irregular and attractive, on the other hand, extra space is occupied to completely display the fed text, and particularly when the text is displayed on a mobile phone, due to the fact that the screen of the mobile phone is small, the accidental line feed display of the text can cause poor experience of users.
Accordingly, there is a need for one or more methods to address the above-mentioned problems.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the present disclosure is to provide a text processing method, apparatus, electronic device, and computer-readable storage medium, thereby overcoming, at least to some extent, one or more problems due to limitations and disadvantages of the related art.
According to an aspect of the present disclosure, there is provided a text processing method including:
acquiring first text content to be displayed, wherein the first text content comprises at least one text character which accords with the condition of a text to be processed;
determining character characteristics of text characters in the first text content, and preprocessing the text characters according to the character characteristics to obtain second text content comprising standard text characters;
and drawing the second text content to the appointed position of the canvas according to the preset drawing attribute.
In an exemplary embodiment of the disclosure, determining character characteristics of text characters in the first text content includes:
traversing code modules corresponding to text characters in the first text content according to the index values;
and matching the code module with a preset code table, and determining the character characteristics of the text characters according to the matching result.
In an exemplary embodiment of the present disclosure, the character features include supplementary character features, and the text characters are preprocessed according to the character features, including:
if the character characteristics of the current text characters are judged to be supplementary character characteristics according to the code module, determining that the current text characters are supplementary characters;
merging the supplementary character with a preset amount of text arranged before the supplementary character into the standard text character.
In an exemplary embodiment of the present disclosure, the method further comprises:
if the current text character is determined to be an addendum character, skipping the addendum character and continuing to traverse the next text character.
In an exemplary embodiment of the present disclosure, the character features include a prefix/suffix feature, and the preprocessing the text character according to the character features includes:
if the character characteristics of the current text character are judged to be the prefix/suffix character characteristics according to the code module, determining that the current text character is a prefix character or a suffix character;
adding a specific mark to the front character of the prefix character, or adding a specific mark to the rear character of the suffix character.
In an exemplary embodiment of the present disclosure, preprocessing the text character according to character features to obtain a second text content including standard text characters, includes:
and measuring the standard text characters according to a character measurement algorithm, and packaging the standard text characters according to a preset arrangement rule according to a measurement result to generate second text content.
In an exemplary embodiment of the present disclosure, the text characters meeting the text condition to be processed include english characters, and the drawing the second text content to the specified position of the canvas according to the preset drawing attribute includes:
determining an English text consisting of English characters according to space characters in front of and/or behind the English characters;
determining whether the english text is drawn in a plurality of lines in the designated position;
and if so, setting the English text in one of the multiple lines for display.
In one aspect of the present disclosure, there is provided a text processing apparatus including:
the text acquisition module is used for acquiring first text content to be displayed, wherein the first text content comprises at least one text character which accords with the condition of a text to be processed;
the preprocessing module is used for determining character characteristics of text characters in the first text content and preprocessing the text characters according to the character characteristics to obtain second text content comprising standard text characters;
and the text drawing module is used for drawing the second text content to the appointed position of the canvas according to the preset drawing attribute.
In one aspect of the present disclosure, there is provided an electronic device including:
a processor; and
a memory having computer readable instructions stored thereon which, when executed by the processor, implement a method according to any of the above.
In an aspect of the disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, realizes the method according to any one of the above.
The text processing method in the exemplary embodiment of the present disclosure obtains a first text content to be displayed, where the first text content includes at least one text character meeting a condition of a text to be processed; determining character characteristics of text characters in the first text content, and preprocessing the text characters according to the character characteristics to obtain second text content comprising standard text characters; and drawing the second text content to the appointed position of the canvas according to the preset drawing attribute. According to the method and the device, reasonable display of the text under the reproduction condition is realized through preprocessing of the text to be displayed, the problem of accidental line changing of Chinese-English mixed lines is solved, and user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The above and other features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
FIG. 1 shows a flow diagram of a text processing method according to an example embodiment of the present disclosure;
2A-2D illustrate schematic diagrams of an application scenario of a text processing method according to an exemplary embodiment of the present disclosure;
FIG. 3 shows a schematic block diagram of a text processing apparatus according to an exemplary embodiment of the present disclosure;
FIG. 4 schematically illustrates a block diagram of an electronic device according to an exemplary embodiment of the present disclosure; and
fig. 5 schematically illustrates a schematic diagram of a computer-readable storage medium according to an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the embodiments of the disclosure can be practiced without one or more of the specific details, or with other methods, components, materials, devices, steps, and so forth. In other instances, well-known structures, methods, devices, implementations, materials, or operations are not shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in the form of software, or in one or more software-hardened modules, or in different networks and/or processor devices and/or microcontroller devices.
In the present exemplary embodiment, a text processing method is first provided; referring to fig. 1, the text processing method may include the steps of:
step S110, obtaining a first text content to be displayed, wherein the first text content comprises at least one text character which accords with the condition of a text to be processed;
step S120, determining character characteristics of text characters in the first text content, and preprocessing the text characters according to the character characteristics to obtain second text content comprising standard text characters;
and step S130, drawing the second text content to the appointed position of the canvas according to the preset drawing attribute.
The text processing method in the exemplary embodiment of the present disclosure obtains a first text content to be displayed, where the first text content includes at least one text character meeting a condition of a text to be processed; determining character characteristics of text characters in the first text content, and preprocessing the text characters according to the character characteristics to obtain second text content comprising standard text characters; and drawing the second text content to the appointed position of the canvas according to the preset drawing attribute. According to the method and the device, reasonable display of the text under the reproduction condition is realized through preprocessing of the text to be displayed, the problem of accidental line changing of Chinese-English mixed lines is solved, and user experience is improved.
Next, a text processing method in the present exemplary embodiment will be further described.
In step S110, a first text content to be displayed may be obtained, where the first text content includes at least one text character meeting a condition of a text to be processed.
The obtained first text content is text characters input by a user in an editing text, for example, a text input in a document such as a word, or a text input in a function input box in an APP, and each text character corresponds to at least one code module. The text of the text condition to be processed is a text containing Chinese characters and English characters, or a text containing only English characters, especially under the condition that an English word is too long, as shown in FIG. 2A, the text is a section of characters containing Chinese and English characters in mixed arrangement, and due to the fact that the English word is too long, line feed processing is performed during display, too much whites are left, and user experience is poor.
In step S120, the character features of the text characters in the first text content may be determined, and the text characters are preprocessed according to the character features to obtain a second text content including standard text characters.
In an embodiment of the present example, determining character characteristics of text characters in the first text content comprises: traversing code modules corresponding to text characters in the first text content according to the index values; and matching the code module with a preset code table, and determining the character characteristics of the text characters according to the matching result.
The first text character which is acquired through the steps and contains the condition of the text to be processed is taken as input, each code module corresponding to each text character in the first text content is traversed, index is taken as a traversal index value, all display characters under the index are taken out by using codePointAt based on a preset coding table, the preset coding table can be GB 2312, GBK, Unicode and the like, and can also be other coding tables, and the method is not particularly limited in the invention. By matching the code module with a preset code table, the character characteristics of each text character in the first text content can be determined. Character features may include supplementary character features, prefix/suffix features, format features (e.g., space characters, etc.).
In an embodiment of the present example, when the character features include supplementary character features, preprocessing the text character by character features includes: if the character characteristics of the current text characters are judged to be supplementary character characteristics according to the code module, determining that the current text characters are supplementary characters; merging the supplementary character with a preset amount of text arranged before the supplementary character into the standard text character.
Generally, characters are stored in a UTF-16 format, each character is fixed to be 2 bytes, and since characters with Unicode code points larger than 0xFFFF need to be stored in 4 bytes, in the process of taking out all display characters under index by using codePoint based on a preset coding table, a situation that a text character comprises an addendum character exists, whether the current text character is an addendum character needs to be determined, and specifically, whether the character is an addendum character can be judged by traversing a code module by using issupplementary CodePoint.
In an embodiment of the present example, the method further comprises: if the current text character is determined to be an addendum character, skipping the addendum character and continuing to traverse the next text character.
If a first text content to be displayed contains uncommon words ""is given by dayOne of the descriptors of the Chinese character structure, which represents the left and right structures), because the common input method can only input the traditional '', can not input the simplified 'daily' character, and can only occupy two character displays (i.e. 4-byte storage). After traversing the code module corresponding to the text character in the first text content according to the index value, matching the code module with a preset coding table, when determining the character characteristics of the text character according to the matching result, determining the rear character of the character "seeing" of the day "as the supplementary character, and then combining the supplementary character" seeing "and the text of the" day "arranged before the supplementary character as the standard text character. Thus, after determining that the current text character is an addendum character, the addendum character is skipped to continue traversing the next text character. As shown in fig. 2B, the display effect of "daily" when the text is displayed is an effect diagram occupying only one text character position, and the display effect is better.
In the exemplary embodiment, the character features include a prefix/suffix feature, and the preprocessing the text character according to the character features includes: if the character characteristics of the current text character are judged to be the prefix/suffix character characteristics according to the code module, determining that the current text character is a prefix character or a suffix character; adding a specific mark to the front character of the prefix character or adding a specific mark to the rear character of the suffix character.
In the embodiment of the present example, as shown in fig. 2C, which is a schematic diagram of an application scenario of the present disclosure, if the character feature of the current text character is determined to be a prefix character or a suffix character according to the code module, the current text character is determined to be a prefix character or a suffix character; if the last two characters of a certain first text content are full texts and are accompanied by hyperlink attributes, the character is judged to be a suffix character, a specific identifier 'full texts' is added to the rear character of the suffix character, and the 'full texts' are displayed in a color distinguishing mode so that a user can further distinguish the text from the suffix text.
In the embodiment of the present example, preprocessing the text character according to character features to obtain a second text content including standard text characters, includes: and measuring the standard text characters according to a character measurement algorithm, and packaging the standard text characters according to a preset arrangement rule according to a measurement result to generate second text content.
After traversing the first text content and identifying the special character, prefix and suffix features, the number of characters displayed for the first text content can be determined, at which point a set can be declared that is used to place the text content data to be displayed for each line. The first text content is measured using a character measurement algorithm and the measured text content is added to the set according to the required rules of the set, generating a second text content.
In step S130, the second text content may be drawn to a designated position of the canvas according to the preset drawing attribute.
In the embodiment of the present example, after traversing all the elements in the set containing the second text content again, preset drawing attributes such as a predefined line height, a font size, a line spacing and the like are obtained at the same time, for example, the predefined line height is 20, the font size is 16, the line spacing is 4, and the traversed elements are drawn into the canvas according to the specified position information in the canvas. As shown in fig. 2D, in the example that the display effect is poor due to the fact that the english word is too long, the display content extracts the character features and performs preprocessing, and then the obtained second text content is displayed. According to the graph, after the English text composed of the English characters is determined according to the space characters in front of and/or behind the English characters, the English word positions are rearranged according to the display space, so that blank display areas are effectively reduced, and the text display is more orderly and consistent.
In this exemplary embodiment, the text characters meeting the text condition to be processed include english characters, and the drawing the second text content to the specified position of the canvas according to the preset drawing attribute includes:
determining an English text consisting of English characters according to space characters in front of and/or behind the English characters;
judging whether the English text is drawn in multiple lines in the designated position; if yes, the English text is arranged in one of the lines for display.
In the exemplary embodiment, the second text content generated and displayed according to the text display method, when displaying english, there is a phenomenon that there is a character or word of a single letter at the end of a line of english characters after line change according to the number of english characters, the english word is broken, and other letters beyond the line are displayed on another line, however, if there are fewer letters displayed on one line of broken words, such as the english word "means" displayed on the first line and "ss" displayed on the other line, then after determining that the text composed of english characters is a word according to the space characters before and/or after the english characters, it is determined again whether the text composed of english characters is displayed by a single plurality of lines, if so, the text can be set on one line of the plurality of lines by adjusting the line spacing of the second english text for display, that is, the "ss" in the "means" is adjusted to be displayed in the same row as the "means".
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Further, in the present exemplary embodiment, a trademark data generating apparatus is also provided. Referring to fig. 3, the brand data generating apparatus 300 may include: a text acquisition module 310, a pre-processing module 320, and a text rendering module 330. Wherein:
a text obtaining module 310, configured to obtain a first text content to be displayed, where the first text content includes at least one text character meeting a condition of a text to be processed;
the preprocessing module 320 is configured to determine character features of text characters in the first text content, and preprocess the text characters according to the character features to obtain second text content including standard text characters;
and the text drawing module 330 is configured to draw the second text content to a specified position of the canvas according to a preset drawing attribute.
The specific details of each trademark data generation device module are already described in detail in the corresponding trademark data generation method, and therefore are not described herein again.
It should be noted that although several modules or units of the brand data generating apparatus 300 are mentioned in the above detailed description, such division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 400 according to such an embodiment of the invention is described below with reference to fig. 4. The electronic device 400 shown in fig. 4 is only an example and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in fig. 3, electronic device 400 is embodied in the form of a general purpose computing device. The components of electronic device 400 may include, but are not limited to: the at least one processing unit 410, the at least one memory unit 420, a bus 430 connecting different system components (including the memory unit 420 and the processing unit 410), and a display unit 440.
Wherein the storage unit stores program code that is executable by the processing unit 410 to cause the processing unit 410 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 410 may perform steps S110 to S130 as shown in fig. 1.
The storage unit 420 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)4201 and/or a cache memory unit 4202, and may further include a read only memory unit (ROM) 4203.
The storage unit 420 may also include a program/utility 4204 having a set (at least one) of program modules 4205, such program modules 4205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 430 may be any bus representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 400 may also communicate with one or more external devices 470 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 400, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 400 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 450. Also, the electronic device 400 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 460. As shown, the network adapter 460 communicates with the other modules of the electronic device 400 over the bus 430. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above-mentioned "exemplary methods" section of the present description, when said program product is run on the terminal device.
Referring to fig. 5, a program product 500 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.

Claims (10)

1. A method of text processing, the method comprising:
acquiring first text content to be displayed, wherein the first text content comprises at least one text meeting the conditions of the text to be processed;
determining character characteristics of text characters in the first text content, and preprocessing the text characters according to the character characteristics to obtain second text content comprising standard text characters;
and drawing the second text content to the appointed position of the canvas according to the preset drawing attribute.
2. The method of claim 1, wherein determining character characteristics of text characters in the first text content comprises:
traversing code modules corresponding to text characters in the first text content according to the index values;
and matching the code module with a preset code table, and determining the character characteristics of the text characters according to the matching result.
3. The method of claim 1 wherein the character features include supplemental character features, the preprocessing of the text characters by character features comprising:
if the character characteristics of the current text characters are judged to be supplementary character characteristics according to the code module, determining that the current text characters are supplementary characters;
merging the supplementary character with a preset amount of text arranged before the supplementary character into the standard text character.
4. The method of claim 3, wherein the method further comprises:
if the current text character is determined to be an addendum character, skipping the addendum character and continuing to traverse the next text character.
5. The method of claim 2, wherein the character features include prefix/suffix features, and wherein preprocessing the text character according to character features comprises:
if the character characteristics of the current text character are judged to be the prefix/suffix character characteristics according to the code module, determining that the current text character is a prefix character or a suffix character;
adding a specific mark to the front character of the prefix character, or adding a specific mark to the rear character of the suffix character.
6. The method of claim 1, wherein preprocessing the text characters according to character characteristics to obtain second text content including standard text characters comprises:
and measuring the standard text characters according to a character measurement algorithm, and packaging the standard text characters according to a preset arrangement rule according to a measurement result to generate second text content.
7. The method of claim 1, wherein the text characters meeting the text condition to be processed comprise english characters, and the drawing the second text content to the specified position of the canvas according to the preset drawing attribute comprises:
determining an English text consisting of English characters according to space characters in front of and/or behind the English characters;
determining whether the english text is drawn in a plurality of lines in the designated position;
and if so, setting the English text in one of the multiple lines for display.
8. A text processing apparatus, comprising:
the text acquisition module is used for acquiring first text content to be displayed, wherein the first text content comprises at least one text character which accords with the condition of a text to be processed;
the preprocessing module is used for determining character characteristics of text characters in the first text content and preprocessing the text characters according to the character characteristics to obtain second text content comprising standard text characters;
and the text drawing module is used for drawing the second text content to the appointed position of the canvas according to the preset drawing attribute.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing a computer program stored in the memory, and when executed, implementing the method of any of the preceding claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of the preceding claims 1 to 7.
CN201910813197.3A 2019-08-30 2019-08-30 Text processing method and device, electronic equipment and computer readable storage medium Pending CN110609981A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910813197.3A CN110609981A (en) 2019-08-30 2019-08-30 Text processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910813197.3A CN110609981A (en) 2019-08-30 2019-08-30 Text processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110609981A true CN110609981A (en) 2019-12-24

Family

ID=68890703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910813197.3A Pending CN110609981A (en) 2019-08-30 2019-08-30 Text processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110609981A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111583351A (en) * 2020-03-31 2020-08-25 北京金堤科技有限公司 Picture generation method and device
CN112256175A (en) * 2020-10-23 2021-01-22 北京字节跳动网络技术有限公司 Character display method and device, electronic equipment and computer readable storage medium
CN112258594A (en) * 2020-10-23 2021-01-22 北京字节跳动网络技术有限公司 Character display method and device, electronic equipment and computer readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464852A (en) * 2007-12-21 2009-06-24 希姆通信息技术(上海)有限公司 Processing method for cutting-off English words
CN102169591A (en) * 2011-05-20 2011-08-31 中国科学院计算技术研究所 Line selecting method and drawing method of text note in drawing
CN102542964A (en) * 2011-12-27 2012-07-04 深圳创维数字技术股份有限公司 Method and device for displaying characters on vacuum fluorescent display
CN105893342A (en) * 2015-12-29 2016-08-24 乐视移动智能信息技术(北京)有限公司 Text information processing method and device
CN107977367A (en) * 2016-10-21 2018-05-01 腾讯科技(北京)有限公司 A kind of textual presentation method and server
CN108255801A (en) * 2018-01-19 2018-07-06 深圳市富途网络科技有限公司 A kind of Justified implementation methods of Android TextView
CN108763188A (en) * 2018-05-24 2018-11-06 广州视源电子科技股份有限公司 A kind of text display method, device, equipment and storage medium
CN109213485A (en) * 2018-08-20 2019-01-15 武汉斗鱼网络科技有限公司 A kind of text folds implementation method, terminal device and storage medium
CN110134920A (en) * 2018-02-02 2019-08-16 中兴通讯股份有限公司 Draw the compatible display methods of text, device, terminal and computer readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464852A (en) * 2007-12-21 2009-06-24 希姆通信息技术(上海)有限公司 Processing method for cutting-off English words
CN102169591A (en) * 2011-05-20 2011-08-31 中国科学院计算技术研究所 Line selecting method and drawing method of text note in drawing
CN102542964A (en) * 2011-12-27 2012-07-04 深圳创维数字技术股份有限公司 Method and device for displaying characters on vacuum fluorescent display
CN105893342A (en) * 2015-12-29 2016-08-24 乐视移动智能信息技术(北京)有限公司 Text information processing method and device
CN107977367A (en) * 2016-10-21 2018-05-01 腾讯科技(北京)有限公司 A kind of textual presentation method and server
CN108255801A (en) * 2018-01-19 2018-07-06 深圳市富途网络科技有限公司 A kind of Justified implementation methods of Android TextView
CN110134920A (en) * 2018-02-02 2019-08-16 中兴通讯股份有限公司 Draw the compatible display methods of text, device, terminal and computer readable storage medium
CN108763188A (en) * 2018-05-24 2018-11-06 广州视源电子科技股份有限公司 A kind of text display method, device, equipment and storage medium
CN109213485A (en) * 2018-08-20 2019-01-15 武汉斗鱼网络科技有限公司 A kind of text folds implementation method, terminal device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CLEARLIGHTY: "如何输出字符串中的增补字符?-java", 《HTTPS://BLOG.CSDN.NET/QQ_36852780/ARTICLE/DETAILS/88984787》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111583351A (en) * 2020-03-31 2020-08-25 北京金堤科技有限公司 Picture generation method and device
CN111583351B (en) * 2020-03-31 2024-02-02 北京金堤科技有限公司 Picture generation method and device
CN112256175A (en) * 2020-10-23 2021-01-22 北京字节跳动网络技术有限公司 Character display method and device, electronic equipment and computer readable storage medium
CN112258594A (en) * 2020-10-23 2021-01-22 北京字节跳动网络技术有限公司 Character display method and device, electronic equipment and computer readable storage medium
CN112256175B (en) * 2020-10-23 2023-08-08 北京字节跳动网络技术有限公司 Text display method, text display device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN110309475B (en) Page display method and device, terminal equipment and storage medium
CN110609981A (en) Text processing method and device, electronic equipment and computer readable storage medium
CN107451272B (en) Information display method, medium, device and computing equipment
CN113031946B (en) Method and device for rendering page component
CN113126990B (en) Page development method, device, equipment and storage medium
CN111915705B (en) Picture visual editing method, device, equipment and medium
CN113032083A (en) Data display method, device, electronic equipment and medium
KR102574306B1 (en) dynamic typesetting
CN110990345A (en) Method and device for online preview of Excel file
CN112506479A (en) Page editing method, device, equipment and storage medium
CN109753644B (en) Rich text editing method and device, mobile terminal and storage medium
CN108694043B (en) Page decoration method and system
CN110888975A (en) Text visualization
CN109683726B (en) Character input method, character input device, electronic equipment and storage medium
CN111198738A (en) Mobile terminal page display method and device and electronic equipment
CN110647327A (en) Method and device for dynamic control of user interface based on card
CN115098092A (en) Page generation method, device, equipment and storage medium
CN111506848A (en) Webpage processing method, device, equipment and readable storage medium
CN112800373B (en) Webpage resource data generation method and device, computer equipment and storage medium
KR20200001342A (en) Web electric document editing apparatus for rendering object and operating method thereof
CN111475156B (en) Page code generation method and device, electronic equipment and storage medium
CN112417345B (en) Rendering method, rendering device, electronic equipment and storage medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN112861504A (en) Text interaction method, device, equipment, storage medium and program product
CN113885998A (en) Page rendering method and device, electronic equipment and 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

Application publication date: 20191224

RJ01 Rejection of invention patent application after publication