Text processing method and device

By processing text based on the rule adjustment and rendering strategy of the target language in a rich text editor, the problem of inconsistent language specifications in the existing technology is solved, and the accuracy of text rendering and visual experience are improved.

CN120337868APending Publication Date: 2025-07-18ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510358033.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

Existing rich text editors cannot meet language specifications when dealing with languages with special writing rules, resulting in the rendered text being unable to ensure accuracy and consistency.

Method used

By determining the pending text corresponding to the target language in the text editing interface, adjusting the target characters based on the language rules of the target language, obtaining the initial text, and rendering using the text rendering strategy corresponding to the target language to ensure that the text complies with the language specifications.

Benefits of technology

Improve the accuracy and visual experience of text rendering, ensure that the rendered text complies with the writing specifications of the target language, and improves the user's editing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120337868A_ABST
    Figure CN120337868A_ABST
Patent Text Reader

Abstract

The invention provides a text processing method and device, and the method comprises the steps: determining a to-be-processed text corresponding to a target language on a text editing interface based on a text editing element during text editing. The target characters in the to-be-processed text are adjusted based on the language rule of the target language to obtain the initial text, the target characters in the to-be-processed text are adjusted according to the language specification of the target language, and standardized processing of the target characters is achieved. According to the method, the initial text is rendered based on the text rendering strategy corresponding to the target language, the target text is displayed in the text display area of the text editing interface based on the rendering result, the text rendering strategy can ensure that the text rendering effect is improved in the text rendering process, the target text obtained through rendering conforms to the language specification of the target language, and the user experience is improved. And the accuracy of text rendering is ensured while the visual experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies, and particularly to a text processing method and apparatus. Background Art

[0002] With the accelerating advancement of the globalization process, the cultural exchanges and trade between different countries have become increasingly close. Against this background, digital business has become an important bridge for cooperation between the two parties. However, in the field of rich text document editing, due to the differences in writing habits and rules between different languages, existing editing tools face a series of challenges. Although the current rich text editors on the market have achieved remarkable achievements in terms of versatility and ease of use, there are still certain limitations when dealing with languages with special writing rules, and the rendered text cannot meet the language specifications, nor can it ensure the accuracy of text rendering. Therefore, there is an urgent need for an effective text processing method to solve the above problems. Summary of the Invention

[0003] In view of this, embodiments of this application provide a text processing method to solve the technical defects existing in the prior art. Embodiments of this application also provide a text processing apparatus, a computing device, a computer-readable storage medium, and a computer program product.

[0004] According to a first aspect of embodiments of this application, there is provided a text processing method, including:

[0005] Determining text to be processed corresponding to a target language based on text editing elements in a text editing interface;

[0006] Adjusting target characters in the text to be processed based on the language rules of the target language to obtain an initial text;

[0007] Rendering the initial text based on a text rendering strategy corresponding to the target language, and displaying target text in a text display area of the text editing interface based on the rendering result.

[0008] Optionally, the adjusting target characters in the text to be processed based on the language rules of the target language to obtain an initial text includes:

[0009] Determining identification symbols and text characters included in the target characters in the text to be processed;

[0010] Adjusting the identification symbols based on the language rules of the target language to obtain target identification symbols, and adjusting the text characters in terms of diacritical marks and letters to obtain target text characters;

[0011] Using the target identification symbols and the target text characters as the initial text.

[0012] Optionally, determining the text to be processed corresponding to the target language based on the text editing elements in the text editing interface includes:

[0013] Determining the edited text corresponding to the target language based on the text editing elements in the text editing interface;

[0014] Processing the edited text in terms of text content dimension, text format dimension, character encoding dimension, character form dimension, and / or text embedding dimension to obtain the text to be processed.

[0015] Optionally, rendering the initial text based on the text rendering strategy corresponding to the target language includes:

[0016] Determining a direction rendering strategy, a symbol rendering strategy, a font rendering strategy, a format rendering strategy, and a style rendering strategy in the text rendering strategy corresponding to the target language;

[0017] Selecting at least one rendering strategy from the direction rendering strategy, the symbol rendering strategy, the font rendering strategy, the format rendering strategy, and the style rendering strategy based on the text type of the initial text;

[0018] Rendering the initial text based on the at least one rendering strategy.

[0019] Optionally, when the initial text is mixed text, rendering the initial text based on the text rendering strategy corresponding to the target language includes:

[0020] Dividing the initial text into at least one character and determining the embedding level corresponding to each of the at least one character;

[0021] Determining the text direction of each character based on the embedding level corresponding to each of the at least one character;

[0022] Rendering the at least one character based on the text rendering strategy corresponding to the target language and the text direction of each character.

[0023] Optionally, before determining the text to be processed corresponding to the target language based on the text editing elements in the text editing interface, it further includes

[0024] Determining at least one target character in the text to be processed;

[0025] Performing a connectivity detection on each target character among the at least one target character according to the character context, and determining the character form of each target character according to the detection result;

[0026] Encode the text to be processed based on the character form of each target character.

[0027] Optionally, the text processing method further includes:

[0028] Determine the text to be deleted in the text editing interface;

[0029] And determine the target text to be deleted based on the text selection area of the text to be deleted;

[0030] Determine the target diacritical mark and the target character in the target text to be deleted, and after deleting the target diacritical mark, delete the target character.

[0031] Optionally, the text processing method further includes:

[0032] Determine the text to be operated on in the text editing interface, and determine the target text selection area in the text to be operated on;

[0033] When the target text selection area contains character units, perform forward character detection and backward character detection on the character units;

[0034] Operate on the character units based on the detection results.

[0035] Optionally, the text processing method further includes:

[0036] Configure text proofreading configuration items, style formatting configuration items, and / or text conversion configuration items in the configuration interface associated with the text editing interface.

[0037] Optionally, the text processing method further includes:

[0038] Edit the guiding text based on the text editing elements in the text editing interface;

[0039] Select the target hint text corresponding to the guiding text from the text library associated with the guiding text, and display the target hint text in the text editing interface.

[0040] According to the second aspect of the embodiments of the present application, there is provided a text processing device, including:

[0041] A determination module, configured to determine the text to be processed corresponding to the target language based on text editing elements in a text editing interface;

[0042] An adjustment module, configured to adjust the target characters in the text to be processed based on the language rules of the target language to obtain an initial text;

[0043] A rendering module, configured to render the initial text based on a text rendering strategy corresponding to the target language, and display the target text in a text display area of the text editing interface based on the rendering result.

[0044] According to a third aspect of embodiments of the present application, there is provided a computing device, including:

[0045] A memory and a processor;

[0046] The memory is used to store computer-executable instructions, and when the processor executes the computer-executable instructions, the steps of the text processing method are implemented.

[0047] According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the text processing method are implemented.

[0048] According to a fifth aspect of embodiments of the present application, there is provided a chip, which stores a computer program, and when the computer program is executed by the chip, the steps of the text processing method are implemented.

[0049] According to a sixth aspect of embodiments of the present specification, there is provided a computer program product, including a computer program or instructions, and when the computer program or instructions are executed by a processor, the steps of the above text processing method are implemented.

[0050] In the text processing method provided by the present application, when performing text editing, the text to be processed corresponding to the target language can be determined based on text editing elements in the text editing interface. The target characters in the text to be processed are adjusted based on the language rules of the target language to obtain the initial text, so as to adjust the target characters in the text to be processed according to the language specifications of the target language and realize the normalization processing of the target characters. The initial text is rendered based on the text rendering strategy corresponding to the target language, and the target text is displayed in the text display area of the text editing interface based on the rendering result. The text rendering strategy can ensure that the text rendering effect is improved during the text rendering process, so that the rendered target text conforms to the language specifications of the target language, improving the visual experience while ensuring the accuracy of text rendering. Description of the Drawings

[0051] Figure 1 is a flowchart of a text processing method provided by an embodiment of the present application;

[0052] Figure 2 is a text processing flowchart applied to Arabic editing provided by an embodiment of the present application;

[0053] Figure 3 is a data processing flowchart corresponding to Arabic provided by an embodiment of the present application;

[0054] Figure 4 It is a schematic structural diagram of a text processing device provided by an embodiment of the present application;

[0055] Figure 5 It is a structural block diagram of a computing device provided by an embodiment of the present application. Detailed implementation manners

[0056] Many specific details are set forth in the following description in order to provide a thorough understanding of the present application. However, the present application can be practiced in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the connotation of the present application. Therefore, the present application is not limited by the specific implementations disclosed below.

[0057] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the", and "said" used in one or more embodiments of the present application and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more of the associated listed items.

[0058] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.

[0059] First, the noun terms related to one or more embodiments of the present invention are explained.

[0060] Unicode Bidirectional Algorithm (Bidi algorithm for short): A standard algorithm for processing mixed-direction text (such as a mixture of Arabic and English) to ensure that the text is arranged in the correct reading order when displayed. In the present application, a text processing method is provided. The present application is also related to a text processing device, a computing device, a computer-readable storage medium, and a computer program product. These will be described in detail one by one in the following embodiments.

[0061] Figure 1 The flowchart of a text processing method provided by an embodiment of the present application is shown, which specifically includes the following steps:

[0062] Step 102: Determine the text to be processed corresponding to the target language based on text editing elements in the text editing interface.

[0063] Specifically, the text editing interface can be the user editing interface of a text editor. That is, the user of the text editor can perform rich text editing of different language types or languages in the text editing interface. The target language can be any language, including but not limited to Arabic, Chinese, English, etc. The target language can also be languages such as Arabic and Hebrew with a right-to-left writing and reading direction. The text editing elements are the cursor position used to represent the current text input position in the text editing interface and the text selection area used to represent the selection of text. The text selection area is the text area covered after selecting the text and dragging the cursor. The text content in the text selection area usually has a background color to distinguish it from the unselected text content. The text to be processed is the text content input by the user in the text editing interface. The text to be processed includes character content such as characters, diacritical marks, and punctuation marks.

[0064] Based on this, when performing text editing in the text editing interface, text content can be input in the text editing interface, and the input text content can be used as the text to be processed corresponding to the target language based on the position and state of the text editing elements in the text editing interface. This is to facilitate subsequent interface rendering for the text to be processed and ensure that the text to be processed is displayed in the text editing interface in a form that conforms to the writing norms of the target language.

[0065] Furthermore, the text to be processed determined in the text editing interface needs to conform to data specifications, that is, have a unified data format, and the characters in the text to be processed conform to the language norms of the target language. Therefore, if the determined edited text does not conform to the data specifications, further processing of the edited text is required to obtain the text to be processed. The specific implementation is as follows:

[0066] Determine the edited text corresponding to the target language based on the text editing elements in the text editing interface; process the edited text in terms of text content dimension, text format dimension, character encoding dimension, character form dimension, and / or text embedding dimension to obtain the text to be processed.

[0067] Specifically, the edited text is the text content directly input by the user in the text editing interface, and there are problems such as formatting errors and inaccurate writing in the edited text. The text content dimension is used to detect the accuracy of the text content writing in the edited text, the text format dimension is used to detect the accuracy of the text format in the edited text, the text format includes the character connection format and the symbol format, and also includes the text writing direction; the character encoding dimension is used to detect the accuracy of the text content encoding in the edited text; the character form dimension is used to detect the accuracy of the text content connection form in the edited text; the text embedding dimension is used to detect the accuracy of the text content embedding level in the edited text, and the embedding level is used to represent the writing and reading directions of the text content. An even level represents the LTR direction, that is, from left to right; an odd level represents the RTL direction, that is, from right to left.

[0068] Based on this, in the text editing interface, determine the edited text corresponding to the target language based on the text editing elements. Determine the text processing dimensions such as the text content dimension, the text format dimension, the character encoding dimension, the character form dimension, and the text embedding dimension for normalizing the edited text. Select at least one text processing dimension from the text content dimension, the text format dimension, the character encoding dimension, the character form dimension, and the text embedding dimension to process the edited text according to the problems existing in the edited text, and obtain the text to be processed. Ensure that the format of the edited text is unified, that is, it has a unified rich text data format, complete the encoding conversion and form normalization of the edited text, so that the punctuation marks in the edited text conform to the language norms of the target language, and the diacritical marks in the edited text are in the correct positions.

[0069] For example, in the case where the target language is a language using Arabic letters, the language norm of the text to be processed is to write and read from right to left. After the user inputs the edited text using a rich text editor in the text editing interface, it is necessary to unify the format of the edited text input by the user, normalize the text format and text content of the edited text, detect the correctness of the form of the characters in the edited text, detect the direction of the characters in the edited text to ensure the correct writing direction, and detect the position of the diacritical marks in the edited text to ensure the correct position of the diacritical marks.

[0070] In summary, process the edited text in the text content dimension, the text format dimension, the character encoding dimension, the character form dimension, and / or the text embedding dimension to obtain the text to be processed. Ensure that the characters in the text to be processed have a unified rich text data format, so as to ensure the consistency and portability of the text to be processed between different components. And ensure the accuracy of the characters in the text to be processed, so that the text to be processed is displayed in the correct form and conforms to the language norms of the target language.

[0071] Step 104: Adjust the target characters in the text to be processed based on the language rules of the target language to obtain the initial text.

[0072] Specifically, after determining the text to be processed corresponding to the target language based on the text editing elements in the text editing interface, the target characters in the text to be processed can be adjusted based on the language rules of the target language to obtain the initial text. Among them, the language rules of the target language represent the text editing rules and reading rules of the target language, including but not limited to the text editing direction, character editing rules, and text reading direction. The initial text is the text content with accurate characters and character sizes that meet the rendering performance requirements.

[0073] Based on this, after determining the text to be processed corresponding to the target language based on the text editing elements in the text editing interface, determine the target characters that need to be adjusted in the text to be processed based on the language rules of the target language, and adjust the target characters in dimensions such as character accuracy and character standardization to obtain the initial text.

[0074] Furthermore, after determining the text to be processed, since the text to be processed in the target language contains special characters, it is also necessary to adjust special characters such as identification symbols and text characters in the text to be processed to ensure the accuracy of the characters in the text to be processed. The specific implementation is as follows:

[0075] Determine the identification symbols and text characters included in the target characters in the text to be processed; adjust the identification symbols based on the language rules of the target language to obtain target identification symbols, and adjust the text characters in the dimensions of diacritical marks and letters to obtain target text characters; use the target identification symbols and the target text characters as the initial text.

[0076] Specifically, the identification symbols included in the target characters can be symbols such as punctuation marks and parentheses, and the text characters included in the target characters can be letter symbols. The target identification symbols can be the identification symbols obtained by adjusting the identification symbols in dimensions such as text direction and editing position. The target text characters refer to the text characters obtained by adjusting the text characters in dimensions such as size and form.

[0077] Based on this, determine the identification symbols and text characters included in the target characters in the text to be processed. Adjust the text direction and writing position of the identification symbols based on the language rules of the target language to obtain target identification symbols with accurate positions and accurate text directions, and adjust the text characters in the dimensions of diacritical marks and letters based on the language rules of the target language, adjust the positions of the diacritical marks, and adjust the sizes and forms of the letters to obtain target text characters. Use the target identification symbols and the target text characters as the initial text.

[0078] Continuing with the above example, after obtaining the text to be processed, the text to be processed is detected, and the punctuation marks, letters, and diacritical marks in the text to be processed are used as target characters for normalization adjustment. In Arabic, the Arabic comma question mark semicolon and other punctuation marks are all in a horizontally flipped form, and it is necessary to ensure the accurate text direction of the punctuation marks. In Arabic, "(" is the closing parenthesis, while ")" is the opening parenthesis, and it is necessary to ensure the accuracy of this symbol. For the diacritical marks in the text to be processed, it is necessary to ensure the accurate position of the diacritical marks. An Arabic character (such as ) and a diacritical mark (such as ) in the text to be processed, as a combined unit, it is necessary to ensure the accurate position of the diacritical mark. The character and the diacritical mark are combined into and the diacritical mark is located in the upper left corner of the Arabic character. In addition, in order to ensure the rendering performance during rendering, it is also necessary to adjust the size and shape of the Arabic letters.

[0079] To sum up, based on the language rules of the target language, the text direction and writing position of the identification symbols are adjusted, and the text characters are adjusted in the dimensions of diacritical marks and letters. The position of the diacritical marks is adjusted, and the size and shape of the letters are adjusted to ensure the accuracy of the characters in the text to be processed, and to ensure that the rendering efficiency and accuracy are improved during text rendering.

[0080] Step 106: Render the initial text based on the text rendering strategy corresponding to the target language, and display the target text in the text display area of the text editing interface based on the rendering result.

[0081] Specifically, after adjusting the target characters in the text to be processed based on the language rules of the target language to obtain the initial text, the initial text can be rendered based on the text rendering strategy corresponding to the target language, and the target text is displayed in the text display area of the text editing interface based on the rendering result. Among them, the text rendering strategy is used to render the initial text, and the text rendering strategy can perform rendering in dimensions such as style, text direction, text form, symbol position, and form for the initial text. The rendering result is the processing result of processing the characters in the initial text based on the text rendering strategy, including processing the position and form of the characters in the initial text. The text display area refers to the area in the text editing interface used to display the rendered initial text, and the text display area can be an area with a certain size and range in the text editing interface. The target text is the text displayed in the text display area of the text editing interface, and the target text corresponds to the text to be processed and is the normalized text obtained after processing the user-input text to be processed.

[0082] Based on this, after adjusting the target characters in the text to be processed according to the language rules of the target language to obtain the initial text, the initial text is rendered in the style dimension, position dimension, and form dimension respectively based on the text rendering strategy corresponding to the target language, and the target text corresponding to the text to be processed is displayed in the text display area of the text editing interface based on the rendering result, ensuring that the target text obtained by rendering conforms to the text writing norms of the target language.

[0083] Furthermore, when rendering the initial text, it is necessary to consider the writing characteristics and formats of the target language, and render the initial text according to the text rendering strategy corresponding to the target language. The specific implementation is as follows:

[0084] Determine the direction rendering strategy, symbol rendering strategy, font rendering strategy, format rendering strategy, and style rendering strategy in the text rendering strategy corresponding to the target language; select at least one rendering strategy from the direction rendering strategy, the symbol rendering strategy, the font rendering strategy, the format rendering strategy, and the style rendering strategy based on the text type of the initial text; render the initial text based on the at least one rendering strategy.

[0085] Specifically, the direction rendering strategy is used to render in the dimension of the text writing direction, and render the initial text according to the writing order corresponding to the target language. The symbol rendering strategy is used to render the diacritical marks, punctuation marks, parentheses and other symbols in the initial text to clarify the positions of the diacritical marks; the font rendering strategy is used to determine a suitable font size for the initial text for text rendering; the format rendering strategy is used to render the initial text in list format, load the necessary characters in the initial text, and render the visible area in the initial text to improve the rendering performance; the style rendering strategy is used to preload the styles when the initial text contains complex styles, or can also preload the styles with high usage frequencies, so that when rendering the initial text, the preloaded styles can be directly used to complete the rendering of the initial text.

[0086] Based on this, determine the direction rendering strategy, symbol rendering strategy, font rendering strategy, format rendering strategy, and style rendering strategy in the text rendering strategy corresponding to the target language. Select at least one rendering strategy from the direction rendering strategy, symbol rendering strategy, font rendering strategy, format rendering strategy, and style rendering strategy based on the text type of the initial text. Determine the content that needs to be rendered specifically when rendering the initial text according to the text content of the initial text, and then select at least one rendering strategy that matches the rendering requirements of the initial text. Render the initial text based on the at least one rendering strategy.

[0087] Continuing with the above example, when rendering the initial text, it is necessary to determine the text type of the initial text. When the text type corresponds to Arabic text and includes character types, diacritic types, and stylesheet types, it is necessary to select the direction rendering strategy, symbol rendering strategy, font rendering strategy, format rendering strategy, and style rendering strategy from the rendering strategies included in the text rendering strategy to render the initial text. During the rendering process, it is necessary to ensure that the initial text is displayed from right to left, and the position of the diacritic is at the correct position around the character, such as above or below the character. When rendering the initial text, select the font type corresponding to the target language to ensure suitability for the rendering of Arabic fonts. For the case where the style of the initial text is a list, render the visible area to improve text processing performance. For the rendering of the initial text with complex styles, the styles can be pre-loaded and then the initial text can be rendered to optimize the rendering performance.

[0088] In summary, based on the text type of the initial text, render the initial text using at least one rendering strategy among the direction rendering strategy, symbol rendering strategy, font rendering strategy, format rendering strategy, and style rendering strategy, improve the rendering efficiency of the initial text, and flexibly select the rendering strategy according to the text type of the initial text to improve the flexibility of text rendering.

[0089] Furthermore, in the case where the initial text is mixed text, it means that the initial text contains text content in at least two languages and includes two languages with different text directions. Therefore, when rendering the initial text, it is necessary to determine the embedding level corresponding to each character, and then determine the text direction of each character, and then render the initial text. The specific implementation is as follows:

[0090] Divide the initial text into at least one character, and determine the embedding level corresponding to each of the at least one character; based on the embedding level corresponding to each of the at least one character, determine the text direction of each character; render the at least one character based on the text rendering strategy corresponding to the target language and the text direction of each character.

[0091] Specifically, the embedding level corresponding to a character represents the text direction corresponding to the character, that is, the text editing, writing, and reading directions. The embedding level includes an even level and an odd level. The even level indicates that the text direction is from left to right, and the odd level indicates that the text direction is from right to left.

[0092] Based on this, the initial text is divided into at least one character according to character units, and the embedding level corresponding to each character in the at least one character is determined, that is, the text direction. Based on the embedding levels corresponding to the at least one character respectively, the text direction of each character is determined. Based on the text rendering strategy corresponding to the target language and the text direction of each character, the at least one character is rendered, so that each character in the initial text can be rendered and displayed according to the language corresponding to the character.

[0093] Continuing with the above example, in the case where the initial text is mixed text, it means that the initial text contains both Arabic and other languages. When the initial text contains Arabic and Chinese, the initial text contains text written from right to left and text written from left to right. Therefore, it is necessary to perform a character-by-character direction analysis on the initial text. After processing the initial text using a bidirectional algorithm, it is then rendered. The initial text is divided into characters, and the text direction of each character is determined according to the embedding level of each character. The initial text is rendered based on the text direction and the text rendering strategy.

[0094] To sum up, based on the text rendering strategy corresponding to the target language and the text direction of each character, the at least one character is rendered, so that each rendered character matches the text direction of the language.

[0095] Furthermore, during the editing of the target language, the editing of characters will undergo morphological changes according to the position of the characters in the word to achieve the connection between characters. The specific implementation is as follows:

[0096] Determine at least one target character in the text to be processed; perform a connectivity detection on each target character in the at least one target character according to the character context, and determine the character form of each target character according to the detection result; encode the text to be processed based on the character form of each target character.

[0097] Specifically, the target character can be a character that needs to be rendered in the text to be processed. The character context refers to the characters before the position of the target character and the characters after the position of the target character. The connectivity detection is used to detect the connection relationship between the target character and the characters before and after the target character. The character form represents the form of the character display determined according to the connection relationship between characters when rendering the target character. The character form is determined according to the position of the target character in the text to be processed. The target character can be the first character, middle character, last character, and independent character in the text to be processed. The first character is located at the beginning of the text to be processed, the middle character is located in the middle position of the text to be processed, the last character is located at the end of the text to be processed, and the independent character is an independent character without a connecting character in the text to be processed.

[0098] Based on this, at least one target character is determined in the text to be processed. For each of the at least one target character, connectivity detection is performed according to the character context. It is detected whether there is a connecting character between the target character and the characters before and after the position of the target character in the text to be processed that has a connecting relationship with the target character. If there is a connecting character, the existence of the connecting character will affect the form of the target character. Therefore, it is necessary to determine the position of the target character in the text to be processed according to the detection result, and perform morphological changes on each target character according to the detection result to determine the character form of each target character. Based on the character form of each target character, the text to be processed is encoded to implement the connection processing of the characters in the text to be processed.

[0099] Continuing with the above example, during the editing of the text to be processed, or after the editing of the text to be processed is completed, character connection processing can be performed on the text to be processed. Determine the target characters that need to be connected in the text to be processed, and perform connectivity detection according to the positions of the target characters in the text to be processed, such as the beginning, middle, end, independent, etc. Detect whether there are connecting characters before and after the target characters that affect the display form of the target characters, and perform morphological changes on the target characters based on the connecting characters to determine the character form of the target characters, and further perform character encoding to implement the connection processing of the characters in the text to be processed.

[0100] In summary, the text to be processed is encoded based on the character form of each target character to implement the connection processing of the characters in the text to be processed. Ensure that the characters in the text to be processed can all correctly display the connection form according to their context.

[0101] Furthermore, when deleting the text to be deleted in the text editing interface, it is necessary to consider the impact of the deletion of the text to be deleted on the target text to be deleted associated with the text to be deleted in the text editing interface. The specific implementation is as follows:

[0102] Determine the text to be deleted in the text editing interface; and determine the target text to be deleted based on the text selection area of the text to be deleted in the text to be deleted; determine the target diacritical mark and target character in the target text to be deleted, and after deleting the target diacritical mark, delete the target character.

[0103] Specifically, the text to be deleted is the text content that needs to be deleted in the text editing interface, and the text is selected from the text to be deleted for deletion. The selection area of the text to be deleted is the selected area where the text to be deleted in the text to be processed is located, indicating that the text to be deleted has been selected. The target text to be deleted is the text that actually needs to be deleted in the text to be deleted. The target diacritical mark refers to the diacritical mark included in the target text to be deleted, and the target character refers to the character included in the target text to be deleted. When the selection area of the text to be deleted is empty, the target text to be deleted is determined based on the cursor position and the text direction, and the target text to be deleted is deleted.

[0104] Based on this, in the text editing interface, the text to be deleted is determined, and based on the selection area of the text to be deleted in the text to be deleted, the target text to be deleted that needs to be deleted, and the text direction of the target text to be deleted are determined. The target diacritical mark and the target character are determined in the target text to be deleted. After deleting the target diacritical mark according to the text direction of the target text to be deleted, the target character is then deleted.

[0105] Continuing with the above example, when the text to be deleted is in the selection area of the text to be deleted, the text to be deleted that needs to be deleted can be determined in the text to be deleted according to the selection area of the text to be deleted. in the selection area of the text to be deleted. When deleting , first delete the diacritical mark in the selection area of the text to be deleted, and then delete the selection area of the character in the selection area of the text to be deleted in the selection area of the text to be deleted and in the selection area of the text to be deleted. The remaining

[0106] In summary, the target diacritical mark and the target character are determined in the target text to be deleted. After deleting the target diacritical mark, the target character is deleted, so as to realize the sequential deletion of the diacritical mark and the target character and ensure the accuracy of text deletion.

[0107] Furthermore, considering the language characteristics of the target language, when operating on the text to be operated in the text editing interface, it is necessary to determine the character unit in the target text selection area of the text to be operated, and perform corresponding operations after detecting the character unit. The specific implementation is as follows:

[0108] Determine the text to be operated in the text editing interface, and determine the target text selection area in the text to be operated; when the target text selection area contains a character unit, perform forward character detection and backward character detection on the character unit; perform operations on the character unit based on the detection results.

[0109] Specifically, the text to be operated on is the text that needs to be copied, deleted, or updated in the text editing interface. The target text selection area is used to select the text that actually needs to be operated on in the text to be operated on. The target text selection area can cover all the text to be operated on, or it can cover part of the text content in the text to be operated on. A character unit refers to a character unit of the target language. A character unit consists of at least one character and has a complete interpretation. Forward character detection and backward character detection are used to detect the text before the character unit and the text after the character unit based on the character unit.

[0110] Based on this, in the text editing interface, determine the text to be operated on, and in the text to be operated on, determine the target text selection area, and select the text content that needs to be operated on in the text to be operated on. When the target text selection area contains a character unit, it means that the target text selection area contains text content and the target text selection area is not empty. Then, perform forward character detection and backward character detection on the character unit to detect whether there are characters connected to the character unit before and after the character unit. When it is determined based on the detection result that there are no characters connected to the character unit before and after the detected character unit, directly operate on the character unit. When it is determined based on the detection result that there are characters connected to the character unit before or after the detected character unit, directly splice the character unit and the detected character and then perform the operation.

[0111] Continuing with the above example, for the text to be operated on in the editing interface The target text selection area selects the character unit For the character unit Perform forward character detection and backward character detection, and determine the characters existing before and after the character unit Then, perform operations such as deletion and modification after character splicing.

[0112] To sum up, when the target text selection area contains a character unit, perform forward character detection and backward character detection on the character unit, and operate on the character unit based on the detection result to ensure the accuracy and integrity of the text operation.

[0113] Furthermore, for a rich text editor, a slot mechanism can be configured to expand the functions of the rich text editor. Configure each configuration item in the text editing interface of the rich text editor to complete the initialization of the text editing plugin. The specific implementation is as follows:

[0114] Configure a text proofreading configuration item, a style formatting configuration item, and / or a text conversion configuration item in the configuration interface associated with the text editing interface.

[0115] Based on this, the text proofreading configuration item is used to proofread the text being edited in the text editing interface, proofreading it in dimensions such as font size and correctness. The style formatting configuration item is used to optimize the format according to the different style types of the edited text. For example, for the poetry style, it is necessary to align each line of the poem and automatically optimize the line spacing. The text conversion configuration item is used to automatically perform data conversion and date conversion on the edited text. The text proofreading configuration item, style formatting configuration item, and / or text conversion configuration item can be configured in the configuration interface associated with the text editing interface. By enabling each configuration item, the corresponding extended function is used when editing the text.

[0116] Continuing with the above example, the text proofreading configuration item, style formatting configuration item, and / or text conversion configuration item are configured in the configuration interface associated with the text editing interface to implement the function extension of the rich text editor. Multiple slot types are predefined in the rich text editor, including toolbar slots, content processing slots, and rendering slots, etc. Users can select the appropriate slot type according to their needs. Users can register custom plugins into the rich text editor through a simple registration process. The rich text editor will insert the plugin into the corresponding slot according to the type of the plugin. To ensure the stability and compatibility of the plugin, a lifecycle management mechanism for the plugin is configured. Corresponding lifecycle events will be triggered during the registration, use, and uninstallation of the plugin to ensure the correct operation of the plugin. To enhance the interaction between the plugin and the editor, a data communication mechanism is configured to allow data exchange between the plugin and the rich text editor. The plugin can obtain the status information of the rich text editor through this mechanism and operate on the rich text editor.

[0117] In summary, the text proofreading configuration item, style formatting configuration item, and / or text conversion configuration item are configured in the configuration interface associated with the text editing interface to implement the initialization of the text editing plugin, improve the text editing efficiency during the text editing process, and ensure that the edited text has a high degree of accuracy.

[0118] Furthermore, the rich text editor contains a text library, in which common symbols and phrases in the target language are pre-stored. When entering text in the text editing interface, the target prompt text can be selected from the text library according to the input guiding text without manually editing the target prompt text. The specific implementation is as follows:

[0119] Edit the guiding text based on the text editing element in the text editing interface; select the target prompt text corresponding to the guiding text from the text library associated with the guiding text and display the target prompt text in the text editing interface.

[0120] Specifically, the guiding text can be the text input by the user in the text editing interface, that is, the text that has been displayed in the text editing interface through methods such as keyboard, handwriting, virtual keyboard, etc., or the text displayed in the candidate area of the text editing interface. The text library is used to store the commonly used characters and commonly used phrases corresponding to the target language. The commonly used characters are the characters with a higher frequency of use during text editing, and the commonly used phrases are the phrases with a higher frequency of use during text editing. The target prompt text is the text that the user needs to input and is associated with the guiding text.

[0121] Based on this, the guiding text is edited in the text editing interface in combination with text editing elements. Matching is performed in the text library associated with the guiding text, candidate texts that match the guiding text are determined in the text library, and the target prompt text with a higher matching degree to the guiding text is selected from the candidate texts. The target prompt text is selected as the user's input and is displayed in the text editing interface.

[0122] In summary, the target prompt text corresponding to the guiding text is selected from the text library associated with the guiding text and is displayed in the text editing interface. Without manual editing, the target prompt text can be determined by selection and displayed in the text editing interface, improving the text editing efficiency.

[0123] In the text processing method provided by this application, when performing text editing, the text to be processed corresponding to the target language can be determined in the text editing interface based on text editing elements. The target characters in the text to be processed are adjusted based on the language rules of the target language to obtain the initial text, realizing the adjustment of the target characters in the text to be processed according to the language specifications of the target language and realizing the normalization processing of the target characters. The initial text is rendered based on the text rendering strategy corresponding to the target language, and the target text is displayed in the text display area of the text editing interface based on the rendering result. The text rendering strategy can ensure that the text rendering effect is improved during the text rendering process, so that the rendered target text conforms to the language specifications of the target language, improving the visual experience while ensuring the accuracy of text rendering.

[0124] The following combines the attached Figure 2 Taking the application of the text processing method provided by this application to Arabic editing as an example, the text processing method will be further described. Among them, Figure 2 FIG. shows a text processing flow chart applied to Arabic editing provided by an embodiment of this application, which specifically includes the following steps:

[0125] User input, the user inputs Arabic text through the editing interface of the rich text editor.

[0126] Character connection processing adjusts the display form of characters according to their positions in words. Arabic characters automatically change their forms when written according to their positions in words (such as at the beginning, in the middle, at the end, or independent). In the data processing stage, character processing needs to be carried out based on the character connection processing algorithm to ensure that each character can correctly display the connection form according to its context. In the character connection processing algorithm, character connection classifications include bidirectional connection characters, right connection characters, and non-connection characters. The character connection processing algorithm will identify the position of each character in the word and then determine whether the character is at the beginning, in the middle, at the end of the word, or exists as an independent character. Further analyzing the connection characteristics of each character (whether it can be connected to the preceding and following characters), Arabic characters are divided into two categories: connectable and non-connectable. Then, according to the position and connectivity, the correct morphological variant is selected for each character. For example, if a character is at the beginning of a word and there is a connectable character behind it, the "initial form" is selected. The selected form is mapped to the corresponding Unicode code point. Different forms of Arabic have dedicated encodings in Unicode. In practical applications, in a rich text editor, the character connection processing algorithm usually plays a role in the input processing stage, after editing operations, and before rendering. That is, when the user inputs Arabic characters, the character connection processing algorithm is immediately applied; after inserting, deleting, or modifying text, the character connection processing algorithm is used to recalculate the connection form of the affected area; before text rendering, the character connection processing algorithm is used to ensure that all characters use the correct morphological variant.

[0127] Bidirectional text processing is used to ensure the correct display of text mixed with Arabic and other languages. Arabic has special text direction characteristics, namely, RTL (Right-to-Left): text from right to left. When processing mixed text, characters are divided into strong characters, weak characters, and neutral characters. Strong characters have a definite direction, L type: characters from left to right (such as English letters, Chinese characters); R type: characters from right to left (such as Arabic letters); AL type: Arabic letters, regarded as R type. The direction of weak characters depends on the context characters, EN: European Number; AN: Arabic Number. Neutral characters represent characters without an inherent direction, such as spaces, punctuation marks, etc. In specific implementation, the text direction is represented by the embedding level. An even level represents the LTR (Left-to-Right, text from left to right) direction, and an odd level represents the RTL direction. When performing bidirectional text processing, the text is first divided into paragraphs, and the basic direction of each paragraph is determined. If the paragraph direction is LTR, the basic embedding level is 0; if it is RTL, it is 1. Then, the initial embedding level of each character is parsed, the type of weak characters is adjusted according to the context, and neutral characters are processed. After adjusting the embedding level, reordering is performed. The characters are reordered according to the final embedding level. Characters with the same embedding level form a substring, and the display direction is determined according to the parity of the level.

[0128] Punctuation processing, that is, processing special punctuation marks in Arabic. The punctuation marks in Arabic are different from those in Latin. During the data processing stage, special processing of punctuation marks is required to ensure that the punctuation marks are correctly displayed according to the writing habits of Arabic. The punctuation marks in Arabic are similar in shape to those in the Latin system but have the opposite direction. For example, the comma in Arabic question mark semicolon etc. are all in a horizontally flipped form, and these symbols need to be correctly displayed according to the reading order from right to left. In addition, in Arabic, punctuation marks need to be adjusted in position according to the RTL (from right to left) direction. For example, the opening and closing order of parentheses is opposite to that in Latin: in Arabic, "(" is the closing parenthesis, and ")" is the opening parenthesis.

[0129] Rendering optimization ensures the correct display of Arabic text through RTL support, diacritic positioning, and font optimization. Specifically, when implementing, the rendering engine was enhanced to support RTL (Right-to-Left) text, ensuring that the right-to-left writing order of Arabic text is correctly reflected. Through the CSS direction and unicode-bidi properties, the writing direction and rendering behavior of the text can be controlled. Among them, the direction property is used to set the basic direction of the text, and the unicode-bidi property is used to more precisely control the display mode of bidirectional text. Through the CSS direction and unicode-bidi properties, Arabic text can be displayed from right to left, the right-to-left Arabic text can be correctly displayed in a left-to-right English environment, and "ABC123" can be forced to be displayed as "321CBA" from right to left. Additionally, Arabic text can be isolated from the surrounding English to prevent direction confusion.

[0130] Diacritics in Arabic need to be correctly combined and displayed with the characters. A diacritic positioning logic was added to the rendering algorithm to ensure that diacritics are accurately displayed above or below the characters. For example, the association handling between characters and diacritics: when the user inputs an Arabic character (such as ) and a diacritic (such as ), the rendering engine treats them as a combined unit. The character combined with the diacritic forms Position calculation: For diacritics above the character (such as ): Calculate the upper boundary position of the character and then place the diacritic at an appropriate height. For diacritics below the character (such as ): Calculate the lower boundary position of the character and then place the diacritic below. In addition, the display effect of Arabic text is closely related to font selection. The font selection mechanism was optimized at the rendering level to ensure the use of fonts suitable for Arabic text, providing a better reading experience, such as the Amiri font, Dubai font, etc.

[0131] Cursor positioning and selection area display, that is, optimizing the cursor positioning and selection area display algorithms to ensure a natural experience for users during the editing process. Optimize cursor positioning and selection area display to ensure that in a mixed text environment, the cursor can be correctly positioned between characters. The selection area display will also be automatically adjusted according to the writing direction of the text, providing intuitive feedback. When implementing, it is necessary to identify the boundaries of the characters. By accurately identifying the boundaries of combined characters, the cursor can be prevented from being inserted between the diacritic and the basic character. Provide different visual styles for the selection area according to the text direction, and use colors or shapes to distinguish selection areas in different directions in mixed text. For example, when the user is in mixed text When making a selection in [the relevant context], Latin part (LTR): The selected area expands from left to right, with a light blue background; Arabic part (RTL): The selected area expands from right to left, with a light green background.

[0132] Right-to-left input experience, that is, implementing right-to-left input logic to ensure a natural user input experience. To ensure a natural experience for users when inputting Arabic, right-to-left input logic is implemented in the editor. When users input Arabic letters, the cursor automatically moves to the left, conforming to the writing habit of Arabic.

[0133] Optimization of deletion and operation behaviors, that is, optimizing deletion and operation behaviors to ensure compliance with the writing habit of Arabic. The deletion and operation behaviors for Arabic are optimized to ensure that when users delete characters or diacritical marks, the operations conform to the writing habit. For example, when deleting a character containing a diacritical mark, the diacritical mark is deleted first, and then the character itself is deleted.

[0134] User interface, through which users can view and edit Arabic text.

[0135] Through the above detailed implementation process, the correct writing and reading of Arabic are ensured, providing users with an efficient, flexible, and friendly editing environment.

[0136] In practical applications, the slot mechanism of the editor is extended, and Arabic-specific tool plugins are provided, such as components for Arabic numeral conversion, special symbol insertion, text proofreading, poetry formatting, calendars, etc. Users can load and use these plugins according to their needs to enhance the functions of the editor.

[0137] To sum up, from data processing, browser support to display, comprehensive support is provided to ensure the correct input, display, and editing of Arabic. The bidirectional text algorithm is implemented and optimized to ensure the correct display of mixed text. Through specific rendering algorithms, the display effect of Arabic in the browser is optimized to solve the problems of character disconnection and misalignment. A friendly editing and reading interface is designed according to the writing and reading habits of Arabic to improve the user experience.

[0138] Figure 3 A data processing flow chart corresponding to Arabic provided by an embodiment of the present application is shown, which specifically includes the following steps:

[0139] User input, users input Arabic text through the editing interface of the rich text editor.

[0140] Data normalization, encoding conversion and character form normalization are performed on the input data to ensure the consistency and correctness of the data format.

[0141] Diacritic processing, which processes the diacritics in Arabic to ensure their correct display, that is, to ensure the correct position of the diacritics on the characters. The diacritics in Arabic (also known as "vocalization marks" or "tashkil") need to be precisely positioned above or below the base characters. These diacritics are not independent characters but marks attached to the base characters to indicate pronunciation. It includes multiple diacritic processing, that is, when a character has multiple diacritics (such as ), the position of each symbol is calculated according to the priority and traditional arrangement rules. For example: the character has both (fatha) and (shadda), and they will be arranged in a specific vertical stacking order. In addition, the positions of the diacritics may vary in different fonts, and the precise positions of the diacritics need to be adjusted according to the characteristics of the currently used font. For example: in the Noto Naskh Arabic and Amiri fonts, the same diacritic may require different position offsets. When the character is in ligature form (such as in the middle of a word), the position of the diacritic is adjusted according to the connection form of the character. For example: the character (the middle form of ) has a different diacritic position compared to its independent form .

[0142] Unify data format, convert the processed data into a unified rich text data format to ensure the consistency and portability of the data between different systems and components. This data format includes text content, format information, embedded objects, etc.

[0143] Symbol and phrase library, common symbols and phrases are embedded in the editor for users to select and use. Common symbols and phrases in Arabic are predefined in the data format, and users can conveniently insert these symbols and phrases to improve the editing efficiency

[0144] Rendering optimization, through specific rendering algorithms and style sheets, optimize the display effect of Arabic. The existing rendering engine has been optimized to solve the problems of Arabic character disconnection and misalignment. Specifically, it includes optimization of character connection form processing, font rendering optimization, character rendering order optimization, and diacritic positioning optimization.

[0145] DOM adaptation, optimize the conversion process from data to DOM to ensure the continuity and correctness of Arabic characters. For example, the appearance of numbers used in Arabic regions is different from that of Western numbers, and the numbers need to be converted; there are special ligature symbols in Arabic, such as (Lam-Alif) requires special hyphen replacement; Tatweel symbols need to be added at specified positions during Arabic editing; special punctuation marks in Arabic also need to be processed, such as question marks, commas, semicolons, ) left parentheses, right parentheses. In addition, special processing has been carried out for the format of Arabic, such as date format, text alignment and direction, poetry format, etc.

[0146] The display module provides a friendly editing and reading interface. The right-to-left writing order of Arabic has been fully considered in the interface design to ensure the naturalness of users when inputting and reading. A slot mechanism is provided to allow users to expand the editor functions according to their needs. Users can insert custom plugins through the slot mechanism to enhance the flexibility and functionality of the editor. For the special writing order of Arabic, the cursor positioning and selection area display algorithms are optimized to ensure the natural experience of users during the editing process. This includes the correct positioning of the cursor and the accurate display of the selection area. The deletion and operation behaviors for Arabic are optimized to ensure that deletions and other operations meet user expectations. This includes defining and optimizing the deletion rules for characters and diacritical marks.

[0147]

[0148]

[0149] The user interface allows users to view and edit Arabic text through the interface.

[0150] In summary, for the text processing method provided in an embodiment of this specification, through a predefined symbol and phrase library, users can conveniently insert common Arabic symbols and phrases, simplifying the input process and improving the editing efficiency. At the same time, data normalization and diacritic processing algorithms ensure the consistency and correctness of the input data, reducing errors during the editing process by users. The unique interaction design and rendering optimization ensure natural input and display effects of Arabic, enhancing the user's editing and reading experience. Through the slot mechanism, users can expand the editor's functions according to their needs, enhancing the flexibility and functionality of the editor. Users can easily register custom plugins into the editor to meet different business requirements. At the same time, the plugin life cycle management and data communication mechanism ensure the stability and compatibility of the plugins. By optimizing the rendering engine and style sheets, we have significantly improved the rendering performance of Arabic documents and reduced performance overhead. Through unified data formats and rendering algorithms, consistent display effects of Arabic documents on different platforms are ensured, enhancing the user experience. When users view and edit the same document on different devices, they can obtain consistent display effects, avoiding display problems caused by platform differences. Compatibility issues and system conflicts are reduced, enhancing the overall stability of the system. The plugin life cycle management and data communication mechanism ensure the stability and compatibility of the plugins, avoiding conflicts between plugins.

[0151] Corresponding to the above method embodiment, this application also provides an embodiment of a text processing device. Figure 4 The structural schematic diagram of a text processing device provided in an embodiment of this application is shown. As Figure 4 shown, the device includes:

[0152] A determination module 402, configured to determine the text to be processed corresponding to the target language based on text editing elements in a text editing interface;

[0153] An adjustment module 404, configured to adjust target characters in the text to be processed based on the language rules of the target language to obtain an initial text;

[0154] A rendering module 406, configured to render the initial text based on the text rendering strategy corresponding to the target language, and display the target text in a text display area of the text editing interface based on the rendering result.

[0155] In an optional embodiment, the adjustment module 404 is further configured to:

[0156] Determine the identification symbols and text characters included in the target characters in the text to be processed;

[0157] Adjust the identification symbol based on the language rules of the target language to obtain a target identification symbol, and adjust the text characters in the dimension of diacritical marks and the dimension of letters to obtain target text characters;

[0158] Use the target identification symbol and the target text characters as the initial text.

[0159] In an optional embodiment, the determination module 402 is further configured to:

[0160] Determine the edited text corresponding to the target language based on the text editing elements in the text editing interface;

[0161] Process the edited text in the dimensions of text content, text format, character encoding, character form, and / or text embedding to obtain the text to be processed.

[0162] In an optional embodiment, the rendering module 406 is further configured to:

[0163] Determine a direction rendering strategy, a symbol rendering strategy, a font rendering strategy, a format rendering strategy, and a style rendering strategy in the text rendering strategy corresponding to the target language;

[0164] Select at least one rendering strategy from the direction rendering strategy, the symbol rendering strategy, the font rendering strategy, the format rendering strategy, and the style rendering strategy based on the text type of the initial text;

[0165] Render the initial text based on the at least one rendering strategy.

[0166] In an optional embodiment, the rendering module 406 is further configured to:

[0167] Divide the initial text into at least one character and determine the embedding level corresponding to each of the at least one character;

[0168] Determine the text direction of each character based on the embedding level corresponding to each of the at least one character;

[0169] Render the at least one character based on the text rendering strategy corresponding to the target language and the text direction of each character.

[0170] In an optional embodiment, the rendering module 406 is further configured to:

[0171] Determine at least one target character in the text to be processed;

[0172] For each of the at least one target character, perform connectivity detection according to the character context, and determine the character form of each target character according to the detection result;

[0173] Encode the text to be processed based on the character form of each target character.

[0174] An optional embodiment, the rendering module 406 is further configured to:

[0175] Determine the text to be deleted in the text editing interface;

[0176] And determine the target text to be deleted based on the text selection area of the text to be deleted in the text to be deleted;

[0177] Determine the target diacritical mark and the target character in the target text to be deleted, and after deleting the target diacritical mark, delete the target character.

[0178] An optional embodiment, the rendering module 406 is further configured to:

[0179] Determine the text to be operated in the text editing interface, and determine the target text selection area in the text to be operated;

[0180] When the target text selection area contains character units, perform forward character detection and backward character detection on the character units;

[0181] Operate on the character units based on the detection results.

[0182] An optional embodiment, the rendering module 406 is further configured to:

[0183] Configure text proofreading configuration items, style formatting configuration items, and / or text conversion configuration items in the configuration interface associated with the text editing interface.

[0184] An optional embodiment, the rendering module 406 is further configured to:

[0185] Edit the guiding text based on the text editing element in the text editing interface;

[0186] Select the target hint text corresponding to the guiding text from the text library associated with the guiding text, and display the target hint text in the text editing interface.

[0187] The text processing device provided by the present application can determine the text to be processed corresponding to the target language based on text editing elements in the text editing interface when performing text editing. Adjust the target characters in the text to be processed according to the language rules of the target language to obtain the initial text, so as to adjust the target characters in the text to be processed according to the language specifications of the target language and realize the normalization processing of the target characters. Render the initial text based on the text rendering strategy corresponding to the target language, and display the target text in the text display area of the text editing interface based on the rendering result. The text rendering strategy can ensure that the text rendering effect is improved during the text rendering process, so that the rendered target text conforms to the language specifications of the target language, improving the visual experience while ensuring the accuracy of text rendering.

[0188] The above is a schematic solution of a text processing device according to this embodiment. It should be noted that the technical solution of this text processing device and the technical solution of the above text processing method belong to the same concept. For the details not described in the technical solution of the text processing device, reference can be made to the description of the technical solution of the above text processing method. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method. Each functional module is not an actual functional division or separation limitation. The device claim defined by such a set of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, rather than an entity device that mainly implements the solution through hardware.

[0189] Figure 5 The block diagram of a computing device 500 according to an embodiment of the present application is shown. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. The processor 520 is connected to the memory 510 through a bus 530, and the database 550 is used to store data.

[0190] The computing device 500 further includes an access device 540, and the access device 540 enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include the Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Card (NIC)), such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0191] In one embodiment of the present application, the above components of the computing device 500, as well as Figure 5 other components not shown in Figure 5 can also be connected to each other, for example, through a bus. It should be understood that

[0192] the block diagram of the computing device shown is for illustrative purposes only and is not a limitation on the scope of the present application. Those skilled in the art can add or replace other components as needed.

[0193] The processor 520 is used to execute computer-executable instructions of the text processing method.

[0194] The above is a schematic solution of a computing device in this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above text processing method belong to the same concept. For the details not described in the technical solution of the computing device, reference can be made to the description of the technical solution of the above text processing method.

[0195] An embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions that, when executed by a processor, are used for the text processing method.

[0196] The above is a schematic solution of a computer-readable storage medium in this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above text processing method belong to the same concept. For the details not described in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above text processing method.

[0197] An embodiment of the present application further provides a chip, which stores a computer program that, when executed by the chip, implements the steps of the text processing method.

[0198] An embodiment of this specification further provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above text processing method.

[0199] The above is a schematic solution of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above text processing method belong to the same concept. For the details not described in the technical solution of the computer program product, reference can be made to the description of the technical solution of the above text processing method.

[0200] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0201] The computer instructions include computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0202] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0203] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0204] The preferred embodiments of the present application disclosed above are only used to help illustrate the present application. The alternative embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principle and practical application of the present application, so that those skilled in the art can well understand and utilize the present application. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A text processing method, characterized in that Including: Determining the text to be processed corresponding to the target language based on text editing elements in the text editing interface; Adjusting target characters in the text to be processed based on the language rules of the target language to obtain an initial text; Rendering the initial text based on the text rendering strategy corresponding to the target language, and displaying the target text in the text display area of the text editing interface based on the rendering result.

2. The text processing method according to claim 1, characterized in that, The adjusting target characters in the text to be processed based on the language rules of the target language to obtain an initial text includes: Determining the identification symbols and text characters included in the target characters in the text to be processed; Adjusting the identification symbols based on the language rules of the target language to obtain target identification symbols, and adjusting the text characters in terms of diacritical marks dimension and letter dimension to obtain target text characters; Taking the target identification symbols and the target text characters as the initial text.

3. The text processing method according to claim 1, characterized in that The determining the text to be processed corresponding to the target language based on text editing elements in the text editing interface includes: Determining the edited text corresponding to the target language based on the text editing elements in the text editing interface; Processing the edited text in terms of text content dimension, text format dimension, character encoding dimension, character form dimension, and / or text embedding dimension to obtain the text to be processed.

4. The text processing method according to claim 1, characterized in that, The rendering the initial text based on the text rendering strategy corresponding to the target language includes: Determining a direction rendering strategy, a symbol rendering strategy, a font rendering strategy, a format rendering strategy, and a style rendering strategy in the text rendering strategy corresponding to the target language; Selecting at least one rendering strategy from the direction rendering strategy, the symbol rendering strategy, the font rendering strategy, the format rendering strategy, and the style rendering strategy based on the text type of the initial text; Rendering the initial text based on the at least one rendering strategy.

5. The text processing method according to claim 1, characterized in that, In the case where the initial text is a mixed text, the rendering the initial text based on the text rendering strategy corresponding to the target language includes: Dividing the initial text into at least one character, and determining the embedding level corresponding to each of the at least one character; Determining the text direction of each character based on the embedding level corresponding to each of the at least one character; Rendering the at least one character based on the text rendering strategy corresponding to the target language and the text direction of each character.

6. The text processing method according to claim 1, wherein, Before the determining the text to be processed corresponding to the target language based on text editing elements in the text editing interface, it further includes: Determining at least one target character in the text to be processed; Performing a connectivity detection on each target character in the at least one target character according to the character context, and determining the character form of each target character according to the detection result; Encoding the text to be processed based on the character form of each target character.

7. The text processing method according to claim 1, characterized in that The text processing method further includes: Determining the text to be deleted in the text editing interface; And determining the target text to be deleted based on the text selection area to be deleted in the text to be deleted. Identify a target diacritical mark and a target character in the target text to be deleted. After deleting the target diacritical mark, delete the target character.

8. The text processing method according to claim 1, characterized in that, The text processing method further includes: Identify the text to be operated on in the text editing interface, and identify a target text selection area in the text to be operated on. When the target text selection area contains character units, perform forward character detection and backward character detection on the character units. Operate on the character units based on the detection results.

9. The text processing method according to claim 1, characterized in that The text processing method further includes: Configure a text proofreading configuration item, a style formatting configuration item, and / or a text conversion configuration item in the configuration interface associated with the text editing interface.

10. The text processing method according to claim 1, wherein, The text processing method further includes: Edit guiding text based on the text editing elements in the text editing interface. Select a target hint text corresponding to the guiding text from the text library associated with the guiding text, and display the target hint text in the text editing interface.

11. A text processing device, characterized in that, Includes: A determination module configured to determine the text to be processed corresponding to the target language based on text editing elements in the text editing interface. An adjustment module configured to adjust the target characters in the text to be processed based on the language rules of the target language to obtain an initial text. A rendering module configured to render the initial text based on the text rendering strategy corresponding to the target language, and display the target text in the text display area of the text editing interface based on the rendering result.

12. A computing device, characterized in that, Includes: A memory and a processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the text processing method according to any one of claims 1-10.

13. A computer-readable storage medium storing computer instructions, characterized in that, When the instruction is executed by the processor, the steps of the text processing method according to any one of claims 1-10 are implemented.

14. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by the processor, the steps of the text processing method according to any one of claims 1-10 are implemented.