Text processing method and device, electronic equipment and storage medium
By using words and words as spacing adjustment objects and responding to user operations, flexible adjustment of word spacing and word spacing in text files is solved, and the problem of time-consuming and labor-intensive modification of word spacing in the prior art is improved, and text processing efficiency and user experience are improved.
Patent Information
- Application Number
- CN202310533384.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2024-11-12
AI Technical Summary
The prior art is time-consuming and labor-intensive to modify word spacing in text files, lacks the ability to flexibly adjust multiple word spacings, which affects the user experience.
Provide a text processing method, which supports words and words as spacing adjustment objects, responds to user spacing adjustment operations, finely divides different levels of text to be processed, and updates text display based on interactive operations to achieve word spacing and word spacing. Flexible adjustments.
It improves text processing efficiency and improves user experience. Through refined spacing adjustment and visual presentation, the modification process of word-to-word or word spacing in text files is simplified.
Smart Images

Figure CN118940755A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to text processing technology, and more particularly to a text processing method, device, electronic device and storage medium. Background Art
[0002] As one of the main ways to carry information, text is widely used in various fields. For example, in the field of image processing, the display effect of the image can be enriched by adding text to the image.
[0003] In texts edited with related technologies, the spacing between words in the text is often the default spacing. In the scenario of modifying the spacing between words, the cursor needs to be placed between the two words to be modified, and the spacing between words can be adjusted by adding or deleting spaces. This modification method is time-consuming and laborious when faced with adjusting the spacing between multiple words in the text, which affects the user experience. Summary of the invention
[0004] The present disclosure provides a text processing method, device, electronic device and storage medium to achieve flexible adjustment of character spacing or word spacing of text.
[0005] In a first aspect, an embodiment of the present disclosure provides a text processing method, the method comprising:
[0006] Acquire and display a text to be processed, wherein the text to be processed includes a plurality of words, and the words include at least one character;
[0007] In response to a spacing adjustment trigger operation for the text to be processed, determining the spacing adjustment object corresponding to the text to be processed, wherein the spacing adjustment object includes word spacing and character spacing constituting the text to be processed;
[0008] The spacing adjustment object is adjusted, the text to be processed is updated based on the adjustment result, and the updated text to be processed is displayed.
[0009] In a second aspect, the present disclosure also provides a text processing device, which is characterized by comprising:
[0010] A text acquisition module, used for acquiring and displaying a text to be processed, wherein the text to be processed includes a plurality of spacing adjustment objects, and the spacing adjustment objects include word spacing and character spacing constituting the text to be processed;
[0011] A spacing adjustment module, configured to determine the spacing adjustment object corresponding to the text to be processed in response to a spacing adjustment trigger operation on the text to be processed;
[0012] The display update module is used to adjust the spacing adjustment object, update the text to be processed based on the adjustment result, and display the updated text to be processed.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the text processing method as described in any one of the embodiments of the present disclosure.
[0017] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a text processing method as described in any one of the embodiments of the present disclosure.
[0018] The technical solution of the embodiment of the present disclosure obtains and displays the text to be processed, wherein the text to be processed includes words and characters constituting the text to be processed, supports taking characters and words, two different types of text components, as spacing adjustment objects, and realizes the refined division of different levels of the text to be processed; in response to the spacing adjustment trigger operation for the text to be processed, determines the spacing adjustment object corresponding to the text to be processed, and adjusts the spacing adjustment object, wherein the spacing adjustment object includes the word spacing and character spacing constituting the text to be processed, supports selecting the spacing adjustment object to be adjusted based on the interactive operation, so that the configuration method of the spacing adjustment object is more flexible and more in line with user needs; finally, based on the adjustment result, the text to be processed is updated, and the updated text to be processed is displayed, and the adjusted text to be processed is visualized, so that the user can timely understand the adjustment result of the spacing adjustment object and the changes to the text to be processed brought about by it, solves the technical problem of time-consuming and labor-intensive in modifying the character spacing in the file in the related art, realizes the flexible modification of the spacing between characters or between words in the text to be processed, and achieves the beneficial effect of improving the text processing efficiency and enhancing the text processing experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1A flowchart of a text processing method provided by an embodiment of the present disclosure;
[0021] Figure 2 A flowchart of another text processing method provided by an embodiment of the present disclosure;
[0022] Figure 3 A flowchart of another text processing method provided by an embodiment of the present disclosure;
[0023] Figure 4 A flowchart of another text processing method provided by an embodiment of the present disclosure;
[0024] Figure 5 A structural schematic diagram of a text processing device provided by an embodiment of the present disclosure;
[0025] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0027] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0028] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0029] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0032] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0033] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0034] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0035] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0036] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0037] Figure 1 A flowchart of a text processing method provided by an embodiment of the present disclosure is provided. The embodiment of the present disclosure is applicable to the situation where word spacing and / or character spacing in a text is modified. The method can be executed by a text processing device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0038] like Figure 1 As shown, the method of this embodiment may specifically include:
[0039] S110: Acquire and display the text to be processed.
[0040] Wherein, the text to be processed can be understood as the text whose spacing is to be adjusted at the current moment. The text to be processed may include text components of multiple levels. The text components can be understood as the units that make up the text. Exemplarily, according to different levels, the units that make up the text can be in units of characters, words, phrases, sentences, etc. That is, the text components may include but are not limited to characters, words, phrases or sentences, etc. Wherein, the text to be processed includes multiple words, and each word includes at least one word. For example, assuming that the text to be processed is Tomorrow is another day, the words included in the text to be processed are Tomorrow, is, another and day, and the words contained in the word Tomorrow are T, o, m, o, r, r, o and w. Assuming that the text to be processed is Every day is a new day, the words included in the text to be processed are Every day, All, New and One day, and the words contained in the word Every day are Every and Day.
[0041] Optionally, after obtaining the text to be processed, the method further includes: identifying the text to be processed to determine multiple text components in the text to be processed. Exemplarily, the preset objects of the text to be processed are identified, and the identified preset objects are used as text components. Specifically, the text to be processed can be segmented to obtain words corresponding to the text to be processed, and the words are used as text components. Further, the characters that constitute the text to be processed can be identified, and each character in the word is used as a text component. The character can be understood as the smallest unit that constitutes the text. Optionally, the text to be processed is segmented based on semantic recognition technology.
[0042] Optionally, a phrase in the text to be processed is determined as a text component. The phrase in the text to be processed may be determined in response to a phrase selection operation on the text to be processed and based on the phrase selection operation; or the phrase in the text to be processed may be determined based on contextual semantic recognition, etc.
[0043] As mentioned above, there are many scenarios for applying text, so the text to be processed can be text obtained in various scenarios. For example, the text to be processed can be text in a document, text added to an image in the form of a text box, text contained in an image or object (such as a book, a business card, an item label or a packaging box, etc.), or subtitle text corresponding to an audio or video.
[0044] From the perspective of language type, the text to be processed can be a text composed of a single language type or a text composed of multiple language types. From the perspective of text style, the text to be processed can be a text composed of spacing adjustment objects of a single style or a text composed of spacing adjustment objects of multiple styles.
[0045] Optionally, obtaining the text to be processed includes at least one of the following operations:
[0046] Performing text recognition on a first object containing text to obtain text to be processed;
[0047] In response to a text selection trigger operation, the selected text is used as text to be processed;
[0048] When the text sent by the second object is received, the received text is used as the text to be processed.
[0049] The first object may be any object containing text, such as the aforementioned image or object. The second object may be any object having a text sending function, such as a text sending object in scenarios such as an operator, a mailbox, or an instant messaging application. It should be noted that the above description is only an example of the first object and the second object, and what the first object and the second object are can be determined according to actual scenarios, and are not limited here.
[0050] The text selection trigger operation can be understood as a trigger operation for selecting text to be processed. Exemplarily, in response to the text selection trigger operation, the selected text is used as the text to be processed, which can be: in response to a drawing trigger operation based on an input device drawing a selection area box, the text located in the drawn selection area box is used as the text to be processed; or in response to a selection trigger operation for a text component, the text to which the selected text component belongs is used as the text to be processed.
[0051] S120: In response to a spacing adjustment triggering operation for the text to be processed, determining a spacing adjustment object corresponding to the text to be processed.
[0052] Among them, the spacing adjustment object can be understood as the spacing type corresponding to the spacing to be adjusted. In the embodiment of the present disclosure, typically, the spacing adjustment object may include word spacing and character spacing. On this basis, the spacing adjustment object may also include row spacing or column spacing, etc.
[0053] Among them, the spacing adjustment trigger operation can be understood as a trigger operation for adjusting the distance size of the spacing adjustment object in the text to be processed. There are many ways to generate the spacing adjustment trigger operation. For example, it can be generated by a selection operation on a text component in the text to be processed, or by a setting operation on some pre-set spacing adjustment setting items. Exemplarily, the selection operation of the text component in the text to be processed can be a selection operation for at least part of the characters or at least part of the words in the text component.
[0054] Specifically, in response to a spacing adjustment trigger operation for a text to be processed, determining a spacing adjustment object corresponding to the text to be processed may include: displaying a spacing adjustment setting item corresponding to the text to be processed, and in response to an information setting trigger operation for the spacing adjustment setting item, determining the spacing adjustment object corresponding to the text to be processed based on the setting information corresponding to the spacing adjustment setting item. The advantage of such a setting is that different spacing adjustment dimensions can be provided to the user through the spacing adjustment setting item, and the setting information corresponding to the spacing adjustment setting item can automatically achieve accurate matching of the spacing adjustment object in the text to be processed, thereby accurately obtaining the user's spacing adjustment intention, and the operation is simple and convenient.
[0055] Among them, the spacing adjustment setting item can be understood as a function item for setting parameter information associated with the spacing adjustment object. The number of spacing adjustment setting items can be one or more. Exemplarily, the spacing adjustment setting item can be a setting item corresponding to the spacing adjustment object and / or a setting item corresponding to a text component associated with the spacing adjustment object.
[0056] Exemplarily, the setting item corresponding to the spacing adjustment object may be a setting item corresponding to the spacing type of the spacing adjustment object (e.g., character spacing and word spacing, etc.) and / or a setting item corresponding to the distance value of the spacing adjustment object (e.g., the number of characters or a value corresponding to a length unit, etc.).
[0057] The setting items corresponding to the text components may include, but are not limited to, at least one of the setting items corresponding to the language type of the text components (such as Chinese, English, Japanese or Korean, etc.), the setting items corresponding to the font style (including font style and font type, etc.), the setting items corresponding to the color, and the setting items corresponding to the size.
[0058] Optionally, displaying the spacing adjustment setting items corresponding to the text to be processed may be, for example, displaying the spacing adjustment setting items together with the text object to be processed in the target interface; or, in response to a spacing adjustment trigger operation for the text to be processed, adding the spacing adjustment setting items corresponding to the text to be processed to be displayed in the target interface; or, in response to a spacing adjustment trigger operation for the text to be processed, displaying the spacing adjustment setting items corresponding to the text to be processed in a pop-up window, etc.
[0059] The information setting trigger operation can be understood as a trigger operation for setting specific parameter information corresponding to each spacing adjustment setting item. Then, the spacing adjustment object matching the setting information corresponding to the spacing adjustment setting item can be used as the spacing adjustment object corresponding to the text to be processed.
[0060] For example, assuming that the spacing adjustment setting items include setting items corresponding to the spacing type of the spacing adjustment object and setting items corresponding to the language type of the text component, and the spacing type is set to word spacing and the language type is set to Chinese based on the information setting trigger operation, then the spacing adjustment object can be determined as the word spacing between every two Chinese characters in the text to be processed.
[0061] S130: Adjust the spacing adjustment object, update the text to be processed based on the adjustment result, and display the updated text to be processed.
[0062] From the perspective of the change trend of the adjustment, optionally, adjusting the distance adjustment object includes: increasing or decreasing the distance value corresponding to the distance adjustment object.
[0063] From the perspective of the amount of change in adjustment, adjusting the distance adjustment object may be: adjusting the distance value corresponding to the distance adjustment object to a target value. Specifically, the current value and the target value of the distance value corresponding to the distance adjustment object may be obtained, the difference between the current value and the target value may be calculated, and the current value may be adjusted to the target value based on the difference. Alternatively, adjusting the distance adjustment object may be: increasing or decreasing the distance value corresponding to the distance adjustment object by a preset value.
[0064] Optionally, when the spacing adjustment object is word spacing, determine the current word to be adjusted and the previous word of the current word to be adjusted in the text to be processed; according to the position information of the last word of the previous word, adjust the position information of the first word of the current word to be adjusted to adjust the word spacing.
[0065] It is understandable that, generally, the text to be processed includes multiple words. The word spacing can be understood as the spacing between every two adjacent words. Specifically, it can be the distance between the last word of the previous word and the first word of the next word in the two adjacent words. The word spacing to be adjusted can be the word spacing between some words in the text to be processed, or it can be the word spacing between all words in the text to be processed. For the current word to be adjusted, the position information of the first word of the current word to be adjusted can be adjusted with reference to the position information of the last word of the previous word adjacent to it in the text to be processed.
[0066] Optionally, when the spacing adjustment object is character spacing, determine the character corresponding to the character spacing to be adjusted, obtain the word corresponding to the character, and determine the word center position corresponding to the word; determine the first distance from each character in the word to the word center position, and scale the first distance to adjust the character spacing between every two characters in the word.
[0067] Similarly, each word in the text to be processed often includes multiple characters, and in each word, the distance between every two adjacent characters is the character spacing. The character spacing to be adjusted can be the character spacing in some words in the text to be processed, or it can be the character spacing in all words. Furthermore, it can also be the character spacing of some characters in a word or the character spacing of all characters in a word.
[0068] Optionally, obtaining the word corresponding to the character includes one or more of the following operations: obtaining the word to which the character belongs (is located); obtaining all words in the text to be processed that contain the character; obtaining the word to which the character belongs (is located), and obtaining the word that is the same as the word in the text to be processed.
[0069] Among them, the word center position can be understood as the position of the center point of the word, which is generally related to the length of the word. Optionally, determining the word center position corresponding to the word includes: obtaining the first position corresponding to the first word in the word and the second position corresponding to the last word, and determining the word center position corresponding to the word based on the first position and the second position. Alternatively, obtain the total number of words contained in the word and the word position of each word. In the case where the total number of words contained in the word is an odd number, obtain the word position of the word in the middle of the word as the word center position. Taking a word of 5 words as an example, the word position of the third word can be used as the word center position. In the case where the total number of words contained in the word is an even number, obtain the word position of any two words in the word that are symmetrical about the center, and determine the word center position. Taking a word of 6 words as an example, the two words that are symmetrical about the center can be the first word and the sixth word, the second word and the fifth word, or the third word and the fourth word.
[0070] Specifically, the word spacing in a word can be adjusted by taking the center of the word as a reference position and scaling the distance from each word to the center of the word to adjust the word spacing in the word. Compared with the method of adjusting the position coordinate values corresponding to each word one by one according to the relative relationship of coordinates, the scaling method can more simply and quickly adjust the word spacing.
[0071] In the disclosed embodiment, optionally, the center position of the text corresponding to the updated text to be processed is the same as the center position of the text corresponding to the text to be processed before adjustment. That is, the center position of the text corresponding to the text to be processed remains unchanged before and after the spacing adjustment. The advantage of such a setting is that it can prevent the position change of the text to be processed after the update from being biased to one side. The technical solution can ensure that the changes on both sides corresponding to the processed text are relatively balanced, and try to keep the original display structure layout of the text to be processed. It is particularly suitable for the scene of adjusting the text to be processed in other information such as images, ensuring the relative display relationship between the two, and improving the visualization effect of the text to be processed.
[0072] The technical solution of the embodiment of the present disclosure obtains and displays the text to be processed, wherein the text to be processed includes words and characters constituting the text to be processed, supports taking characters and words, two different types of text components, as spacing adjustment objects, and realizes the refined division of different levels of the text to be processed; in response to the spacing adjustment trigger operation for the text to be processed, determines the spacing adjustment object corresponding to the text to be processed, and adjusts the spacing adjustment object, wherein the spacing adjustment object includes the word spacing and character spacing constituting the text to be processed, supports selecting the spacing adjustment object to be adjusted based on the interactive operation, so that the configuration method of the spacing adjustment object is more flexible and more in line with user needs; finally, based on the adjustment result, the text to be processed is updated, and the updated text to be processed is displayed, and the adjusted text to be processed is visualized, so that the user can timely understand the adjustment result of the spacing adjustment object and the changes to the text to be processed brought about by it, solves the technical problem of time-consuming and labor-intensive in modifying the character spacing in the file in the related art, realizes the flexible modification of the spacing between characters or between words in the text to be processed, and achieves the beneficial effect of improving the text processing efficiency and enhancing the text processing experience.
[0073] On the basis of any optional technical solution of the disclosed embodiment, optionally, the text processing method further includes: in response to an information adjustment operation on the second display information of the word or character in the text to be processed, adjusting the second display information of the word or character. The second display information may include but is not limited to at least one of the language type information, font style information, color information, position information, and size information corresponding to the word or character. The advantage of such a setting is that it realizes the adjustment of different dimensions of the text to be processed, increases the adjustment methods of the text to be processed, and thus enriches the display effect of the text to be processed from multiple dimensions.
[0074] In some scenarios, the words or characters in the text to be processed can be grouped and processed according to the second display information corresponding to them. For example, when adjusting the character spacing, when a trigger word is determined, the words in the text to be processed that have the same second display information as the trigger word can be obtained as associated words, and then both the reference word and the associated word can be used as a group of spacing adjustment objects. Similarly, when a trigger word is determined as a trigger word, the words in the text to be processed that have the same second display information as the trigger word can be obtained as associated words, and then both the trigger word and the associated word can be used as a group of spacing adjustment objects.
[0075] By adopting this technical solution, it is possible to realize differentiated processing and batch processing of spacing adjustment objects in the text to be processed, which can not only enrich the display effect of the text to be processed, but also improve the processing efficiency of the text to be processed, further improving the user's text processing experience.
[0076] Figure 2 A flow chart of another text processing method provided by an embodiment of the present disclosure. The technical solution of this embodiment further refines how to determine the spacing adjustment object of the text to be processed on the basis of any optional embodiment. Optionally, in response to a spacing adjustment trigger operation for the text to be processed, determining the spacing adjustment object corresponding to the text to be processed includes: in response to a selection trigger operation for a character and / or word in the text to be processed, determining the spacing adjustment object corresponding to the text to be processed based on the word to which the selected character belongs and / or the selected word. For specific implementation methods, please refer to the description of this embodiment. Among them, the technical features that are the same or similar to those of the aforementioned embodiments are not repeated here.
[0077] like Figure 2 As shown, the method of this embodiment may specifically include:
[0078] S210, obtaining and displaying a text to be processed, wherein the text to be processed includes a plurality of words, and each word includes at least one character.
[0079] S220. In response to a selection trigger operation for a character and / or word in the text to be processed, determine a spacing adjustment object corresponding to the text to be processed based on the word to which the selected character belongs and / or the selected word.
[0080] The selection trigger operation can be understood as a trigger operation for selecting text components associated with the spacing adjustment object in the text to be processed. Specifically, the selection trigger operation for characters and / or words in the text to be processed includes: a selection trigger operation for partial characters in a word in the text to be processed; a selection trigger operation for a preset number of complete words in the text to be processed; and a selection trigger operation for partial characters in a preset number of complete words and partial words in the text to be processed.
[0081] Optionally, based on the word to which the selected character belongs and / or the selected word, a spacing adjustment object corresponding to the text to be processed is determined, including: taking the word to which the selected character belongs and / or the selected word as trigger words, and determining the number of trigger words; and determining at least two spacing adjustment objects in the text to be processed based on the number of trigger words.
[0082] Among them, the trigger word can be understood as the word to which the character directly selected based on the selection trigger operation belongs or the word directly selected. It can be understood that the selected trigger word can be one or more. The positions of multiple trigger words in the text to be processed can be adjacent or non-adjacent. Furthermore, in the case of multiple trigger words, at least two spacing adjustment objects in the text to be processed can also be determined based on the adjacent relationship between the multiple trigger words. Among them, the adjacent relationship includes adjacent and non-adjacent.
[0083] Exemplarily, determining the spacing adjustment object corresponding to the to-be-processed text based on the number of trigger words includes at least one of the following operations:
[0084] When the number of trigger words is one, the character spacing is used as the spacing adjustment object;
[0085] When there are multiple trigger words, the word spacing is used as the spacing adjustment object;
[0086] When there are multiple trigger words and at least some of the trigger words are not adjacent in the text to be processed, the character spacing is used as the spacing adjustment object;
[0087] When there are multiple trigger words and at least some of the trigger words are adjacent to each other in the text to be processed, the word spacing is taken as the spacing adjustment object.
[0088] Specifically, at least some of the trigger words are not adjacent in the text to be processed, which may include multiple trigger words that are not adjacent in the text to be processed, or multiple trigger words that are partially non-adjacent in the text to be processed. Similarly, at least some of the trigger words that are adjacent in the text to be processed may be multiple trigger words that are adjacent in the text to be processed, or multiple trigger words that are partially adjacent in the text to be processed, and the word spacing is used as the spacing adjustment object.
[0089] S230: Adjust the spacing adjustment object, update the text to be processed based on the adjustment result, and display the updated text to be processed.
[0090] The technical solution of the disclosed embodiment, by responding to a selection trigger operation for characters and / or words in a text to be processed, determines the spacing adjustment object corresponding to the text to be processed based on the word to which the selected character belongs and / or the selected word, and can accurately capture the characters and / or words that the user pays attention to in the text to be processed, and then determine the spacing adjustment object in the text to be processed, and adjust the spacing adjustment object so that the adjustment result meets the user's needs, thereby improving the user's text processing experience.
[0091] Figure 3 A flowchart of another text processing method provided by an embodiment of the present disclosure. The technical solution of this embodiment further refines the adjustment method of the spacing adjustment object based on the above embodiment. Optionally, a target word corresponding to the spacing adjustment object is determined based on a spacing adjustment trigger operation, and the spacing adjustment object is adjusted based on the target word. For specific implementation methods, please refer to the description of this embodiment. Among them, the technical features that are the same or similar to the above embodiments are not repeated here.
[0092] like Figure 3 As shown, the method of this embodiment may specifically include:
[0093] S310: Obtain and display the text to be processed.
[0094] S320: In response to a spacing adjustment triggering operation for the text to be processed, determine a spacing adjustment object corresponding to the text to be processed.
[0095] S330: Determine a target word corresponding to the distance adjustment object based on the distance adjustment trigger operation, and adjust the distance adjustment object based on the target word.
[0096] Among them, the target word can be understood as a word in the text to be processed that is associated with the spacing adjustment object to be adjusted. Optionally, determining the target word corresponding to the spacing adjustment object based on the spacing adjustment trigger operation includes: determining the trigger word in the text to be processed based on the spacing adjustment trigger operation, and determining the target word corresponding to the spacing adjustment object based on the trigger word. Exemplarily, the text component selected by the spacing adjustment trigger operation can be used as a trigger word, or, based on the spacing adjustment trigger operation, a screening rule corresponding to the spacing adjustment object is determined, and the target word corresponding to the spacing adjustment object in the text to be processed is determined based on the screening rule. Among them, the screening rule includes a rule associated with the display information corresponding to the screened text component and / or a rule associated with the object information item corresponding to the spacing adjustment object. Among them, the object information includes the spacing type and / or spacing length corresponding to the spacing adjustment object. For example, in the screening rule, the word spacing in the text to be processed that is less than the preset spacing length needs to be used as the spacing adjustment object to be adjusted. At this time, the word spacing less than the preset spacing length can be used as the target word.
[0097] Specifically, determining a target word corresponding to the spacing adjustment object based on a trigger word includes: taking the trigger word as the target word corresponding to the spacing adjustment object; or determining an associated word corresponding to the trigger word in the text to be processed based on the first display information corresponding to the trigger word, and taking the trigger word and the associated word as the target word corresponding to the spacing adjustment object, wherein the first display information includes at least one of the language type corresponding to the trigger word, the font style corresponding to the trigger word, the color corresponding to the trigger word, the size corresponding to the trigger word, and the combination structure information between adjacent trigger words.
[0098] Among them, the combination structure information can be understood as the overall structural expression information between adjacent trigger words. Specifically, the combination structure information can be the feature combination form or feature change mode of each trigger word in the combination determined according to a preset dimension in the adjacent trigger words. Exemplarily, the combination structure information can be the combination characteristics of the language types between adjacent trigger words, such as the same language type, or a combination of different language types. Optionally, the words that meet the combination characteristics of the language types in the text to be processed are used as the associated words corresponding to the trigger words in the text to be processed. For example, the combination characteristics of the language types are a Chinese-English combination, and all the words in the two adjacent words in the text to be processed that meet the requirements that the previous word is Chinese and the next word is English can be used as the associated words corresponding to the trigger words in the text to be processed.
[0099] S340: Update the text to be processed based on the adjustment result, and display the updated text to be processed.
[0100] The technical solution of the disclosed embodiment, by determining the target word corresponding to the spacing adjustment object based on the spacing adjustment trigger operation, can accurately determine the target word to be adjusted in the text to be processed in an interactive manner, and then accurately locate the spacing adjustment object to be adjusted, and adjust the spacing adjustment object based on the target word. The spacing adjustment object can be adjusted by adjusting the position of the target word, thereby ensuring the display effect of the text to be processed.
[0101] Figure 4 A flow chart of another text processing method provided by an embodiment of the present disclosure. The technical solution of this embodiment can keep the text center position of the text to be processed unchanged on the basis of the above optional embodiment. In this embodiment, how to achieve that the text center position corresponding to the updated text to be processed is the same as the text center position corresponding to the text to be processed before adjustment is further refined. Optionally, updating the text to be processed based on the adjustment result includes: respectively determining the text center position corresponding to the text to be processed before and after the spacing adjustment of the spacing adjustment object; moving the text center position corresponding to the adjusted text to be processed to the text center position corresponding to the text to be processed before adjustment, to obtain the updated text to be processed. The specific implementation method can be referred to the description of this embodiment. Among them, the technical features that are the same or similar to those in the aforementioned embodiment will not be repeated here.
[0102] like Figure 4 As shown, the method of this embodiment may specifically include:
[0103] S410: Obtain and display the text to be processed.
[0104] S420: In response to a spacing adjustment triggering operation for the text to be processed, determine a spacing adjustment object corresponding to the text to be processed.
[0105] S430: Adjust the spacing adjustment object, and respectively determine the text center positions of the to-be-processed text before and after the spacing adjustment of the spacing adjustment object.
[0106] Among them, before the spacing adjustment can be understood as before the spacing adjustment object is adjusted. After the adjustment can be understood as after at least part of the spacing adjustment object is adjusted. Optionally, after the adjustment is after the spacing adjustment corresponding to the spacing adjustment trigger operation is completed. The text center position can be understood as the position of the center point of the display position of the text to be processed, which is generally related to the length of the text to be processed.
[0107] Optionally, for the text to be processed before adjustment or after update, the text center position corresponding to the text to be processed is determined based on the word center position corresponding to the word in the text to be processed. Specifically, a reference word in the text to be processed is determined, and the word center position corresponding to the reference word is determined; based on the word center position corresponding to the reference word in the text to be processed, the text center position corresponding to the text to be processed is determined.
[0108] The reference word can be understood as a word used to determine the text center position of the text to be processed. The reference word in the text to be processed. The method for determining the word center position of the reference word can be implemented based on the technical solution for the word center position of the word in the text to be processed in the aforementioned embodiment, which will not be repeated here.
[0109] Optionally, the total number of words contained in the text to be processed and the word center position of each word are obtained. When the total number of words contained in the text to be processed is an odd number, the word center position of the word in the middle of the text to be processed is obtained as the center position of the text to be processed. Taking the text to be processed with 3 words as an example, the word center position of the second word can be used as the center position of the text to be processed. When the total number of words contained in the text to be processed is an even number, the word center positions of any two words in the text to be processed that are symmetrical about the center are obtained to determine the center position of the text to be processed. Taking the text to be processed with 4 words as an example, the two words that are symmetrical about the center can be the second and third words or the first and fourth words.
[0110] Optionally, determining the text center position corresponding to the text to be processed includes: obtaining the word position corresponding to the first word in the text to be processed as the third position; obtaining the word position corresponding to the last word in the text to be processed as the fourth position, and determining the text center position corresponding to the text based on the third position and the fourth position.
[0111] S440: Move the text center position corresponding to the adjusted text to be processed to the text center position corresponding to the text to be processed before adjustment to obtain an updated text to be processed, and display the updated text to be processed.
[0112] Specifically, the text center position corresponding to the adjusted text to be processed and the text center position corresponding to the text to be processed before adjustment can be calculated as a position offset, and the text center position corresponding to the adjusted text to be processed is moved based on the position offset so that the text center position corresponding to the adjusted text to be processed is moved to be aligned with the text center position corresponding to the text to be processed before adjustment.
[0113] The technical solution of the disclosed embodiment, after adjusting the spacing adjustment object, respectively determines the text center positions of the to-be-processed text before and after the adjustment of the spacing adjustment object, so that the text center position of the to-be-processed text before the adjustment remains consistent after the adjustment, which can prevent the position change of the to-be-processed text after the update from being biased to one side. The technical solution can ensure that the changes on both sides corresponding to the processed text are relatively balanced, and try to keep the original display structure layout of the to-be-processed text. It is particularly suitable for the scenario of adjusting the to-be-processed text in other information such as images, which ensures the relative display relationship between the two and improves the visualization effect of the to-be-processed text.
[0114] Figure 5 A structural diagram of a text processing device provided by an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the device includes: a text acquisition module 510, a spacing adjustment module 520 and a display update module 530.
[0115] Among them, the text acquisition module 510 is used to acquire and display the text to be processed, wherein the text to be processed includes multiple words, each of which includes at least one character; the spacing adjustment module 520 is used to determine the spacing adjustment object corresponding to the text to be processed in response to the spacing adjustment trigger operation for the text to be processed, wherein the spacing adjustment object includes the word spacing and character spacing that constitute the text to be processed; the display update module 530 is used to adjust the spacing adjustment object, update the text to be processed based on the adjustment result, and display the updated text to be processed.
[0116] The technical solution of the embodiment of the present disclosure obtains and displays the text to be processed, wherein the text to be processed includes words and characters constituting the text to be processed, supports taking characters and words, two different types of text components, as spacing adjustment objects, and realizes the refined division of different levels of the text to be processed; in response to the spacing adjustment trigger operation for the text to be processed, determines the spacing adjustment object corresponding to the text to be processed, and adjusts the spacing adjustment object, wherein the spacing adjustment object includes the word spacing and character spacing constituting the text to be processed, supports selecting the spacing adjustment object to be adjusted based on the interactive operation, so that the configuration method of the spacing adjustment object is more flexible and more in line with user needs; finally, based on the adjustment result, the text to be processed is updated, and the updated text to be processed is displayed, and the adjusted text to be processed is visualized, so that the user can timely understand the adjustment result of the spacing adjustment object and the changes to the text to be processed brought about by it, solves the technical problem of time-consuming and labor-intensive in modifying the character spacing in the file in the related art, realizes the flexible modification of the spacing between characters or between words in the text to be processed, and achieves the beneficial effect of improving the text processing efficiency and enhancing the text processing experience.
[0117] Based on any optional technical solution of the embodiment of the present disclosure, the spacing adjustment module 520 can be used to:
[0118] In response to a selection trigger operation on the character and / or the word in the text to be processed, a spacing adjustment object corresponding to the text to be processed is determined based on the word to which the selected character belongs and / or the selected word.
[0119] Based on any optional technical solution of the embodiment of the present disclosure, the spacing adjustment module 520 may include: a trigger word determination unit and an adjustment object determination unit. The trigger word determination unit is used to use the word to which the selected character belongs and / or the selected word as a trigger word to determine the number of the trigger words; the adjustment object determination unit is used to determine the spacing adjustment object corresponding to the text to be processed based on the number of the trigger words.
[0120] Based on any optional technical solution of the embodiment of the present disclosure, the adjustment object determination unit is used to perform at least one of the following operations:
[0121] When the number of the trigger word is one, the character spacing is used as a spacing adjustment object;
[0122] In the case where there are multiple trigger words, the word spacing is used as a spacing adjustment object;
[0123] In the case where there are multiple trigger words and at least some of the trigger words are not adjacent to each other in the text to be processed, taking the character spacing as a spacing adjustment object;
[0124] In the case that there are multiple trigger words and at least some of the trigger words are adjacent to each other in the text to be processed, the word spacing is taken as the spacing adjustment object.
[0125] Based on any optional technical solution of the embodiment of the present disclosure, the display update module 530 may be used to:
[0126] A target word corresponding to the distance adjustment object is determined based on the distance adjustment trigger operation, and the distance adjustment object is adjusted based on the target word.
[0127] Based on the above optional technical solutions, the display update module 530 can be specifically used for:
[0128] A trigger word in the to-be-processed text is determined based on the spacing adjustment trigger operation, and a target word corresponding to the spacing adjustment object is determined based on the trigger word.
[0129] Based on the above optional technical solutions, the display update module 530 can be further used to:
[0130] Using the trigger word as the target word corresponding to the distance adjustment object; or
[0131] Based on the first display information corresponding to the trigger word, the associated words corresponding to the trigger word in the text to be processed are determined, and the trigger word and the associated words are used as target words corresponding to the spacing adjustment object, wherein the first display information includes at least one of the language type corresponding to the trigger word, the font style corresponding to the trigger word, the color corresponding to the trigger word, the size corresponding to the trigger word, and the combination structure information between adjacent trigger words.
[0132] Based on any optional technical solution of the embodiment of the present disclosure, the spacing adjustment module can be used for:
[0133] Displaying spacing adjustment setting items corresponding to the to-be-processed text, wherein the spacing adjustment setting items include setting items corresponding to the spacing adjustment object and / or setting items corresponding to text components associated with the spacing adjustment object;
[0134] In response to an information setting trigger operation for the spacing adjustment setting item, a spacing adjustment object corresponding to the to-be-processed text is determined based on the setting information corresponding to the spacing adjustment setting item.
[0135] Based on any optional technical solution of the embodiment of the present disclosure, the display update module can be used to:
[0136] In the case where the spacing adjustment object is the character spacing, determining the character corresponding to the character spacing to be adjusted, acquiring the word corresponding to the character, and determining the word center position corresponding to the word;
[0137] Determine a first distance from each of the characters in the word to the center position of the word, and scale the first distance to adjust the character spacing between every two characters in the word.
[0138] Based on any optional technical solution of the embodiment of the present disclosure, the display update module can be used to:
[0139] In a case where the spacing adjustment object is the word spacing, determining a current word to be adjusted and a word preceding the current word to be adjusted in the text to be processed;
[0140] According to the position information of the character at the end of the previous word, the position information of the first character of the current word to be adjusted is adjusted to adjust the word spacing.
[0141] On the basis of any optional technical solution of the embodiment of the present disclosure, optionally, the text center position corresponding to the updated text to be processed is the same as the text center position corresponding to the text to be processed before adjustment.
[0142] Based on any optional technical solution of the embodiment of the present disclosure, the display update module may include: a text center determination unit and a text display update unit.
[0143] Among them, the text center determination unit is used to determine the text center position corresponding to the text to be processed before and after the spacing adjustment of the spacing adjustment object; the text display update unit is used to move the text center position corresponding to the adjusted text to be processed to the text center position corresponding to the text to be processed before the adjustment, so as to obtain the updated text to be processed.
[0144] On the basis of any optional technical solution of the embodiment of the present disclosure, optionally, the text center determination unit includes a word center determination subunit and a text center determination subunit.
[0145] Among them, the word center determination subunit is used to determine the text center position corresponding to the text to be processed based on the word center position corresponding to the word in the text to be processed.
[0146] Based on any optional technical solution of the embodiment of the present disclosure, the text center determination unit or the spacing adjustment module is specifically used to:
[0147] Obtain a first position corresponding to the first character in the word and a second position corresponding to the last character, and determine a word center position corresponding to the word based on the first position and the second position.
[0148] Based on any optional technical solution of the embodiment of the present disclosure, the text processing device further includes:
[0149] A text display adjustment module is used to adjust the second display information of the word or the character in the text to be processed in response to an information adjustment operation on the second display information of the word or the character, wherein the second display information includes at least one of the language type information, font style, color information, position information and size information corresponding to the word or the character.
[0150] The text processing device provided by the embodiments of the present disclosure can execute the text processing method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the text processing method.
[0151] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0152] Figure 6 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 6 , which shows an electronic device (eg, Figure 6 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0153] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An edit / output (I / O) interface 605 is also connected to the bus 604.
[0154] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0155] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0156] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0157] The electronic device provided by the embodiment of the present disclosure and the text processing method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0158] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the text processing method provided by the above embodiments is implemented.
[0159] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0160] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0161] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0162] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains and displays a text to be processed, wherein the text to be processed includes multiple words, and each word includes at least one character; in response to a spacing adjustment trigger operation for the text to be processed, determines the spacing adjustment object corresponding to the text to be processed, wherein the spacing adjustment object includes the word spacing and character spacing that constitute the text to be processed; adjusts the spacing adjustment object, updates the text to be processed based on the adjustment result, and displays the updated text to be processed.
[0163] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0164] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0165] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0166] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0167] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0168] According to one or more embodiments of the present disclosure, [Example 1] provides a text processing method, including: acquiring and displaying a text to be processed, wherein the text to be processed includes a plurality of words, and each of the words includes at least one character; in response to a spacing adjustment trigger operation for the text to be processed, determining the spacing adjustment object corresponding to the text to be processed, wherein the spacing adjustment object includes word spacing and character spacing constituting the text to be processed; updating the text to be processed based on the adjustment result, and displaying the updated text to be processed.
[0169] According to one or more embodiments of the present disclosure, [Example 2] provides the method of Example 1, further including: optionally, in response to a spacing adjustment trigger operation for the text to be processed, determining the spacing adjustment object corresponding to the text to be processed, including: in response to a selection trigger operation for the character and / or the word in the text to be processed, determining the spacing adjustment object corresponding to the text to be processed based on the word to which the selected character belongs and / or the selected word.
[0170] According to one or more embodiments of the present disclosure, [Example Three] provides the method of Example Two, further including: optionally, determining the spacing adjustment object corresponding to the text to be processed based on the word to which the selected character belongs and / or the selected word, including: taking the word to which the selected character belongs and / or the selected word as trigger words, and determining the number of the trigger words; determining the spacing adjustment object corresponding to the text to be processed based on the number of trigger words.
[0171] According to one or more embodiments of the present disclosure, [Example 4] provides the method of Example 3, further comprising: optionally, determining the spacing adjustment object corresponding to the to-be-processed text based on the number of the trigger words includes at least one of the following operations:
[0172] When the number of the trigger word is one, the character spacing is used as a spacing adjustment object;
[0173] In the case where there are multiple trigger words, the word spacing is used as a spacing adjustment object;
[0174] In the case where there are multiple trigger words and at least some of the trigger words are not adjacent to each other in the text to be processed, taking the character spacing as a spacing adjustment object;
[0175] In the case that there are multiple trigger words and at least some of the trigger words are adjacent to each other in the text to be processed, the word spacing is taken as the spacing adjustment object.
[0176] According to one or more embodiments of the present disclosure, [Example 5] provides the method of Example 1, further including: optionally, adjusting the spacing adjustment object includes: determining a target word corresponding to the spacing adjustment object based on the spacing adjustment trigger operation, and adjusting the spacing adjustment object based on the target word.
[0177] According to one or more embodiments of the present disclosure, [Example Six] provides the method of Example Five, further including: optionally, determining the target word corresponding to the spacing adjustment object based on the spacing adjustment trigger operation includes: determining a trigger word in the text to be processed based on the spacing adjustment trigger operation, and determining the target word corresponding to the spacing adjustment object based on the trigger word.
[0178] Optionally, according to one or more embodiments of the present disclosure, [Example 7] provides the method of Example 6, further including: determining the target word corresponding to the spacing adjustment object based on the trigger word, including: taking the trigger word as the target word corresponding to the spacing adjustment object; or, determining the associated word corresponding to the trigger word in the to-be-processed text based on the first display information corresponding to the trigger word, taking the trigger word and the associated word as the target word corresponding to the spacing adjustment object, wherein the first display information includes at least one of the language type corresponding to the trigger word, the font style corresponding to the trigger word, the color corresponding to the trigger word, the size corresponding to the trigger word, and the combination structure information between adjacent trigger words.
[0179] According to one or more embodiments of the present disclosure, [Example 8] provides the method of Example 1, further including: optionally, in response to a spacing adjustment trigger operation for the text to be processed, determining the spacing adjustment object corresponding to the text to be processed, including: displaying spacing adjustment setting items corresponding to the text to be processed, wherein the spacing adjustment setting items include setting items corresponding to the spacing adjustment object and / or setting items corresponding to text components associated with the spacing adjustment object; in response to an information setting trigger operation for the spacing adjustment setting item, determining the spacing adjustment object corresponding to the text to be processed based on the setting information corresponding to the spacing adjustment setting item.
[0180] According to one or more embodiments of the present disclosure, [Example 9] provides the method of Example 1, further including: optionally, the adjusting the spacing adjustment object includes: when the spacing adjustment object is the character spacing, determining the character corresponding to the character spacing to be adjusted, obtaining the word corresponding to the character, and determining the word center position corresponding to the word; determining a first distance from each of the characters in the word to the center position of the word, and scaling the first distance to adjust the character spacing between every two characters in the word.
[0181] According to one or more embodiments of the present disclosure, [Example 10] provides the method of Example 9, further including: optionally, determining the word center position corresponding to the word includes: obtaining a first position corresponding to the first character in the word and a second position corresponding to the last character, and determining the word center position corresponding to the word based on the first position and the second position.
[0182] According to one or more embodiments of the present disclosure, [Example 11] provides the method of Example 1, further including: optionally, the adjusting the spacing adjustment object includes: when the spacing adjustment object is the word spacing, determining the current word to be adjusted and the previous word of the current word to be adjusted in the text to be processed; according to the position information of the word at the end of the previous word, adjusting the position information of the first word of the current word to be adjusted to adjust the word spacing.
[0183] According to one or more embodiments of the present disclosure, [Example 12] provides the method of Example 1, further including: optionally, the text center position corresponding to the updated text to be processed is the same as the text center position corresponding to the text to be processed before adjustment.
[0184] Optionally, updating the text to be processed based on the adjustment result includes: respectively determining the text center positions corresponding to the text to be processed before and after the spacing adjustment of the spacing adjustment object; moving the text center position corresponding to the adjusted text to be processed to the text center position corresponding to the text to be processed before the adjustment, to obtain the updated text to be processed.
[0185] According to one or more embodiments of the present disclosure, [Example 13] provides the method of Example 12, further including: optionally, updating the text to be processed based on the adjustment result, including: respectively determining the text center position corresponding to the text to be processed before and after the spacing adjustment of the spacing adjustment object; moving the text center position corresponding to the adjusted text to be processed to the text center position corresponding to the text to be processed before the adjustment, to obtain the updated text to be processed.
[0186] Optionally, respectively determining the text center positions corresponding to the text to be processed before and after the spacing adjustment of the spacing adjustment object includes: for the text to be processed before adjustment or after updating, based on the word center positions corresponding to the words in the text to be processed, determining the text center position corresponding to the text to be processed.
[0187] According to one or more embodiments of the present disclosure, [Example 14] provides the method of Example 13, further including: optionally, respectively determining the text center positions corresponding to the text to be processed before and after the spacing adjustment of the spacing adjustment object, including: for the text to be processed before adjustment or after updating, based on the word center positions corresponding to the words in the text to be processed, determining the text center position corresponding to the text to be processed.
[0188] According to one or more embodiments of the present disclosure, [Example 15] provides the method of Example 1, further including: optionally, in response to an information adjustment operation on the second display information of the word or the character in the text to be processed, adjusting the second display information of the word or the character, wherein the second display information includes at least one of the language type information, font style, color information, position information and size information corresponding to the word or the character.
[0189] According to one or more embodiments of the present disclosure, [Example 16] provides a text processing device, including: a text acquisition module, used to acquire and display a text to be processed, wherein the text to be processed includes multiple words, and each of the words includes at least one character; a spacing adjustment module, used to determine the spacing adjustment object corresponding to the text to be processed in response to a spacing adjustment trigger operation for the text to be processed, wherein the spacing adjustment object includes word spacing and character spacing that constitute the text to be processed; a display update module, used to adjust the spacing adjustment object, update the text to be processed based on the adjustment result, and display the updated text to be processed.
[0190] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0191] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0192] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A text processing method, characterized in that: include: Acquire and display a text to be processed, wherein the text to be processed includes a plurality of words, and each of the words includes at least one character; In response to a spacing adjustment trigger operation for the text to be processed, determining a spacing adjustment object corresponding to the text to be processed, wherein the spacing adjustment object includes word spacing and character spacing constituting the text to be processed; The spacing adjustment object is adjusted, the text to be processed is updated based on the adjustment result, and the updated text to be processed is displayed.
2. The text processing method according to claim 1, characterized in that: The step of determining the spacing adjustment object corresponding to the text to be processed in response to the spacing adjustment triggering operation on the text to be processed includes: In response to a selection trigger operation on the character and / or the word in the text to be processed, a spacing adjustment object corresponding to the text to be processed is determined based on the word to which the selected character belongs and / or the selected word.
3. The text processing method according to claim 2, characterized in that: The step of determining a spacing adjustment object corresponding to the text to be processed based on the word to which the selected character belongs and / or the selected word includes: Using the word to which the selected character belongs and / or the selected word as a trigger word, and determining the number of the trigger words; A spacing adjustment object corresponding to the text to be processed is determined based on the number of the trigger words.
4. The text processing method according to claim 3, characterized in that: The determining, based on the number of the trigger words, the spacing adjustment object corresponding to the to-be-processed text comprises at least one of the following operations: When the number of the trigger word is one, the character spacing is used as a spacing adjustment object; In the case where there are multiple trigger words, the word spacing is used as a spacing adjustment object; In the case where there are multiple trigger words and at least some of the trigger words are not adjacent to each other in the text to be processed, taking the character spacing as a spacing adjustment object; In the case that there are multiple trigger words and at least some of the trigger words are adjacent to each other in the text to be processed, the word spacing is taken as the spacing adjustment object.
5. The text processing method according to claim 1, characterized in that: The adjusting the spacing adjustment object includes: A target word corresponding to the distance adjustment object is determined based on the distance adjustment trigger operation, and the distance adjustment object is adjusted based on the target word.
6. The text processing method according to claim 5, characterized in that: The determining the target word corresponding to the distance adjustment object based on the distance adjustment trigger operation includes: A trigger word in the to-be-processed text is determined based on the spacing adjustment trigger operation, and a target word corresponding to the spacing adjustment object is determined based on the trigger word.
7. The text processing method according to claim 6, characterized in that: The determining, based on the trigger word, a target word corresponding to the distance adjustment object comprises: Using the trigger word as the target word corresponding to the distance adjustment object; or Based on the first display information corresponding to the trigger word, the associated words corresponding to the trigger word in the text to be processed are determined, and the trigger word and the associated words are used as target words corresponding to the spacing adjustment object, wherein the first display information includes at least one of the language type corresponding to the trigger word, the font style corresponding to the trigger word, the color corresponding to the trigger word, the size corresponding to the trigger word, and the combination structure information between adjacent trigger words.
8. The text processing method according to claim 1, characterized in that: The step of determining the spacing adjustment object corresponding to the text to be processed in response to the spacing adjustment triggering operation on the text to be processed includes: Displaying spacing adjustment setting items corresponding to the to-be-processed text, wherein the spacing adjustment setting items include setting items corresponding to the spacing adjustment object and / or setting items corresponding to text components associated with the spacing adjustment object; In response to an information setting trigger operation for the spacing adjustment setting item, a spacing adjustment object corresponding to the to-be-processed text is determined based on the setting information corresponding to the spacing adjustment setting item.
9. The text processing method according to claim 1, characterized in that: The adjusting the spacing adjustment object includes: In the case where the spacing adjustment object is the character spacing, determining the character corresponding to the character spacing to be adjusted, acquiring the word corresponding to the character, and determining the word center position corresponding to the word; Determine a first distance from each of the characters in the word to the center position of the word, and scale the first distance to adjust the character spacing between every two of the characters in the word.
10. The text processing method according to claim 9, characterized in that: Determining the word center position corresponding to the word includes: Obtain a first position corresponding to the first character in the word and a second position corresponding to the last character, and determine a word center position corresponding to the word based on the first position and the second position.
11. The text processing method according to claim 1, characterized in that: The adjusting the spacing adjustment object includes: In a case where the spacing adjustment object is the word spacing, determining a current word to be adjusted and a word preceding the current word to be adjusted in the text to be processed; According to the position information of the character at the end of the previous word, the position information of the first character of the current word to be adjusted is adjusted to adjust the word spacing.
12. The text processing method according to claim 1, characterized in that: The text center position corresponding to the updated text to be processed is the same as the text center position corresponding to the text to be processed before adjustment.
13. The text processing method according to claim 12, characterized in that: The updating of the to-be-processed text based on the adjustment result includes: Respectively determine the text center positions of the to-be-processed text before and after the spacing adjustment of the spacing adjustment object; The text center position corresponding to the adjusted text to be processed is moved to the text center position corresponding to the text to be processed before adjustment, so as to obtain the updated text to be processed.
14. The text processing method according to claim 13, characterized in that: The determining of the text center positions of the to-be-processed text before and after the spacing adjustment of the spacing adjustment object respectively includes: For the text to be processed before adjustment or after updating, the text center position corresponding to the text to be processed is determined based on the word center position corresponding to the word in the text to be processed.
15. The text processing method according to claim 1, characterized in that: Also includes: In response to an information adjustment operation on the second display information of the word or the character in the text to be processed, the second display information of the word or the character is adjusted, wherein the second display information includes at least one of the language type information, font style, color information, position information and size information corresponding to the word or the character.
16. A text processing device, characterized in that: include: A text acquisition module, used to acquire and display a text to be processed, wherein the text to be processed includes a plurality of words, each of which includes at least one character; A spacing adjustment module, configured to determine, in response to a spacing adjustment trigger operation for the text to be processed, a spacing adjustment object corresponding to the text to be processed, wherein the spacing adjustment object includes word spacing and character spacing constituting the text to be processed; The display update module is used to adjust the spacing adjustment object, update the text to be processed based on the adjustment result, and display the updated text to be processed.
17. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the text processing method as described in any one of claims 1-15.
18. A storage medium containing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to perform the text processing method according to any one of claims 1 to 15.
