Error correction word sorting method, device, terminal device and storage medium

By sorting error correction words according to the word order weight of the error correction type in the pinyin input method, the difficulty of users to select among multiple error correction words is solved, and the error correction efficiency of the input method is improved, making it easier for users to find the desired words.

CN112989148BActive Publication Date: 2025-05-16HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201911279538.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-13
Publication Date
2025-05-16
Estimated Expiration
2039-12-13

AI Technical Summary

Technical Problem

In the pinyin input method, when the user enters errors, it is difficult for the existing technology to effectively sort the error correction words, resulting in the user having to spend a lot of money to find the words they really want.

Method used

By receiving the string input by the user, obtaining the matching error correction words, and determining the weight values ​​of each error correction word based on the word order weight of the error correction type, and finally sorting the error correction words to give priority to the error correction words corresponding to the most common input errors of the user.

Benefits of technology

The error correction rate of the pinyin input method is improved, so that the error correction words finally presented to the user can better match the actual needs of the user, and reduce the operation events selected by the user among multiple error correction words.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112989148B_ABST
    Figure CN112989148B_ABST
Patent Text Reader

Abstract

The embodiments of the present application are applicable to the technical field of input methods, and provide a method, apparatus, terminal device, and storage medium for sorting error correction words. The method includes: when receiving a character string input by a user, obtaining multiple error correction words that match the character string, and determining the error correction type to which each error correction word belongs and the word order weight corresponding to the error correction type; determining the weight value of each error correction word according to the word order weight of the error correction type; and sorting the multiple error correction words according to the weight value of each error correction word. The above method re-determines the weight value of the error correction word by the word order weight of the error correction type, and can give priority to displaying the error correction words corresponding to more common input errors to the user, thereby improving the error correction efficiency of the input method. It can be applied to fields such as artificial intelligence and natural language processing, and helps to improve input efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of input methods, and in particular, relates to a method, apparatus, terminal device and storage medium for sorting error-correcting words. Background Art

[0002] Pinyin input method suitable for Chinese input is that after the user inputs a string of Pinyin, the system converts the input Pinyin into a string of Chinese characters. Since it does not require special memory and conforms to the way people think, as long as you know Pinyin, you can input. Pinyin input method is becoming more and more the most widely used input method.

[0003] With the popularity of mobile devices, it is very easy for users to type the wrong pinyin when using pinyin input methods on small mobile phones and tablets. For example, if a user wants to input "you", because the letters "i" and "o" are adjacent on the keyboard, it is very easy to type the wrong pinyin when inputting, and the result is "yiu", which will result in the Chinese characters that the user does not want. Users need to spend a lot of money to re-enter or modify the pinyin to get the desired word.

[0004] At present, all input method manufacturers provide automatic error correction functions for Pinyin input methods. When a user enters an incorrect Pinyin, the input method will try to automatically correct the incorrect Pinyin to the correct Pinyin, and then give the corresponding Chinese word according to the corrected Pinyin. However, for the incorrectly entered Pinyin, different error correction methods may result in a variety of different error correction results. When there are too many error correction results, users also need to go through tedious operations to find the words they really want. Summary of the invention

[0005] The embodiments of the present application provide a correction word sorting method, apparatus, terminal device and storage medium, which can improve the error correction rate of the pinyin input method so that the correction words finally presented to the user can better match the user's actual needs.

[0006] In a first aspect, an embodiment of the present application provides a method for sorting error correction words, comprising:

[0007] When receiving a character string input by a user, obtaining multiple error correction words matching the character string, and determining the error correction type to which each error correction word belongs and the word order weight corresponding to the error correction type;

[0008] Determining the weight value of each error correction word according to the word order weight of the error correction type;

[0009] The multiple error correction words are sorted according to the weight values ​​of the respective error correction words.

[0010] Exemplarily, the weight value of each error correction word can be determined according to the initial weight value of each error correction word and the word order weight of the corresponding error correction type.

[0011] Exemplarily, when sorting the correction words, the number of correction words corresponding to each correction type can be counted respectively; the correction words exceeding the correction word number threshold are deleted, and then the remaining correction words are sorted according to their weight values.

[0012] Exemplarily, for error correction words that have a mutually exclusive relationship, error correction words with relatively small order weights can be deleted according to the order weights of the error correction types to reduce the number of error correction words.

[0013] In a second aspect, an embodiment of the present application provides a correction word sorting device, comprising:

[0014] The error correction word acquisition module is used to obtain multiple error correction words matching the character string when receiving the character string input by the user, and determine the error correction type to which each error correction word belongs and the word order weight corresponding to the error correction type;

[0015] A weight value determination module, used to determine the weight value of each error correction word according to the word order weight of the error correction type;

[0016] The error correction word sorting module is used to sort the multiple error correction words according to the weight value of each error correction word.

[0017] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the error correction word sorting method described in any one of the first aspects above when executing the computer program.

[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of a terminal device, the error correction word sorting method described in any one of the first aspects above is implemented.

[0019] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the error correction word sorting method described in any one of the first aspects above.

[0020] Compared with the prior art, the embodiments of the present application include the following beneficial effects:

[0021] In the embodiment of the present application, when receiving a character string input by a user, by obtaining the correction word that matches the character string, and then according to the word order weight of the correction type corresponding to the correction word, the weight value of each correction word can be re-determined, and after sorting each correction word according to the re-determined weight value, each correction word can be displayed to the user. Usually, the correction type with a higher word order weight is a correction for the input errors that occur more frequently when the user inputs. By re-determining the weight value of the correction word according to the correction type, the correction word corresponding to the more common input errors can be preferentially displayed to the user, thereby improving the correction efficiency of the input method, and can be applied to fields such as artificial intelligence and natural language processing, which helps to improve input efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 It is a schematic diagram of the hardware structure of a mobile phone to which the error correction word sorting method provided in an embodiment of the present application is applicable;

[0024] Figure 2 It is a schematic diagram of the software structure of a mobile phone to which the error correction word sorting method provided in an embodiment of the present application is applicable;

[0025] Figure 3 is a schematic flowchart of the steps of a method for sorting error correction words provided in an embodiment of the present application;

[0026] Figure 4 is a schematic diagram of an input method architecture provided by an embodiment of the present application;

[0027] Figure 5 is a schematic flowchart of the steps of a method for sorting error correction words provided in another embodiment of the present application;

[0028] Figure 6 is a schematic flowchart of the steps of a method for sorting error correction words provided in another embodiment of the present application;

[0029] Figure 7 It is a structural block diagram of a correction word sorting device provided in one embodiment of the present application;

[0030] Figure 8 It is a structural diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0031] In the following description, specific details such as specific system structures, technologies, etc. are proposed for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from hindering the description of the present application.

[0032] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0033] At present, input methods of various brands all provide corresponding error correction functions. Taking Pinyin input method as an example, its basic principle is to preset some fixed error correction lists or strategies, and when it is detected that the Pinyin string input by the user matches the above error correction list or strategy, the error correction string corresponding to the input Pinyin string is found from the system word library, and then the candidate words matching the error correction string are displayed to the user.

[0034] For example, if the user inputs the pinyin string "lng", the automatic error correction function of the input method will supplement it with "lang", "leng" or "ling" according to the preset error correction strategy, and then find the corresponding Chinese characters and provide them to the user.

[0035] For another example, if the user inputs the pinyin string "yiu", the input method will search for other letters adjacent to the letter "i" to form the string "you", and then provide the Chinese character corresponding to the string "you" to the user.

[0036] However, the correction words provided by the input method after automatic correction are not necessarily the words that the user really wants. There are cases where the correction words are wrong or there are too many correction words, which affects the normal use of the user.

[0037] For example, if the input method detects that the user inputs the string "daohng", the string cannot be directly matched with the corresponding Chinese character. At this time, the input method will correct it and get "daohang", "daohong" and "daoheng", and give the corresponding correction words. In fact, the user may just want to enter "daohang-navigation", and the above correction will result in too many correction words. When the input method provides all the correction words to the user, it will take some time for the user to find the word he really wants to enter.

[0038] Therefore, in response to the above-mentioned problems, an embodiment of the present application provides a method for sorting correction words, which improves the correction rate of the pinyin input method by scientifically and reasonably sorting the correction words obtained through error correction, so that the correction words finally presented to the user can better match the user's actual needs, and reduces the user's operation events of selecting the word they really want to input from too many correction words.

[0039] The following is an introduction to the error correction word sorting method provided in the embodiment of the present application in conjunction with a specific technical solution.

[0040] The error correction word sorting method provided in the embodiment of the present application can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific type of terminal devices.

[0041] Take the terminal device as a mobile phone as an example. Figure 1 The block diagram shows a partial structure of a mobile phone provided in an embodiment of the present application. Figure 1 The mobile phone includes: a radio frequency (RF) circuit 110, a memory 120, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a wireless fidelity (Wi-Fi) module 170, a processor 180, and a power supply 190. Those skilled in the art will understand that Figure 1 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0042] Combine the following Figure 1 A detailed introduction to the various components of the mobile phone:

[0043] The RF circuit 110 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 180 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 110 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE)), email, Short Messaging Service (SMS), etc.

[0044] The memory 120 can be used to store software programs and modules. The processor 180 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 120. The memory 120 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 120 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0045] The input unit 130 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone 100. Specifically, the input unit 130 may include a touch panel 131 and other input devices 132. The touch panel 131, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 131 or near the touch panel 131 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 180, and can receive and execute the command sent by the processor 180. In addition, the touch panel 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 131, the input unit 130 may also include other input devices 132. Specifically, other input devices 132 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.

[0046] The display unit 140 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 131 may cover the display panel 141. When the touch panel 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides a corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 1 In the embodiment, the touch panel 131 and the display panel 141 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 131 and the display panel 141 can be integrated to realize the input and output functions of the mobile phone.

[0047] The mobile phone 100 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0048] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the mobile phone. The audio circuit 160 can transmit the received audio data to the speaker 161 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and converted into audio data, and then the audio data is output to the processor 180 for processing, and then sent to another mobile phone through the RF circuit 110, or the audio data is output to the memory 120 for further processing.

[0049] Wi-Fi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the Wi-Fi module 170, which provides users with wireless broadband Internet access. Figure 1 The Wi-Fi module 170 is shown, but it is understandable that it is not an essential component of the mobile phone 100 and can be omitted as required without changing the essence of the invention.

[0050] The processor 180 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it executes various functions of the mobile phone and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 180.

[0051] The mobile phone 100 also includes a power source 190 (such as a battery) for supplying power to various components. Preferably, the power source can be logically connected to the processor 180 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0052] Although not shown, the mobile phone 100 may further include a camera. Optionally, the camera may be located at the front or rear of the mobile phone 100, which is not limited in the present embodiment.

[0053] Optionally, the mobile phone 100 may include a single camera, a dual camera, or a triple camera, etc., which is not limited in the embodiments of the present application.

[0054] For example, the mobile phone 100 may include three cameras, one of which is a main camera, one is a wide-angle camera, and one is a telephoto camera.

[0055] Optionally, when the mobile phone 100 includes multiple cameras, all of the multiple cameras may be front-mounted, or all of the cameras may be rear-mounted, or some may be front-mounted and others may be rear-mounted, and this is not limited in the embodiments of the present application.

[0056] In addition, although not shown, the mobile phone 100 may also include a Bluetooth module, etc., which will not be described in detail here.

[0057] Figure 2 1 is a schematic diagram of the software structure of the mobile phone 100 of the embodiment of the present application. Taking the operating system of the mobile phone 100 as an example, in some embodiments, the Android system is divided into four layers, namely, the application layer, the application framework layer (framework, FWK), the system layer and the hardware abstraction layer, and the layers communicate with each other through software interfaces.

[0058] like Figure 2 As shown, the application layer may include a series of application packages, and the application packages may include short message, calendar, camera, video, navigation, gallery, call and other applications.

[0059] The application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer may include some predefined functions, such as a function for receiving events sent by the application framework layer.

[0060] like Figure 2 As shown, the application framework layer may include a window manager, a resource manager, a notification manager, and the like.

[0061] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0062] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0063] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0064] The application framework layer may also include:

[0065] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying pictures.

[0066] The phone manager is used to provide communication functions of the mobile phone 100, such as management of call status (including answering, hanging up, etc.).

[0067] The system layer may include multiple functional modules, such as sensor service module, physical state recognition module, 3D graphics processing library (such as OpenGL ES), etc.

[0068] The sensor service module is used to monitor the sensor data uploaded by various sensors at the hardware layer and determine the physical state of the mobile phone 100;

[0069] Physical state recognition module, used to analyze and recognize user gestures, faces, etc.;

[0070] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0071] The system layer may also include:

[0072] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0073] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0074] The hardware abstraction layer is a layer between hardware and software. The hardware abstraction layer can include display drivers, camera drivers, sensor drivers, etc., which are used to drive related hardware of the hardware layer, such as display screens, cameras, sensors, etc.

[0075] The following embodiments can be implemented on a mobile phone 100 having the above hardware structure / software structure. The following embodiments will take the mobile phone 100 as an example to illustrate the error correction word sorting method provided in the embodiments of the present application.

[0076] Reference Figure 3 , shows a schematic flowchart of the steps of a method for sorting error correction words provided by an embodiment of the present application. As an example but not a limitation, the method can be applied to the above-mentioned mobile phone 100. The method can specifically include the following steps:

[0077] S301: when receiving a character string input by a user, obtaining a plurality of error correction words matching the character string, and determining the error correction type to which each error correction word belongs and the word order weight corresponding to the error correction type;

[0078] In this embodiment, the character string input by the user may be a pinyin character string, that is, the user inputs the pinyin character string when using the pinyin input method, and then the corresponding Chinese characters are output through matching and searching of the input method.

[0079] like Figure 4 , which is a schematic diagram of the input method architecture of this embodiment. The error correction word sorting method provided in this embodiment can be Figure 4 It is implemented in the input method architecture shown. Figure 4 The input method architecture shown mainly includes four core units: input, engine, word library, and display. The input unit can provide users with keyboard input methods, including full-key pinyin, nine-key pinyin, etc. The core processing of the input unit is to prevent accidental touches, so that users can enter the correct string as much as possible. Of course, the input unit can also provide users with input methods in other languages, as well as various types of input methods such as strokes, handwriting, and voice.

[0080] For the engine unit, for the pinyin input method, the N-gram language model and the Viterbi pinyin decoding are mainly provided, so that the specific word output, association and error correction functions can be realized in combination with the word library. The word library in the input method includes a basic word library, network hot words, user-defined phrases, etc., and each word library can be updated according to a certain frequency.

[0081] The display unit of the input method can be presented to the user through the display interface of the terminal device. In addition to the basic candidate word output, it can also include other information or recommended information of service categories.

[0082] Based on the above input method architecture, this embodiment improves the sorting process of candidate words and proposes a new error correction word sorting method. The following is a specific introduction.

[0083] Generally, when a user inputs a pinyin string, an input error may occur. At this time, the input method can automatically correct the input error string. For example, when the user inputs the string "yiu", the input method automatically corrects it to the string "you".

[0084] After the input method corrects the incorrectly input pinyin string, it can output error correction words that match the corrected string. For example, for the string "yiu" input by the user, the input method can output error correction words such as "有", "又", "由" that match the corrected string "you".

[0085] The above error correction words can all be regarded as obtained by correcting the error string according to a certain error correction type. Taking the string "yiu" as an example again, after the input method corrects it, the error correction words such as "有", "又", "由" output can be regarded as obtained by correcting "yiu" according to adjacent key error correction. That is, the letter "i" in the incorrectly input string "yiu" is replaced with the adjacent letter "o".

[0086] Of course, the adjacent key error correction provided above is only an example, and the error correction methods provided by the input method can include many types, and this embodiment does not limit this.

[0087] In this embodiment, for any error correction type, a corresponding word order weight can be configured for it, so that after the pinyin string is corrected, the error correction words can be sorted according to the above word order weight.

[0088] In this embodiment, the word order weights of various error correction types can be calculated based on a large amount of statistical data and error correction cases. In this embodiment, the word order weights of various error correction types calculated by analyzing the correspondence between a large number of input error strings and the Chinese characters finally input by the user can reflect the most common input error types of the user. Therefore, the word order weights of the error correction types corresponding to the most common input errors of the user are usually large. For example, ambiguous sound correction, error correction of missing input characters at the end, etc.

[0089] It should be noted that the pinyin string input by the user may not be an incorrect string. For example, when the user inputs the string "zai", it may mean that the user really wants to input "zai" and obtain the Chinese characters that match the string. On the other hand, the input method can also correct it to "zhai" according to the corresponding error correction method, and provide the Chinese characters that match the string "zhai" to the user. At this time, the Chinese characters that match the string "zai" are non-error correction words, and the Chinese characters that match the string "zhai" are error correction words.

[0090] S302, determining a weight value of each error correction word according to the word order weight of the error correction type;

[0091] In this embodiment, various error correction types may be divided into different error correction classes in advance, and a word order weight may be set for each error correction class.

[0092] As an example of this embodiment, multiple error correction types can be divided into four categories, namely, error correction category 1, error correction category 2, error correction category 3, and error correction category 4, and then a word order weight can be set for each category. For example, the word order weight of error correction category 1 can be set equal to the word order weight of error correction category 2, the word order weight of error correction category 2 can be set greater than the word order weight of error correction category 3, the word order weight of error correction category 3 can be set greater than the word order weight of error correction category 4, and so on.

[0093] When determining the weight value of each correction word according to the word order weight of the correction type, the word order weight of the correction class can be directly assigned to the corresponding correction word. That is, the word order weight of the correction class is directly used as the weight value of the correction word obtained after correction according to the correction class. The word order weight of the correction class can also be used as an additional value, and the word order weight is added to the original weight value of the correction word. For example, if the word order weight of a certain correction type is 60%, the original weight value of a certain correction word obtained by correction according to the correction type can be multiplied by 60% as the new weight value of the correction word, and this embodiment does not limit this.

[0094] S303: Sort the multiple error correction words according to the weight value of each error correction word.

[0095] After determining the weight values ​​of the error correction words, the error correction words can be sorted according to the weight values. Generally, the larger the weight value, the higher the ranking; otherwise, the lower the ranking.

[0096] In an embodiment of the present application, when a character string input by a user is received, by obtaining the correction word that matches the character string, and then according to the word order weight of the correction type corresponding to the correction word, the weight value of each correction word can be re-determined, and after sorting each correction word according to the re-determined weight value, each correction word can be displayed to the user. Usually, the correction type with a higher word order weight is a correction for the input errors that occur more frequently when the user inputs. By re-determining the weight value of the correction word according to the correction type, the correction word corresponding to the more common input errors can be preferentially displayed to the user, thereby improving the correction efficiency of the input method, and can be widely used in fields such as artificial intelligence (AI) and natural language processing, which helps to improve input efficiency.

[0097] Reference Figure 5 , shows a schematic flowchart of the steps of a method for sorting error correction words provided by another embodiment of the present application, and the method may specifically include the following steps:

[0098] S501, when receiving a character string input by a user, respectively correcting the character string according to a plurality of preset error correction types, and determining word order weights corresponding to the various error correction types;

[0099] It should be noted that the method can be applied to terminal devices, such as mobile phones, tablet computers, etc. That is, the execution subject of this embodiment is a terminal device. Taking the terminal device as a mobile phone as an example, when a user uses the pinyin input method on the mobile phone, if the pinyin string input by the user is an incorrect string, the incorrect string can be corrected according to the method provided in this embodiment and the various error correction words obtained after the correction can be reordered, so that the error correction words that are ranked first have a greater probability of belonging to the words that the user actually wants to input.

[0100] In this embodiment, the various error correction types provided by the input method may be classified first, for example, into error correction type 1, error correction type 2, error correction type 3, or error correction type 4, etc., so that each error correction type includes at least one specific error correction type.

[0101] Typically, the error correction types provided by the input method include user-configured ambiguous sound correction, correction for missing characters at the end, correction for adjacent keys, default ambiguous sound correction, correction for multiple characters, correction for missing characters in the middle, and correction for swapped characters, etc. Among them, user-configured ambiguous sound correction may refer to the type of correction manually configured by the user. For errors that are more common in the input process, the input method may provide the user with the function of manually configuring error correction. For example, if the user often confuses the letters "f" and "h" during the input process, the user can manually choose to configure the above two letters as an error correction pair, and subsequently when inputting, it can be prioritized to detect whether the above two letters are entered incorrectly.

[0102] The missing characters at the end of the input can be corrected when the pinyin is not fully input. By automatically completing all possible legal pinyins at the end, the corresponding correction words can be obtained. For example, for the input string "pe", by completing other letters at the end, legal pinyins such as "pei", "pen" or "peng" can be obtained.

[0103] Adjacent key error correction may refer to pressing letters of adjacent keys during input. When executing adjacent key error correction, the letters that are pressed off-center need to be corrected. Generally, adjacent key error correction should be limited to no more than one off-center key.

[0104] The default fuzzy sound correction may refer to some fuzzy sound corrections supported by the input method by default when the user does not configure the fuzzy sound correction. The difference between the default fuzzy sound correction and the manual fuzzy sound is that the number of correction words is limited and the word order weight thereof is relatively small.

[0105] The error correction of multiple input characters may refer to an extra letter in the pinyin string input by the user. The multiple input characters may be a repeated letter.

[0106] The error correction of missing characters in the middle may refer to missing a letter in the middle of the pinyin string. It should be noted that the error correction of missing characters in the middle is only for the case where a letter is missing in the middle of the string, not for the case where a letter is missing at the beginning or end of the string.

[0107] Exchange character error correction can mean that in a character string, the order of adjacent letters is incorrectly exchanged, and the error correction can be completed by simply reversing the order of these two letters.

[0108] As shown in Table 1, the definitions, scopes and corresponding descriptions of various error correction types of this embodiment are shown.

[0109] Table 1:

[0110]

[0111] The above-mentioned various error correction types may be divided into multiple error correction classes, and a corresponding error correction word number threshold and word order weight may be set for each error correction class.

[0112] In this embodiment, the error correction word number threshold may be the maximum number of error correction words of a certain error correction type that are allowed to be displayed to the user when performing error correction according to the error correction type. For example, if the error correction word number threshold corresponding to a certain error correction type is 5, it means that when performing error correction on the pinyin field string according to the type, the error correction words provided to the user do not exceed 5.

[0113] As an example of this embodiment, when the error correction types are divided into four error correction categories, the error correction word number threshold for error correction category one can be set greater than the first numerical threshold, the error correction word number threshold for error correction category two can be set less than or equal to the second numerical threshold, the error correction word number threshold for error correction category three can be set less than or equal to the third numerical threshold, and the error correction word number threshold for error correction category four can be set less than or equal to the fourth numerical threshold. The above-mentioned first numerical threshold can be greater than the second numerical threshold, the second numerical threshold can be greater than the third numerical threshold, and the third numerical threshold can be greater than the fourth numerical threshold.

[0114] For example, the first numerical threshold can be set to infinity, indicating that when performing error correction according to the error correction type belonging to the error correction category, all error correction words can be displayed to the user without being limited by the number of error correction words. The second numerical threshold can be set to 5, the third numerical threshold can be set to 2, the fourth numerical threshold can be set to 1, and so on. Of course, the above is only an example of this embodiment, and those skilled in the art can specifically select the threshold of the number of error correction words according to actual needs, and this embodiment does not limit this.

[0115] The word order weight in this embodiment may refer to a discount value for the weight value of the error correction word. For example, if the word order weight is 1, it means that the weight value of the error correction word obtained by this error correction type is not discounted; if the word order weight of a certain error correction type is 80%, it means that the weight value of the error correction word obtained by this error correction type needs to be discounted by 20%, thereby reducing the weight value of the error correction word.

[0116] As shown in Table 2, this is an example of classification of error correction types in this embodiment.

[0117] Table 2:

[0118]

[0119] S502: if the character string is successfully corrected according to the target error correction type, a target character string corresponding to the target error correction type is generated, where the target error correction type is any one of the multiple error correction types;

[0120] In this embodiment, when a pinyin character string input by a user is received, it can first be corrected according to the various error correction types mentioned above. If the error correction is successful, a target character string corresponding to the error correction type can be obtained.

[0121] For example, for the character string "png" input by the user, by performing error correction according to the above-mentioned various error correction types, the target character strings "pang", "peng" and "ping", etc. corresponding to the error correction type of missed input can be obtained.

[0122] It should be noted that there may be more than one error correction type for any character string input by the user. That is, the input method may perform error correction on the character string according to a plurality of different error correction types, which is not limited in this embodiment.

[0123] S503, obtaining a plurality of error correction words matching the target character string;

[0124] For the obtained target character strings, the input method can provide error correction words matching each target character string according to the existing word generation method.

[0125] When there are multiple error correction types, each error correction type may include multiple error correction words corresponding to it.

[0126] S504, obtaining initial weight values ​​of the respective error correction words, and determining weight values ​​of the respective error correction words according to the initial weight values ​​of the respective error correction words and the word order weights of the error correction types corresponding to the respective error correction words;

[0127] The initial weight value of each error correction word is the weight value of each word obtained according to the existing sorting strategy of the input method. The initial weight value reflects the sorting position of each error correction word before being processed.

[0128] In this embodiment, when obtaining the initial weight value of each correction word and obtaining the word order weight of the correction type corresponding to the correction word, the initial weight value can be multiplied by the word order weight of the corresponding correction type to obtain the final weight value of each correction word.

[0129] For example, if a correction word is given according to the adjacent key correction, when calculating the final weight value of the correction word, the initial weight value can be multiplied by 60%. After this processing, its final weight value will be less than the initial weight value. Accordingly, the ranking position of the correction word in all candidate words may move backward.

[0130] After determining the weight value of each error correction word, these error correction words can be sorted according to the weight value. Generally, the larger the weight value, the higher the ranking.

[0131] S505, respectively counting the number of error correction words corresponding to the various error correction types;

[0132] In this embodiment, since different error correction types may give multiple error correction words, in order to reduce the appearance of some unnecessary error correction words in the candidate word list, the number of error correction words obtained by correcting errors according to each error correction type can also be counted separately.

[0133] For example, the number of correction words obtained by correcting manual fuzzy sounds is counted, the number of correction words obtained by correcting adjacent keys is counted, and so on.

[0134] S506, if the number of error correction words is greater than the error correction word number threshold of the corresponding error correction type, then the error correction words greater than the error correction word number threshold are deleted;

[0135] In this embodiment, after obtaining the number of error correction words of various types according to the error correction type statistics, the excess error correction words can be processed according to the error correction word number threshold as shown in Table 2.

[0136] In the specific implementation, it can be seen from Table 2 that the number of correction words obtained by manual fuzzy sound correction is not limited. For the correction words obtained according to this type of correction, all can be retained in the candidate words; for the correction type of under-input, only a maximum of 5 correction words are allowed to be retained. If 7 correction words are obtained by correction according to under-input, the excess 2 correction words need to be deleted; the processing of other types of correction words can also be carried out in the above manner, which will not be repeated in this embodiment.

[0137] S507: Sort the remaining error correction words according to their weight values.

[0138] For example, if there are 7 correction words obtained by performing error correction according to the above-mentioned under-input, since it exceeds the maximum number of correction words allowed by one of the correction types of under-input, 2 of the correction words should be deleted.

[0139] In a specific implementation, two error correction words with relatively small weight values ​​may be deleted, and the remaining five error correction words with relatively large weight values ​​may be retained.

[0140] In the embodiment of the present application, by classifying various error correction types and setting the error correction word number threshold and word order weight corresponding to each error correction class, after the input pinyin string is corrected according to various error correction types, the weight value of each error correction word can be re-determined according to the word order weight, and the error correction words exceeding the number threshold are deleted to obtain the candidate error correction words finally presented to the user. This embodiment solves the problems of error correction errors, error correction failures, and excessive error correction during input method error correction by subdividing the error correction types, and can present the most likely matching words that the user actually wants to input to the user, reducing the negative impact of the automatic error correction function of the input method, and improving the error correction efficiency of the pinyin input method.

[0141] Reference Figure 6 , shows a schematic flowchart of the steps of a method for sorting error correction words provided by another embodiment of the present application, and the method may specifically include the following steps:

[0142] S601: when receiving a character string input by a user, obtaining a plurality of error correction words matching the character string, and determining the error correction type to which each error correction word belongs and the word order weight corresponding to the error correction type;

[0143] S602, determining a weight value of each error correction word according to the word order weight of the error correction type;

[0144] S603, sorting the multiple error correction words according to the weight value of each error correction word;

[0145] Since steps S601 - S603 of this embodiment are similar to steps S301 - S303 and S501 - S507 of the aforementioned embodiment, reference may be made to the description of the aforementioned embodiment, and this embodiment will not be described in detail.

[0146] S604, determining whether the error correction types corresponding to any two error correction words have a mutually exclusive relationship;

[0147] In this embodiment, when sorting the correction words, it is also possible to determine whether the correction types corresponding to any two correction words have a mutually exclusive relationship. The above mutually exclusive relationship may mean that the correction words of two mutually exclusive types cannot appear at the same time, but only one of them can appear.

[0148] In a specific implementation, based on a large amount of statistical data analysis, the third and fourth error correction categories in the above embodiment can be set to have a mutually exclusive relationship. That is, the error correction words obtained by error correction according to the third error correction category will exclude the error correction words obtained by error correction according to the fourth error correction category.

[0149] S605: If the error correction types corresponding to any two error correction words have a mutually exclusive relationship, determine the error correction type to be deleted;

[0150] In this embodiment, when the error correction types corresponding to two error correction words have a mutually exclusive relationship, it is necessary to delete the error correction word of one type.

[0151] As an example of this embodiment, when there are error correction words with a mutually exclusive relationship, the error correction words included in the error correction type with a relatively small word order weight can be deleted.

[0152] Therefore, if the error correction types corresponding to any two error correction words have a mutually exclusive relationship, the word order weights of the error correction types with a mutually exclusive relationship can be compared first, and then among the error correction types with a mutually exclusive relationship, the error correction type corresponding to the minimum word order weight is determined as the error correction type to be deleted.

[0153] S606: Delete each error correction word that matches the error correction type to be deleted.

[0154] In this embodiment, the word order weight of error correction category 4 is less than that of error correction category 3. Therefore, when error correction words obtained by error correction according to the error correction types belonging to error correction category 3 and error correction category 4 appear, each error correction word corresponding to error correction category 4 needs to be deleted.

[0155] Of course, the above mutually exclusive relationship belongs to a supplementary limitation when sorting error correction words in this embodiment. As shown in Table 3, other supplementary limitations such as preferred word correction can also be set.

[0156] Table 3:

[0157]

[0158] Of course, the above supplementary limitation is only an example, and those skilled in the art can add other limitations according to actual needs to optimize the sorting order of error correction words.

[0159] As shown in Table 4, some of the correction words are displayed after correcting some input pinyin strings according to the correction word sorting method provided in this embodiment.

[0160] Table 4:

[0161] Input Pinyin Correction words and sorting eili Hey, calendar, Hitachi daxue university, heavy snow, big Xue, capital, law napi that batch, where, there, that one zian Zi'an, Zi'an, Xian zianzai Now, first sz 10th Anniversary, Arc'teryx, 3, Crossbow aan Ah An, press wanan Good night, Wan iy 1. vl Green, Lu liag two Bingkui Ice cubes hngda Evergrande Qinren Relatives, lovers, Qin people sanghai Songhai, Shanghai, Hurt

[0162] From the above examples, it can be seen that the candidate words obtained after error correction and sorting according to the error correction word sorting method provided in this embodiment are not only accurate in error correction, but also the number of candidate words obtained is relatively moderate, which meets the actual usage needs of users.

[0163] By randomly selecting tens of thousands of incorrect pinyin cases and applying the error correction word sorting method provided in this embodiment to correct and sort, the error correction rate is increased by 40%, and the false correction rate is reduced by 30%, and a relatively balanced result is obtained in the error correction, sorting and number of words of the pinyin string. The error correction word sorting method provided in this embodiment can be applied to the field of artificial intelligence, especially in the sub-field of natural language processing corresponding to the field of artificial intelligence. By applying the error correction word sorting method provided in this embodiment, the input efficiency and error correction efficiency can be effectively improved.

[0164] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0165] Corresponding to the error correction word sorting method described in the above embodiment, Figure 7 A structural block diagram of an error correction word sorting device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0166] Reference Figure 7 The device can be applied to a terminal device, and specifically may include the following modules:

[0167] The error correction word acquisition module 701 is used to obtain multiple error correction words matching the character string when receiving the character string input by the user, and determine the error correction type to which each error correction word belongs and the word order weight corresponding to the error correction type;

[0168] A weight value determination module 702, configured to determine a weight value of each error correction word according to the word order weight of the error correction type;

[0169] The error correction word sorting module 703 is used to sort the multiple error correction words according to the weight value of each error correction word.

[0170] In the embodiment of the present application, the error correction word acquisition module 701 may specifically include the following submodules:

[0171] A character string error correction submodule, used to correct the character string according to a plurality of preset error correction types respectively when receiving a character string input by a user;

[0172] a target character string generation submodule, configured to generate a target character string corresponding to the target error correction type if the character string is successfully corrected according to the target error correction type, wherein the target error correction type is any one of the multiple error correction types;

[0173] The error correction word acquisition submodule is used to acquire multiple error correction words that match the target character string.

[0174] In the embodiment of the present application, the weight value determination module 702 may specifically include the following submodules:

[0175] An initial weight value acquisition submodule is used to obtain the initial weight value of each error correction word;

[0176] The weight value determination submodule is used to determine the weight value of each error correction word according to the initial weight value of each error correction word and the word order weight of the error correction type corresponding to each error correction word.

[0177] In the embodiment of the present application, each of the error correction types also has a corresponding error correction word number threshold, and the error correction word sorting module 703 may specifically include the following submodules:

[0178] The error correction word number counting submodule is used to count the number of error correction words corresponding to each error correction type;

[0179] The error correction word deletion submodule is used for deleting the error correction words exceeding the error correction word number threshold value of the corresponding error correction type if the number of the error correction words exceeds the error correction word number threshold value;

[0180] The error correction word sorting submodule is used to sort the remaining error correction words according to the weight values ​​of the remaining error correction words.

[0181] In the embodiment of the present application, the device may further include the following modules:

[0182] A mutually exclusive relationship judgment module is used to judge whether the error correction types corresponding to any two error correction words have a mutually exclusive relationship;

[0183] A module for determining a type to be deleted, configured to determine the error correction type to be deleted if the error correction types corresponding to any two error correction words have a mutually exclusive relationship;

[0184] The error correction word deletion module is used to delete each error correction word that matches the error correction type to be deleted.

[0185] In the embodiment of the present application, the module for determining the type to be deleted may specifically include the following submodules:

[0186] An order weight comparison submodule, for comparing the word order weights of the error correction types having a mutually exclusive relationship if the error correction types corresponding to any two error correction words have a mutually exclusive relationship;

[0187] The to-be-deleted type determination submodule is used to determine, among the error correction types having a mutually exclusive relationship, the error correction type corresponding to the minimum word order weight as the error correction type to be deleted.

[0188] In an embodiment of the present application, the error correction type may include at least one of error correction type one, error correction type two, error correction type three and error correction type four, the word order weight of the error correction type one is equal to the word order weight of the error correction type two, the word order weight of the error correction type two is greater than the word order weight of the error correction type three, and the word order weight of the error correction type three is greater than the word order weight of the error correction type four.

[0189] In an embodiment of the present application, the error correction word number threshold of the first error correction category is greater than the first number threshold, the error correction word number threshold of the second error correction category is less than or equal to the second number threshold, the error correction word number threshold of the third error correction category is less than or equal to the third number threshold, the error correction word number threshold of the fourth error correction category is less than or equal to the fourth number threshold, the first number threshold is greater than the second number threshold, the second number threshold is greater than the third number threshold, and the third number threshold is greater than the fourth number threshold.

[0190] In the embodiment of the present application, the third type of error correction and the fourth type of error correction are mutually exclusive.

[0191] In an embodiment of the present application, the first error correction category may include user-configured ambiguous sound correction, the second error correction category may include end-of-key input character correction, the third error correction category may include at least one of adjacent key correction and default ambiguous sound correction, and the fourth error correction category may include at least one of multiple-input character correction, middle-of-key input character correction, and exchange character correction.

[0192] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.

[0193] Reference Figure 8 , shows a schematic diagram of a terminal device according to an embodiment of the present application. Figure 8 As shown, the terminal device 800 of this embodiment includes: a processor 810, a memory 820, and a computer program 821 stored in the memory 820 and executable on the processor 810. When the processor 810 executes the computer program 821, the steps in each embodiment of the above-mentioned error correction word sorting method are implemented, for example Figure 3 Alternatively, when the processor 810 executes the computer program 821, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 7 Functions of modules 701 to 703 are shown.

[0194] Exemplarily, the computer program 821 may be divided into one or more modules / units, which are stored in the memory 820 and executed by the processor 810 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which may be used to describe the execution process of the computer program 821 in the terminal device 800. For example, the computer program 821 may be divided into an error correction word acquisition module, a weight value determination module, and an error correction word sorting module, and the specific functions of each module are as follows:

[0195] The error correction word acquisition module is used to obtain multiple error correction words matching the character string when receiving the character string input by the user, and determine the error correction type to which each error correction word belongs and the word order weight corresponding to the error correction type;

[0196] A weight value determination module, used to determine the weight value of each error correction word according to the word order weight of the error correction type;

[0197] The error correction word sorting module is used to sort the multiple error correction words according to the weight value of each error correction word.

[0198] The terminal device 800 may be a computing device such as a desktop computer, a notebook, a palm computer, etc. The terminal device 800 may include, but is not limited to, a processor 810 and a memory 820. Those skilled in the art will understand that Figure 8 It is only an example of the terminal device 800 and does not constitute a limitation of the terminal device 800. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device 800 may also include input and output devices, network access devices, buses, etc.

[0199] The processor 810 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0200] The memory 820 may be an internal storage unit of the terminal device 800, such as a hard disk or memory of the terminal device 800. The memory 820 may also be an external storage device of the terminal device 800, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 800. Further, the memory 820 may also include both an internal storage unit of the terminal device 800 and an external storage device. The memory 820 is used to store the computer program 821 and other programs and data required by the terminal device 800. The memory 820 may also be used to temporarily store data that has been output or is to be output.

[0201] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0202] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0203] In the embodiments provided in the present application, it should be understood that the disclosed error correction word sorting method, device, terminal device and storage medium can be implemented in other ways. For example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0204] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0205] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0206] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the error correction word sorting device, the terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, RandomAccess Memory), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0207] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method for sorting error correction words, characterized in that: include: When a character string input by a user is received, a plurality of correction words matching the character string are obtained, and the correction type to which each correction word belongs and the word order weight corresponding to the correction type are determined. If the correction types corresponding to any two correction words have a mutually exclusive relationship, the word order weights of the correction types having a mutually exclusive relationship are compared. Among the correction types having a mutually exclusive relationship, the correction type corresponding to the minimum word order weight is determined to be the correction type to be deleted, and each correction word matching the correction type to be deleted is deleted. The word order weight of the correction type is obtained by data statistics based on the correspondence between the incorrectly input character string and the finally input Chinese character. The character string includes a correct pinyin character string and / or an incorrect pinyin character string. The correction type includes a plurality of correction classes. Each correction class is provided with a corresponding correction word number threshold and a word order weight. The correction word number threshold indicates the maximum number of correction words of the class allowed to be displayed when performing correction according to the corresponding correction class. The correction class also includes a correction type configured by the user. All correction words obtained according to the correction type configured by the user can be retained. Determining the weight value of each error correction word according to the word order weight of the error correction type; The multiple error correction words are sorted according to the weight values ​​of the respective error correction words.

2. The method according to claim 1, characterized in that: When receiving a character string input by a user, obtaining a plurality of error correction words matching the character string includes: When receiving a character string input by a user, performing error correction on the character string according to a plurality of preset error correction types; If the character string is successfully corrected according to the target error correction type, a target character string corresponding to the target error correction type is generated, and the target error correction type is any one of the multiple error correction types; Acquire multiple error correction words that match the target character string.

3. The method according to claim 1, characterized in that Determining the weight value of each error correction word according to the word order weight of the error correction type includes: Obtaining initial weight values ​​of each error correction word; The weight value of each error correction word is determined according to the initial weight value of each error correction word and the word order weight of the error correction type corresponding to each error correction word.

4. The method according to claim 3, characterized in that The step of sorting the plurality of error correction words according to the weight values ​​of the respective error correction words comprises: Count the number of correction words corresponding to each correction type respectively; If the number of error correction words is greater than the error correction word number threshold of the corresponding error correction type, the error correction words greater than the error correction word number threshold are deleted; The remaining error correction words are sorted according to their weight values.

5. The method according to any one of claims 1 to 4, characterized in that: The error correction type includes at least one of error correction type one, error correction type two, error correction type three and error correction type four. The word order weight of the error correction type one is equal to the word order weight of the error correction type two, the word order weight of the error correction type two is greater than the word order weight of the error correction type three, and the word order weight of the error correction type three is greater than the word order weight of the error correction type four.

6. The method according to claim 5, characterized in that The error correction word number threshold of the first error correction category is greater than the first number threshold, the error correction word number threshold of the second error correction category is less than or equal to the second number threshold, the error correction word number threshold of the third error correction category is less than or equal to the third number threshold, the error correction word number threshold of the fourth error correction category is less than or equal to the fourth number threshold, the first number threshold is greater than the second number threshold, the second number threshold is greater than the third number threshold, and the third number threshold is greater than the fourth number threshold.

7. The method according to claim 5, characterized in that The third type of error correction and the fourth type of error correction are mutually exclusive.

8. The method according to claim 5, characterized in that The first error correction category includes user-configured ambiguous sound correction, the second error correction category includes the correction of missing characters at the end, the third error correction category includes at least one of adjacent key correction and default ambiguous sound correction, and the fourth error correction category includes at least one of multiple-input character correction, middle missing character correction and exchange character correction.

9. A device for sorting error correction words, characterized in that: include: The error correction word acquisition module is used to obtain multiple error correction words matching the character string when receiving the character string input by the user, and determine the error correction type to which each error correction word belongs and the word order weight corresponding to the error correction type. If the error correction types corresponding to any two error correction words have a mutually exclusive relationship, the word order weights of the error correction types with a mutually exclusive relationship are compared. Among the error correction types with a mutually exclusive relationship, the error correction type corresponding to the minimum word order weight is determined to be the error correction type to be deleted, and each error correction word matching the error correction type to be deleted is deleted. The error correction type The word order weight is obtained through data statistics based on the correspondence between the incorrectly input character string and the finally input Chinese character, the character string includes a correct pinyin character string and / or an incorrect pinyin character string, the error correction type includes multiple error correction classes, each of the error correction classes is provided with a corresponding error correction word number threshold and a word order weight, the error correction word number threshold indicates the maximum number of error correction words of this class allowed to be displayed when performing error correction according to the corresponding error correction class; the error correction class also includes a user-configured error correction type, and all error correction words obtained according to the user-configured error correction type can be retained; A weight value determination module, used to determine the weight value of each error correction word according to the word order weight of the error correction type; The error correction word sorting module is used to sort the multiple error correction words according to the weight value of each error correction word.

10. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the error correction word sorting method as described in any one of claims 1 to 8 is implemented.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the error correction word sorting method as described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and device for sorting candidate items of input method

    CN106774970A

  • Input method and device and device used for input

    CN107870677A