Text correction method and apparatus

By identifying and replacing abnormal characters in the text, the problem of unrecognizable characters in the conversion of texts of different formats is solved, and the correct presentation and efficient use of the text are achieved.

CN114818667BActive Publication Date: 2026-05-29ALIPAY (HANGZHOU) INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
Filing Date
2022-04-14
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Due to the numerous sources of text and the significant differences in compilation rules, directly converting texts of different formats can easily lead to character recognition problems, resulting in the text being unable to be used correctly.

Method used

By obtaining the original text and configuration file, abnormal characters are identified and their corresponding regular characters are queried. The abnormal characters are then replaced with regular characters to obtain the corrected text.

Benefits of technology

This ensures that the corrected text is presented correctly in the target application scenario, improving text utilization and processing efficiency, and enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818667B_ABST
    Figure CN114818667B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a text correction method and device, wherein the text correction method comprises: obtaining an original text and a configuration file, identifying each character in the original text, if a target abnormal character is identified, querying the configuration file to determine a target normal character corresponding to the target abnormal character, replacing the target abnormal character in the original text with the target normal character to obtain a corrected text. It is ensured that the corrected text can be correctly presented, and the utilization rate of the text is improved, without repeatedly obtaining homogenous texts with different formats, improving the efficiency of text processing and enhancing user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of text editing technology, and in particular to a text correction method and apparatus. Background Technology

[0002] With the development of internet technology, various types of text are playing an increasingly important role in related projects and services.

[0003] Due to the increase in the amount of text and the development of various text acquisition tools, the past practice of using specialized text format files for transmission has been abandoned. Text conversion between multiple text formats is now necessary to make better use of text information.

[0004] However, due to the numerous sources of text and the significant differences in related text compilation rules, directly converting text of different formats can lead to unrecognizable text characters. Therefore, a text correction method is urgently needed to correct these unrecognizable characters, ensuring that different formats can still be fully utilized after conversion. Summary of the Invention

[0005] In view of this, embodiments of this specification provide a text correction method. One or more embodiments of this specification also relate to a text correction apparatus, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.

[0006] According to a first aspect of the embodiments of this specification, a text correction method is provided, comprising:

[0007] Obtain the raw text and configuration file, where the configuration file is used to record the correspondence between abnormal characters and normal characters;

[0008] The system identifies each character in the original text. If a target abnormal character is identified, the system queries the configuration file to determine the target regular character corresponding to the target abnormal character.

[0009] The corrected text is obtained by replacing the target abnormal characters in the original text with the target regular characters.

[0010] According to a second aspect of the embodiments of this specification, a text correction apparatus is provided, comprising:

[0011] The acquisition module is configured to acquire raw text and a configuration file, where the configuration file is used to record the correspondence between abnormal characters and normal characters;

[0012] The query module is configured to recognize each character in the original text. If a target abnormal character is recognized, the configuration file is queried to determine the target regular character corresponding to the target abnormal character.

[0013] The correction module is configured to replace the target abnormal characters in the original text with target regular characters to obtain the corrected text.

[0014] According to a third aspect of the embodiments of this specification, a computing device is provided, comprising:

[0015] Memory and processor;

[0016] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the above-described text correction method.

[0017] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions that, when executed by a processor, implement the steps of the above-described text correction method.

[0018] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described text correction method.

[0019] In one or more embodiments of this specification, original text and a configuration file are obtained. Each character in the original text is identified. If a target abnormal character is identified, the configuration file is queried to determine the corresponding target regular character. The target normal character is then used to replace the target abnormal character in the original text, resulting in corrected text. By replacing the abnormal characters in the original text with corresponding normal characters according to the configuration file, the corrected text is obtained, ensuring that the corrected text can be correctly presented. Furthermore, by replacing the original text, the utilization rate of the text is improved, eliminating the need to repeatedly obtain homogeneous text with different formats, thus improving the efficiency of text processing and enhancing the user experience. Attached Figure Description

[0020] Figure 1 This is a flowchart of a text correction method provided in one embodiment of this specification;

[0021] Figure 2 This is a flowchart illustrating the processing procedure of a text correction method provided in one embodiment of this specification;

[0022] Figure 3 This is a schematic diagram illustrating the effect of an embodiment of this specification without text correction.

[0023] Figure 4This is a schematic diagram illustrating the effect of text correction provided in one embodiment of this specification.

[0024] Figure 5 This is a schematic diagram illustrating another effect without text correction provided in one embodiment of this specification;

[0025] Figure 6 This is a schematic diagram illustrating another text correction effect provided in one embodiment of this specification;

[0026] Figure 7 This is a schematic diagram of the structure of a text correction device provided in one embodiment of this specification;

[0027] Figure 8 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0028] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0029] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0030] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0031] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0032] Plain text format: A document format that displays only the text content without any text formatting. Plain text format only saves the text content and does not save the text formatting.

[0033] Rich Text Format (RTF): Also known as multi-text format, it is a document format that can be used across platforms. It can directly display text content in the corresponding format based on the edited text content and text format, making it convenient for transmission, viewing, and processing across different devices, operating systems, and applications.

[0034] Regular expressions are logical formulas used to perform search or replacement operations on character text. In computer code development applications, regular expressions are commonly used to search for and replace text with a certain format.

[0035] Unicode encoding: An industry standard for code-to-text conversion in the computer field, including character sets and code-to-text conversion schemes. It assigns a unified and unique binary code to each character in every code language to meet the requirements of cross-language and cross-platform code-to-text conversion and processing.

[0036] ASCII (American Standard Code for Information Interchange) encoding is a code-text conversion system based on the Latin alphabet and is currently the most widely used code conversion standard in the world.

[0037] HTML (Hypertext Markup Language) is a markup language. It consists of a series of tags that standardize the format of documents on the web. HTML-formatted text is descriptive text composed of HTML commands.

[0038] JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write, and also easy for machines to parse and generate. It is built upon a subset of the JavaScript Programming Language, Standard ECMA-2623rd Edition-December 1999.

[0039] Traditional methods for handling abnormal characters in different formats typically involve first searching for all abnormal characters in the original text and then deleting them. However, abnormal characters are not always caused by erroneous input; they may also be functional characters with specific functions in different formats, mistakenly identified as abnormal simply because of their formatting differences. This crude method of searching and deleting results in a significant loss of information from the acquired text.

[0040] This specification provides a text correction method, and also relates to a text correction device, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments.

[0041] See Figure 1 , Figure 1 A flowchart of a text correction method according to an embodiment of this specification is shown, which specifically includes the following steps.

[0042] Step 102: Obtain the raw text and configuration file, where the configuration file is used to record the correspondence between abnormal characters and normal characters.

[0043] The original text was obtained from multiple text pages using a text acquisition tool and has not been modified.

[0044] The configuration file can be pre-stored locally. Retrieving the configuration file can be done by sending a command to retrieve it from the local machine, or by receiving a configuration file that has been matched locally; there is no limitation on this. Alternatively, the configuration file can be pre-stored in a configuration file database on the configuration side. Retrieving the configuration file can be done by sending a command to retrieve it from the database, or by receiving a configuration file sent from the database; there is no limitation on this either. The purpose of the configuration file is to provide a replacement reference when replacing abnormal characters later.

[0045] Error characters can be erroneous characters resulting from incorrect input in the original text, or they can be formatting characters present in the original text. Formatting characters do not represent specific content information, but they can represent some functional information. For example, the "\n" symbol in code editing indicates that a newline function should be executed. If the original text obtained is in code format without format conversion, and is directly processed on other platforms or applications, it may be interpreted as a combination of the "\" character and the "n" character, leading to errors in subsequent processing of "\n".

[0046] Because the source of raw text comes from different sources and of different types, various abnormal characters can cause information confusion. For example, when retrieving .doc or .docx text from Word, the abnormal character for line breaks is... This abnormal character represents a newline function, but in code text, "\n" is generally used to represent a newline function. Because such different abnormal characters cannot be universally recognized in different application scenarios, it will cause great difficulties in subsequent text processing.

[0047] Regular characters are universal characters that exist in the original text and have a consistent form in different scenarios. For example, whether it is coding, Word text processing, or other scenarios, English characters and numeric characters generally have a consistent form.

[0048] Different application scenarios involve using different applications or application plugins to achieve text format conversion in order to meet the needs of text viewing, transmission and processing. For example, using a text acquisition tool to obtain raw HTML text from multiple web pages, the obtained raw HTML text needs to be applied to JAVA code text to meet the needs of subsequent viewing, transmission and processing in the JAVA development environment.

[0049] Specifically, a text acquisition tool is used to obtain raw text from multiple text pages, and the corresponding configuration file pre-stored in the configuration file database is called based on the obtained raw text.

[0050] By obtaining the original text and the configuration file that records the correspondence between abnormal characters and normal characters, a textual basis and a correction configuration basis are provided for subsequent text correction of the original text.

[0051] Step 104: Recognize each character in the original text. If a target abnormal character is identified, query the configuration file to determine the target regular character corresponding to the target abnormal character.

[0052] The system converts each character in the original text to the target application scenario. If there are any abnormal characters that cannot be converted, these abnormal characters are identified as target abnormal characters.

[0053] The system identifies each character in the original text. This identification can be performed automatically using a pre-trained anomalous character neural network model. Alternatively, a pre-built anomalous character lookup table can be used. The system checks if any character is included in the anomalous character lookup table. If it is, the character is considered anomalous; otherwise, it is not.

[0054] If the original text also contains images, the images can be extracted using a pre-built OCR (Optical Character Recognition) model, converted into image characters, and then automatically recognized using a pre-trained abnormal image character neural network model. Alternatively, a pre-built abnormal image character lookup table can be used for querying and judgment, which is not limited here.

[0055] Specifically, each character in the original text is identified. If a target abnormal character is identified, the corresponding relationship in the configuration file is queried to determine the target regular character corresponding to the target abnormal character.

[0056] The mapping in the configuration file is based on multiple pre-established mappings between abnormal characters and normal characters.

[0057] By recognizing each character in the original text, abnormal characters can be accurately located during subsequent text correction processing, improving correction efficiency. Furthermore, by querying the configuration file to determine the corresponding regular character for the target abnormal character, a reference can be provided for subsequent replacements.

[0058] Step 106: Replace the target abnormal characters in the original text with the target regular characters to obtain the corrected text.

[0059] Corrected text refers to the original text that has been modified so that it can be correctly presented in the target application scenario.

[0060] Specifically, by using preset abnormal character replacement rules, the target abnormal characters in the original text are replaced with target regular characters to obtain the corrected text.

[0061] In practical applications, the preset exception character replacement rules are the rules that can perform character replacement functions in the target application scenario. For example, in the code development application scenario, the preset exception character replacement rules can be regular expressions.

[0062] In this embodiment, the original text and configuration file are obtained. Each character in the original text is identified. If a target abnormal character is identified, the configuration file is queried to determine the corresponding target regular character. The target normal character is then used to replace the target abnormal character in the original text, resulting in corrected text. By replacing the abnormal characters in the original text with corresponding normal characters according to the configuration file, the corrected text is obtained, ensuring that the corrected text can be correctly presented. Furthermore, by replacing the original text, the utilization rate of the text is improved, eliminating the need to repeatedly obtain homogeneous text with different formats, thus improving the efficiency of text processing and enhancing the user experience.

[0063] Optionally, the configuration file records the correspondence between the character encoding of abnormal characters and regular characters;

[0064] Step 104 involves querying the configuration file to determine the target regular character corresponding to the target abnormal character, including the following specific steps:

[0065] Encode the target abnormal character to obtain its character encoding;

[0066] Based on the character encoding of the target abnormal character, the configuration file is queried to determine the target regular character corresponding to the character encoding of the target abnormal character.

[0067] The configuration file records multiple correspondences between the character codes of abnormal characters and regular characters. This means that the character codes of multiple abnormal characters can correspond to one regular character, or the character code of one abnormal character can correspond to one regular character.

[0068] The character encoding can be a general character encoding, such as ASCII encoding, national standard Chinese character encoding, ISO encoding, or Unicode encoding. It can also be a custom character encoding, which is not limited here.

[0069] By establishing a correspondence between the character encoding of abnormal characters and regular characters, regular characters can be determined based solely on the character encoding, without needing to search for the regular character corresponding to the abnormal character.

[0070] Specifically, based on the pre-defined abnormal character encoding rules, the target abnormal character is encoded to obtain the character encoding of the target abnormal character. Then, based on the character encoding of the target abnormal character, the configuration file is queried to determine the target regular character corresponding to the character encoding of the target abnormal character.

[0071] Because abnormal characters may be erroneous characters in the original text or unrecognizable characters, encoding each type of erroneous input character would result in an excessively large encoding table and low efficiency in querying the encoding table. Therefore, encoding rules are pre-defined for abnormal characters to encode the target abnormal characters. Taking ASCII encoding as an example, Table 1 shows a configuration file provided in one embodiment of this specification; Table 2 shows a character encoding rule for abnormal characters provided in one embodiment of this specification.

[0072] Table 1 Configuration Files

[0073] Character encoding of abnormal characters Regular characters 00001010 \r 00001000 \t 00001001 \e

[0074] Table 2 Character Encoding Rules for Abnormal Characters

[0075]

[0076] In practical applications, target abnormal characters For target abnormal characters After performing ASCII character encoding, we get "00001010". Based on the character encoding of the target abnormal character "00001010", we query the configuration file and find that the corresponding regular character is "\r".

[0077] By encoding the target abnormal character, the character encoding of the target abnormal character is obtained. Then, based on the character encoding of the target abnormal character, the configuration file is queried to determine the target regular character corresponding to the character encoding of the target abnormal character. This not only determines the target regular character to be used to replace the target abnormal character in the subsequent corrected text, but also determines the target regular character based only on the character encoding. This eliminates the need to create a configuration file that records a large number of abnormal characters and regular characters and then query an overly complex configuration file, thus improving query efficiency and consequently improving text correction efficiency.

[0078] Optionally, after the step of encoding the target abnormal character to obtain the character encoding of the target abnormal character, the method further includes:

[0079] Based on the character encoding of the target abnormal character, a preset search tool is used to search for the target abnormal character within a preset range from the original text;

[0080] Correspondingly, the target abnormal characters in the original text are replaced with target regular characters to obtain the corrected text, including:

[0081] The corrected text is obtained by replacing the target abnormal characters within a preset range in the original text with the target regular characters.

[0082] Since the original text contains too many characters, replacing them one by one might result in replacing too much unnecessary original text. In some cases, replacing certain functional abnormal characters might cause some text to fail to be displayed in the target application scenario. Therefore, it is necessary to set a preset range, search for target abnormal characters within the preset range, and replace them.

[0083] The preset search tool can retrieve target abnormal characters within a preset range of the original text based on preset character encoding rules and the corresponding character encoding of the target abnormal characters. For example, in code development applications, the preset search tool can be a regular expression. See Table 2 for character encoding rules.

[0084] Specifically, by using preset abnormal character replacement rules, the target abnormal characters in the original text are replaced with target regular characters to obtain the corrected text.

[0085] In practical applications, within code development scenarios, based on the target exception character The character encoding "00001010" is obtained using the preset regular expression newRegExp( (m') searches for target abnormal characters within a preset range from the original text. Replace the target abnormal character within a preset range m in the original text with the target regular character "\r". The corrected text was obtained.

[0086] Based on the character encoding of the target abnormal character, the system searches for target abnormal characters within a preset range and replaces them with regular characters. This ensures that the subsequent corrected text can be correctly presented, while also avoiding incorrect or unnecessary replacements of abnormal characters. The character encoding-based search and replacement also improves search and replacement efficiency.

[0087] Optionally, after the step of querying the configuration file in step 104, the following specific steps are also included:

[0088] If the target abnormal character cannot be found, a configuration prompt message is sent to the configuration terminal so that the user can update the configuration file according to the target abnormal character and the target normal character corresponding to the target abnormal character in the prompt message.

[0089] The configuration prompt message contains the target exception character and its corresponding target regular character. Upon receiving the message, the user will update the configuration file based on the character encoding and corresponding target regular character mappings for the new target exception character.

[0090] In practical applications, if the target abnormal character "&" cannot be found as a corresponding target regular character, a configuration prompt message is sent to the configuration terminal. This prompts the user to add a new character encoding "00100110" for the target abnormal character "&" and its corresponding target regular character "AND" to the configuration file based on the target abnormal character "&" and its corresponding target regular character in the prompt message, and then update the configuration file.

[0091] By sending configuration prompt messages to the configuration end, users can update their configuration files based on the target abnormal character and its corresponding target regular character in the prompt message. This allows the configuration file to record more correspondences when the target abnormal character cannot be found, improving the accuracy and comprehensiveness of text correction and enhancing the user experience.

[0092] Optionally, obtaining the configuration file in step 102 includes:

[0093] Send a configuration request to the configuration platform;

[0094] Receive the response information returned by the configuration platform and retrieve the configuration file from the response information.

[0095] The configuration request contains information about the target application scenario.

[0096] The configuration platform is a control platform that can call configuration files pre-stored in a configuration file database on the configuration end.

[0097] The response information is generated by the configuration platform after receiving a configuration request, identifying the target application scenario information in the request, and retrieving the corresponding configuration file from the pre-stored configuration file database. The response information includes the configuration file.

[0098] By sending a configuration request to the configuration platform and receiving the response information returned by the configuration platform, the configuration file can be obtained without occupying device storage. The configuration file can be selected according to the application scenario, and the text revision can be implemented flexibly and efficiently in the future, reducing the requirements on the device.

[0099] Optionally, the configuration file can be obtained from the response information, including:

[0100] Invoke the preset compilation component and extract the configuration file from the response information.

[0101] The pre-defined compilation component extracts the configuration file from the response information by comparing the file characteristics information of the configuration file.

[0102] By using pre-defined compilation components to extract configuration files from response information, a large amount of useless information is eliminated, and configuration files are extracted efficiently and accurately, thus improving processing efficiency.

[0103] Optionally, the original text is in rich text format.

[0104] Rich text formatting allows you to directly display text content in the corresponding format based on the edited text content and format, making it convenient for transmission, viewing, and processing across different devices, operating systems, and applications.

[0105] For example, text compiled by a user in the text compilation area of ​​Word software is in rich text format, and the text content in the corresponding format will be displayed directly according to the edited text content and text format.

[0106] In contrast, rich text format corresponds to plain text format.

[0107] Plain text cannot be directly displayed based on the edited text content and format. It generally needs to be rendered before the corresponding text content can be displayed.

[0108] For example, the code text compiled by a user in an HTML+CSS code compiler is in plain text format. CSS will configure the text content for text formatting, but it cannot be displayed directly. It needs to be placed in a webpage to be displayed.

[0109] The original text is in rich text format, allowing users to directly observe the display effect. This makes it easy for users to identify any abnormal characters based on the display, and then correct the text, improving the efficiency of text correction and enhancing the user experience.

[0110] The following is in conjunction with the appendix Figure 2 Taking the text correction method provided in this manual as an example of its application in correcting business information text, this paper further explains the text correction method. Figure 2 The present specification shows a flowchart of a text correction method according to an embodiment, which includes the following steps.

[0111] Step 202: Obtain the raw text and configuration file.

[0112] The original text, displayed on a certain application, contains the following content: {Company Name: XXXX Co., Ltd.} shareholder: }, and the text format is HTML text.

[0113] The application scenario is to convert HTML formatted text into JSON formatted text.

[0114] Obtain the configuration file based on the conversion from HTML-formatted text to JSON-formatted text.

[0115] Step 204: Recognize each character in the original text.

[0116] The JSON development platform handles the raw text {Company Name: XXXX Co., Ltd.} shareholder: The characters in the} are recognized.

[0117] Step 206: If the target abnormal character is identified, the target abnormal character is encoded to obtain the character encoding of the target abnormal character.

[0118] Identify the target abnormal characters Then for the target abnormal character Perform Unicode encoding to obtain the target abnormal character. The character encoding is "u21B5". Among them, It is a function character for line breaks in HTML text, but it cannot be used in subsequent JSON text.

[0119] Step 208: Based on the character encoding of the target abnormal character, use a preset search tool to search for the target abnormal character within a preset range from the original text.

[0120] In the conversion of HTML text to JSON text, the default search tool is a pre-defined regular expression.

[0121] Based on the target abnormal character The character encoding "u21BS" is used, employing a preset regular expression, to extract the character encoding from the original text {Company Name: XXXX Co., Ltd.}. shareholder: Search for target abnormal characters within a preset range in the}

[0122] Step 210: Based on the character encoding of the target abnormal character, query the configuration file to determine the target regular character corresponding to the character encoding of the target abnormal character.

[0123] Based on the target abnormal character The character encoding "u21B5" was used to query the configuration file, and the target normal character corresponding to the character encoding of the target abnormal character was determined to be "\r". "\r" is a function character in JSON format text that can perform a newline function.

[0124] Step 212: Replace the target abnormal characters in the original text within the preset range with the target regular characters to obtain the corrected text.

[0125] Replace the target abnormal characters within a preset range in the original text with the target regular character "\r". The corrected text is: {Company Name: XXXX Co., Ltd.\rShareholders: XXX\r XX\r XXX\r XXX\r}.

[0126] The corrected text can be recognized by JSON, and the corrected text is displayed as follows:

[0127] Company Name: XXXX Co., Ltd.

[0128] Shareholder: XXX

[0129] XX

[0130] XXX

[0131] XXX

[0132] In scenarios involving text correction of business information, it is necessary to convert HTML-formatted text to JSON-formatted text and make relevant revisions. By encoding the target abnormal characters, the character encoding of the target abnormal characters is obtained. Then, based on the character encoding of the target abnormal characters, the configuration file is queried to determine the target regular characters corresponding to the character encoding of the target abnormal characters, thereby improving query efficiency and thus improving text correction efficiency. Secondly, the abnormal characters existing in the original text are replaced with corresponding regular characters to obtain the corrected text, ensuring that the obtained corrected text can be correctly presented. In addition, replacing the original text also improves the utilization rate of the text, eliminating the need to repeatedly obtain homogeneous text with different formats, thereby improving text processing efficiency and enhancing user experience.

[0133] Figure 3 This diagram illustrates a text content display without text correction, according to one embodiment of this specification. Figure 3 As shown, the business registration change details page displays JSON-formatted text, with the change date as 2021-05-28, the change item as shareholder change, and the change item details as shareholder change. The "before" and "after" sections show the company name and shareholder information before and after the change. However, because the information in the "before" and "after" sections is converted from HTML text, any abnormal characters were not replaced, and the corrected text was not displayed. This will result in... An abnormal character, whose meaning is unclear to the user when displayed on the application interface, and which does not execute HTML formatting in the text. The lack of line breaks results in insufficient display quality and negatively impacts the user experience.

[0134] Figure 4 This diagram illustrates a text content display with text corrections provided in one embodiment of this specification. (See attached image.) Figure 4 As shown, the JSON-formatted text displayed on the page shows the change date as 2021-05-28, the change item as shareholder change, and the change details as shareholder change. The previous section shows the company name and shareholder information, while the new section shows the company name and shareholder information. This is because when converting HTML text to JSON, abnormal characters... The target regular character "\r" was replaced. The "\r" character can be recognized by JSON format as a function character for line breaks. When displayed on the page, it will break the text and result in the display of the content before and after the change as shown in the figure. Users can clearly observe the text content in this area, and the display effect is obviously beautiful, improving the user experience.

[0135] For example, Figure 5This diagram illustrates another text content display without text correction, provided in one embodiment of this specification. (For example...) Figure 5 As shown, the contract text display page shows JSON formatted text, including the contract name, Party A, Party B, and date information. However, because the relevant information in the text content is converted from HTML formatted text, it does not contain any abnormal characters. Replace it and display the corrected text; it will then appear. The user does not understand the true meaning of the abnormal character.

[0136] The JSON development platform identifies each character in the aforementioned contract text and identifies the target abnormal characters. Then for the target abnormal character Perform Unicode encoding to obtain the target abnormal character. The character encoding is "U+1F60F". In the conversion from HTML to JSON text, the default search tool is a pre-defined regular expression. Based on the target abnormal character... The character encoding "U+1F60F" is used to search for target abnormal characters within a preset range from the contract text using a preset regular expression.

[0137] Based on the target abnormal character The character encoding "U+1F60F" was used to query the configuration file, which determined that the target normal character corresponding to the character encoding of the target abnormal character was "date". "Date" is a custom character used to replace characters in the JSON format text. By replacing abnormal characters with regular characters, this method can protect technical text from being easily acquired by text acquisition tools.

[0138] Replace the target abnormal characters within a preset range in the original text with the target regular character "date". like Figure 6 As shown. Figure 6 This diagram illustrates a text content display with text corrections provided in one embodiment of this specification.

[0139] Corresponding to the above method embodiments, this specification also provides embodiments of a text correction device. Figure 7 A schematic diagram of a text correction device according to one embodiment of this specification is shown. Figure 7 As shown, the device includes:

[0140] The acquisition module 702 is configured to acquire raw text and a configuration file, wherein the configuration file is used to record the correspondence between abnormal characters and normal characters;

[0141] The query module 704 is configured to recognize each character in the original text. If a target abnormal character is recognized, the configuration file is queried to determine the target regular character corresponding to the target abnormal character.

[0142] The correction module 706 is configured to replace the target abnormal characters in the original text with target regular characters to obtain the corrected text.

[0143] Optionally, query module 704 includes:

[0144] The encoding submodule is configured to encode the target abnormal character to obtain the character encoding of the target abnormal character;

[0145] The query submodule is configured to query the configuration file based on the character encoding of the target abnormal character to determine the target regular character corresponding to the character encoding of the target abnormal character.

[0146] Optionally, query module 704 also includes:

[0147] The search submodule is configured to use a preset search tool to search for target abnormal characters within a preset range from the original text based on the character encoding of the target abnormal characters.

[0148] Accordingly, the correction module 706 is further configured to replace the target abnormal characters in the original text within a preset range with target regular characters to obtain the corrected text.

[0149] Optionally, the device further includes:

[0150] The update module is configured to send a configuration prompt message to the configuration terminal if the target abnormal character cannot be found, so that the user can update the configuration file according to the prompt message, the target abnormal character, and the target normal character corresponding to the target abnormal character.

[0151] Optionally, the acquisition module 702 includes:

[0152] The configuration request sending submodule is configured to send configuration requests to the configuration platform.

[0153] The response information receiving submodule is configured to receive response information returned by the configuration platform and obtain the configuration file from the response information.

[0154] Optionally, the response information receiving submodule is further configured to invoke a preset compilation component to extract the configuration file from the response information.

[0155] In this embodiment, the original text and configuration file are obtained. Each character in the original text is identified. If a target abnormal character is identified, the configuration file is queried to determine the corresponding target regular character. The target regular character is then used to replace the target abnormal character in the original text, resulting in corrected text. By replacing the abnormal characters in the original text with corresponding regular characters according to the configuration file, the corrected text is obtained, ensuring that the corrected text can be correctly presented. Furthermore, by replacing the original text, the utilization rate of the text is improved, eliminating the need to repeatedly obtain homogeneous text with different formats, thus improving text processing efficiency and enhancing the user experience.

[0156] The above is an illustrative scheme of a text correction device according to this embodiment. It should be noted that the technical solution of this text correction device and the technical solution of the above-described text correction method belong to the same concept. For details not described in detail in the technical solution of the text correction device, please refer to the description of the technical solution of the above-described text correction method.

[0157] Figure 8 A structural block diagram of a computing device according to one embodiment of this specification is shown. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.

[0158] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Controller (NIC)), such as an IEEE 802.11 Wireless Local Area Networks (WLAN) wireless interface, a Wi-MAX (World Interoperability for Microwave Access) 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.

[0159] In one embodiment of this specification, the above-described components of the computing device 800 and Figure 8 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 8 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0160] The computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 800 can also be a mobile or stationary server.

[0161] The processor 820 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-described text correction method.

[0162] In this embodiment of the specification, abnormal characters existing in the original text are replaced with corresponding regular characters according to the configuration file to obtain corrected text, ensuring that the obtained corrected text can be correctly presented. In addition, replacing the original text also improves the utilization rate of the text, without having to repeatedly obtain homogeneous text with different formats, thereby improving the efficiency of text processing and enhancing the user experience.

[0163] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above-described text correction method belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above-described text correction method.

[0164] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described text correction method.

[0165] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above-described text correction method belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the above-described text correction method.

[0166] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described text correction method.

[0167] The above is an illustrative example of a computer program according to this embodiment. It should be noted that the technical solution of this computer program and the technical solution of the aforementioned text correction method belong to the same concept. Details not described in detail in the computer program's technical solution can be found in the description of the technical solution of the aforementioned text correction method.

[0168] The foregoing has described specific embodiments of this specification. 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 that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0169] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0170] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0171] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0172] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A text correction method, applied to a text format conversion scenario, comprising: Obtain the original text and configuration file, wherein the configuration file is used to record the correspondence between the character encoding of abnormal characters and regular characters, and the original text is in rich text format; Each character in the original text is identified. If a target abnormal character is identified, the configuration file is queried to determine the target regular character corresponding to the character encoding of the target abnormal character. The original text directly displays the text content in the corresponding format according to the edited text content and text format. The identification of each character in the original text includes: converting each character in the original text to the text format of the target application scenario. If there is an abnormal character that cannot be converted, it is determined to be the target abnormal character. The target abnormal character is a formatted character in the original text used to represent functional information. The target abnormal character cannot be universally identified in different application scenarios. Based on the character encoding of the target abnormal character, a preset search tool is used to search for the target abnormal character in the original text and replace the target abnormal character in the original text with the target regular character to obtain the corrected text.

2. The method according to claim 1, wherein querying the configuration file to determine the target regular character corresponding to the character encoding of the target abnormal character includes: The target abnormal character is encoded to obtain the character encoding of the target abnormal character; Based on the character encoding of the target abnormal character, the configuration file is queried to determine the target regular character corresponding to the character encoding of the target abnormal character.

3. The method according to claim 2, after encoding the target abnormal character to obtain the character encoding of the target abnormal character, further comprising: Based on the character encoding of the target abnormal character, a preset search tool is used to search for the target abnormal character within a preset range from the original text; The step of replacing the target abnormal character in the original text with the target regular character to obtain the corrected text includes: The corrected text is obtained by replacing the target abnormal characters within the preset range in the original text with the target regular characters.

4. The method according to any one of claims 1-3, further comprising, after querying the configuration file: If the target abnormal character cannot be found, a configuration prompt message is sent to the configuration terminal so that the user can update the configuration file according to the prompt message, the target abnormal character, and the target normal character corresponding to the target abnormal character.

5. The method according to claim 1, wherein obtaining the configuration file includes: Send a configuration request to the configuration platform; Receive the response information returned by the configuration platform and obtain the configuration file from the response information.

6. The method according to claim 5, wherein obtaining the configuration file from the response information comprises: Invoke the preset compilation component to extract the configuration file from the response information.

7. A text correction device, applied in a text format conversion scenario, comprising: The acquisition module is configured to acquire raw text and a configuration file, wherein the configuration file is used to record the correspondence between the character encoding of abnormal characters and regular characters, and the raw text is in rich text format; The query module is configured to identify each character in the original text. If a target abnormal character is identified, the configuration file is queried to determine the target regular character corresponding to the character encoding of the target abnormal character. The original text directly displays the text content in the corresponding format according to the edited text content and text format. The identification of each character in the original text includes: converting each character in the original text to the text format of the target application scenario. If there is an abnormal character that cannot be converted, it is determined that the abnormal character is the target abnormal character. The target abnormal character is a formatted character in the original text used to represent functional information. The target abnormal character cannot be universally identified in different application scenarios. The correction module is configured to use a preset search tool to search for the target abnormal character from the original text based on the character encoding of the target abnormal character, and replace the target abnormal character in the original text with the target regular character to obtain the corrected text.

8. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the text correction method according to any one of claims 1 to 7.

9. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the text correction method according to any one of claims 1 to 7.