CN109656384B - Character string input method and device - Google Patents

Character string input method and device Download PDF

Info

Publication number
CN109656384B
CN109656384B CN201811581792.0A CN201811581792A CN109656384B CN 109656384 B CN109656384 B CN 109656384B CN 201811581792 A CN201811581792 A CN 201811581792A CN 109656384 B CN109656384 B CN 109656384B
Authority
CN
China
Prior art keywords
target
target code
string
code character
strings
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811581792.0A
Other languages
Chinese (zh)
Other versions
CN109656384A (en
Inventor
陈小帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Douyin Vision Co Ltd
Original Assignee
Douyin Vision Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Douyin Vision Co Ltd filed Critical Douyin Vision Co Ltd
Priority to CN201811581792.0A priority Critical patent/CN109656384B/en
Publication of CN109656384A publication Critical patent/CN109656384A/en
Application granted granted Critical
Publication of CN109656384B publication Critical patent/CN109656384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • G06F3/0236Character input methods using selection techniques to select from displayed items

Abstract

The present disclosure provides a character string input method and device, wherein the method includes: analyzing the obtained source code character strings, and determining a plurality of candidate target code character strings corresponding to the source code character strings; displaying a plurality of candidate target code strings in an input interface; detecting whether a triggering mode of each target codeword string in a plurality of candidate target code strings meets a preset condition; if the triggering mode of any target code character string meets the preset condition, determining a target codeword to be corrected in any target code character string; according to the source code character corresponding to the target codeword, determining a replacement target code character; when any one of the replacement target code characters is determined to be selected, the selected replacement target code character is used for replacing the target code character, so that a target codeword string corresponding to the source code string is generated. The method not only simplifies the operation of the user, but also reduces the cost of re-input of the user and improves the input efficiency of the character string.

Description

Character string input method and device
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a character string input method and device.
Background
At present, the input method can comprise five-stroke input, pinyin input, two-stroke input and other modes, wherein the pinyin input is the simplest and one of the most widely used modes. However, when a user inputs a character string using a pinyin input method, it is often encountered that the provided candidate character string does not meet the user's expectations, resulting in the user having to manually delete the inputted character string and then re-input the character string word by word. For example, as shown in fig. 1, the character string input by the user is zhu/xing/guang, and the user intends to input Zhu Xingguang, but the candidate character string returned by the input method is Zhu Xingguang, at this time, the user is required to delete the currently input character string and input character string word by word again, which not only has complicated operation and affects the input efficiency, but also increases the cost of the user input. In particular, for elderly users with difficulty in inputting, re-inputting may cause higher input costs.
Disclosure of Invention
The disclosure provides a character string input method and device, which are used for solving the problems of complex operation, increased user input cost and influence on input efficiency when a character string is input by using an input method in the related technology.
An embodiment of an aspect of the present disclosure provides a method for inputting a character string, including: analyzing the obtained source code character strings and determining a plurality of candidate target code character strings corresponding to the source code character strings; displaying the plurality of candidate target code strings in an input interface; detecting whether a triggering mode of each target codeword string in the candidate target code strings meets a preset condition; if the triggering mode of any target code character string meets a preset condition, determining a target codeword to be corrected in any target code character string; determining a replacement target code character according to the source code character corresponding to the target code character; when any one of the replacement target code characters is determined to be selected, the target codeword is replaced with the selected replacement target code character to generate a target codeword string corresponding to the source code string.
Another aspect of the present disclosure provides a character string input device, including: the first determining module is used for analyzing the acquired source code character strings and determining a plurality of candidate target code character strings corresponding to the source code character strings; the display module is used for displaying the candidate target code character strings in the input interface; the judging module is used for detecting whether the triggering mode of each target code character string in the candidate target code character strings meets the preset condition or not; the second determining module is used for determining a target codeword to be corrected in any target code character string if the triggering mode of the any target code character string meets a preset condition; the third determining module is used for determining the replacement target code character according to the source code character corresponding to the target code character; and the replacing module is used for replacing the target codeword by the selected replacing target code character when any replacing target code character is determined to be selected, so as to generate a target codeword string corresponding to the source code string.
In yet another aspect, an embodiment of the present disclosure provides an electronic device, where the electronic device includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor executes the program to implement the character string input method according to the embodiment of the first aspect.
A further aspect of the disclosure provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the character string input method of the first aspect embodiment.
The technical scheme disclosed by the disclosure has the following beneficial effects:
the method comprises the steps of firstly analyzing an obtained source code character string, determining a plurality of candidate target code character strings corresponding to the source code character string, displaying the plurality of candidate target code character strings in an input interface, detecting whether a triggering mode of each target code character string in the plurality of candidate target code character strings meets a preset condition, determining target code characters to be corrected in any target code character string if the triggering mode of any target code character string meets the preset condition, determining replacement target code characters according to the source code characters corresponding to the target code character, and replacing the target code characters with the selected replacement target code characters when any replacement target code character is determined to be selected, so as to generate target code character strings corresponding to the source code character string. Therefore, the candidate character strings which meet the intention of the user are selected to correct the candidate character strings, and the expected character strings are obtained, so that the candidate character strings provided by the display interface can be effectively utilized, the user operation is simplified, the cost of re-input of the user is reduced, and the character string input efficiency is improved.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The foregoing and/or additional aspects and advantages of the present disclosure will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, wherein,
FIG. 1 is a schematic diagram of candidate strings returned by a related art input method based on an input string;
FIG. 2 is a flow chart of a character string input method according to an embodiment of the disclosure;
FIG. 3 is a flow chart illustrating a method for determining target code characters to be corrected in any target code string according to an embodiment of the present disclosure;
FIG. 4 is a flow chart of a character string input method according to another embodiment of the present disclosure;
FIG. 5 is a schematic diagram illustrating moving an input focus to a location where a target codeword to be corrected is located, according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a character string input device according to one embodiment of the present disclosure;
fig. 7 is a schematic structural view of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present disclosure and are not to be construed as limiting the present disclosure.
Aiming at the problems that in the related art, when a character string is input by using an input method, the operation is complicated, the input cost of a user is increased and the input efficiency is influenced, the embodiment of the disclosure provides a character string input method.
According to the embodiment of the disclosure, the obtained source code strings are analyzed, a plurality of candidate target code strings corresponding to the source code strings are determined, the candidate target code strings are displayed in an input interface, then a triggering mode of each target code string in the candidate target code strings is detected, whether a preset condition is met or not is judged, if the triggering mode of any target code string meets the preset condition, a target code symbol to be corrected in any target code string is determined, according to the source code character corresponding to the target code symbol, a replacement target code character is determined, and when any replacement target code character is determined to be selected, the selected replacement target code character is utilized to replace the target code character, so that a target code symbol string corresponding to the source code string is generated. Therefore, the method realizes that the candidate character strings meeting the user intention are selected to correct the candidate character strings to obtain the expected character strings, thereby effectively utilizing the candidate character strings provided by the display interface, simplifying the user operation, reducing the cost of re-input of the user and improving the character string input efficiency
The character string input method and apparatus of the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
First, a specific description will be given of a character string input method according to an embodiment of the present disclosure with reference to fig. 2.
As shown in fig. 2, the character string input method according to the embodiment of the disclosure includes the following steps:
step 201, analyzing the obtained source code character strings, and determining a plurality of candidate target code character strings corresponding to the source code character strings.
The character string input method provided by the embodiment of the disclosure can be executed by the electronic device provided by the embodiment of the disclosure. The electronic equipment is provided with a character string input device so as to realize the control of the input character string. In this embodiment, the electronic device may be, but is not limited to: smart phones, wearable devices, personal computers, palm top computers, personal digital assistants, and the like.
In practical use, there may be a one-to-many relationship between the source code string and the candidate string entered by the user, such as a one-to-many relationship between Chinese pinyin and Chinese kanji. For example, the Pinyin string "xing" corresponds to Chinese characters including: "Star, xingxing, row, type" and so on.
Therefore, in the embodiment of the disclosure, after the electronic device receives the source code string input by the user, the electronic device may determine a plurality of candidate target strings corresponding to the source code string by analyzing the obtained source code string.
In this embodiment, when determining a plurality of candidate target code strings corresponding to the source code strings, word segmentation is performed on the source code strings to determine each source code character in the source code strings, and then the plurality of candidate target code strings are determined according to each candidate target code character corresponding to each source code character and the combination probability between each candidate target code character.
In specific implementation, the method can be realized by determining a plurality of candidate target code character strings corresponding to the source code character strings through the following steps:
step one: word segmentation processing of the source code character strings;
the word segmentation processing can be carried out on the source code character strings by means of word segmentation methods based on character string matching, word segmentation methods based on understanding, word segmentation methods based on statistics and the like, so that each source code character in the source code character strings is obtained.
Step two: searching words;
and (3) respectively comparing each source code character with entries in a pre-constructed word stock, and taking out entries which accord with hit modes, such as complete pinyin hit, prefix pinyin hit and the like, as a candidate list 1.
Step three: word forming;
this step is suitable for obtaining a longer source string of characters, such as "buzhidaoguoqingshifoujiaban", that the user inputs at a time. In order to accurately determine the candidate target code character string corresponding to the source code character string, a candidate list 2 is constructed by combining a plurality of entries. Such as: the candidate list 2 corresponding to the longer source code strings is constructed by combining a plurality of terms, for example, the candidate list may be: "don't/know/national celebration/whether/overtime", "don't value/island/please/no/splint/".
That is, this step is responsible for constructing a word candidate list conforming to language statistics habits based on a language model or the like.
Step four: sequencing and frequency modulation:
namely, summarizing and sorting the candidate list 1 and the candidate list 2 constructed in the second step and the third step.
The candidate list 1 and the candidate list 2 are reasonably ordered by combining the context of the source code string input by the user, the input environment, the geographical position of the user and the like.
Further, the candidate code characters in the sorted candidate list are a plurality of candidate target character strings corresponding to the source code character strings.
Step 202, displaying a plurality of candidate target code strings in an input interface.
Step 203, detecting whether a trigger mode of each target codeword string in the plurality of candidate target codeword strings meets a preset condition.
Step 204, if the trigger mode of any one of the target code strings satisfies the preset condition, determining the target code character to be corrected in any one of the target code strings.
The preset conditions may be set according to actual use, and are not particularly limited herein.
In the related art, when an electronic device determines a candidate target code string according to a source code string input by a user, a statistical model based on a large number of users and corpora is generally adopted, and the returned candidate target code string is generally a high-frequency candidate. Even if the context frequency modulation sequence of the input source code character strings and the user personalized sequencing model are combined, the candidate target code character strings finally provided for the user cannot completely ensure that the input intention of the user at any time is met. At this time, in order to input the target codeword string according with the user's intention, the user is required to manually delete the input source codeword string and then input the source codeword string again word by word or perform the selection input word by word, which increases the difficulty of the input operation of the user and affects the input efficiency.
In this regard, in the embodiment of the disclosure, after determining a plurality of candidate target code strings corresponding to the source code strings according to the obtained source code strings and displaying the plurality of candidate target code strings, a trigger model of each target code string in the plurality of candidate target code strings is further detected, so as to determine whether a preset condition is satisfied according to a trigger mode of each target code string, and when the trigger mode of any target code string satisfies the preset condition, determine a target code character to be corrected in the target code string.
That is, when none of the plurality of candidate target code strings displayed in the input interface fully meets the user's desire, the user may select a target code string that partially meets the user's input intention from the plurality of candidate target code strings, so that the target code string enters a correction mode, and the target code character to be corrected is determined, so that the determined target code character to be corrected is subjected to corresponding correction processing.
In this embodiment, whether the trigger mode of each target codeword string in the plurality of candidate target codeword strings satisfies the preset condition may be detected by the following steps.
Mode one:
and detecting whether the touch pressure of each target codeword string in the candidate target code strings is larger than a preset value.
Currently, electronic devices generally have an auxiliary function of a three-dimensional Touch technology (3D Touch), so that a dimension of pressing a screen is increased in addition to basic operations such as clicking and sliding through the 3D Touch, and vibration feedback is provided, so that a user feels that the screen can be pressed down, and interaction modes of the user and the electronic device are enriched. Namely, 3D Touch enables electronic devices to increase the dimension of the heavy press on the basis of the light-click and the light-press.
Therefore, in the embodiment of the disclosure, the touch pressure of each target codeword string can be obtained through the pressure sensor, and the touch pressure is compared with a preset value, and when the touch pressure value of a certain target codeword string is greater than the preset value, it can be determined that the target codeword string meets the preset condition.
That is, in order to distinguish the operation of the user for commonly selecting the candidate target code string, the present disclosure may predefine a preset value of the Touch pressure, for example, when the force of pressing a certain candidate target code string is defined to be greater than the preset value based on the currently popular 3D-Touch manner, it is indicated that the target code string portion satisfies the current input intention of the user, that is, the preset condition is satisfied.
For example, when the touch pressure value of the 2 nd target codeword string in the 10 candidate target code strings is greater than a preset value, the 2 nd target code string meets a preset condition.
Mode two:
and detecting whether the touch mode of each target codeword string in the candidate target code strings is matched with a preset mode.
In the embodiment of the disclosure, the touch mode of each candidate target code string in the plurality of candidate target code strings provided in the input interface may be detected, and the detected touch mode may be matched with a preset mode. And when the touch mode of any candidate target code character string is matched with the preset mode, the candidate target code character string is indicated to meet the preset condition.
For example, if the preset manner is pressing the candidate target code string again, when the 3 rd candidate target code string in the plurality of candidate target code strings is pressing again, it is determined that the 3 rd candidate target code string meets the preset condition.
Further, after determining that the trigger mode of any one of the plurality of candidate target code strings meets the preset condition, the embodiment of the present disclosure may further determine the target code character to be corrected in the target code character string.
Wherein determining the target codeword symbol to be corrected in any target code string is described in the following embodiments.
And 205, determining the replacement target code character according to the source code character corresponding to the target code character.
Optionally, after determining the target codeword to be corrected, the electronic device may determine, according to the source code character corresponding to the target codeword, a replacement target code character using the prior art.
For example, if the target code character to be corrected is "star", the electronic device may determine that the source code character is "xing" according to "star", and further may determine that the replacement target code character may be: "Xingzhi, sexual, shape, unfortunately".
Step 206, when it is determined that any of the replacement target code characters is selected, replacing the target code character with the selected replacement target code character to generate a target codeword string corresponding to the source codeword string.
Continuing with the above example, if the "Xing" of the replacement target code characters "Xing, row, sex, shape, unfortunately" is selected, and the target codeword string corresponding to the target codeword to be processed is: "Zhu Xingguang", the electronic device may replace the target codeword "star" to be processed with "Xingxing" to generate a string of source codes: "zhu/xing/guang", corresponding target codeword string: "Zhu Xingguang".
According to the character string input method, firstly, the obtained source code character string is analyzed, a plurality of candidate target code character strings corresponding to the source code character string are determined, the candidate target code character strings are displayed in an input interface, the triggering mode of each target code character string in the candidate target code character strings is detected, whether a preset condition is met or not is judged, if the triggering mode of any target code character string meets the preset condition, the target code character to be corrected in any target code character string is determined, replacement target code characters are determined according to the source code characters corresponding to the target code character, and when any replacement target code character is determined to be selected, the selected replacement target code character is utilized to replace the target code character, so that the target code character string corresponding to the source code character string is generated. Therefore, the candidate character strings which meet the intention of the user are selected to correct the candidate character strings, and the expected character strings are obtained, so that the candidate character strings provided by the display interface can be effectively utilized, the user operation is simplified, the cost of re-input of the user is reduced, and the character string input efficiency is improved.
The process of determining the target code character to be corrected in any target code character string in the embodiment of the present disclosure will be described in detail with reference to fig. 3.
As shown in fig. 3, determining the target code character to be corrected in any target code character string in this embodiment may include the following steps:
step 301, determining the number of replacement characters corresponding to each target codeword according to the number of candidate target codewords corresponding to each source code character in the source code string.
Step 302, determining target code characters to be corrected in any target code character string according to the number of replacement characters corresponding to each target code character in any target code character string.
For example, if the source code string is "zhu/xing/guang", the number of replacement characters corresponding to each of "zhu", "xing", "guang" is determined by performing analysis processing on each of "zhu", "xing", "guang" in the source code string. Here, it is assumed that the number of replacement characters corresponding to "zhu" is 10, the number of replacement characters corresponding to "xing" is 30, and the number of replacement characters corresponding to "guang" is 5.
Then, the electronic device may determine, as the target code character to be corrected, the "star" having the number of 30 replacement characters in the target code character string X in such a manner that the repetition rate is high.
Further, in this embodiment, determining the target codeword to be corrected in any target code string may further include:
and determining target code characters to be corrected in any target code character string according to the historical correction frequency corresponding to each target code character in any target code character string.
In this embodiment, when determining the target codeword to be corrected in any target code string, the target code character with high history correction frequency may be selected.
For example, the target codeword string is "Zhu Xingguang", wherein the target codeword string is based on: the star light in Zhu Xingguang is deleted, and the correction frequency of the star light is input again, so that P (star- > Xingzhu) is constructed, namely, the probability that the star light is wrongly displayed by the Xingzhu in Zhu Xingguang is constructed. If the frequency of correcting the "starlight" in the "Zhu Xingguang" to the "emerging light" is higher than that of the other cases, the target code character can be determined to be "star".
In the embodiment of the disclosure, when determining the target code character to be corrected in any target code character string, the method may be performed not only on the electronic device side but also on the cloud server side.
That is, when determining the target codeword to be corrected, the embodiments of the present disclosure may adopt different manners, so that the determined target codeword to be corrected satisfies the user intention as much as possible, so as to reduce the operation steps of inputting the target codeword string by the user, and improve the input efficiency.
As can be seen from the above analysis, in the embodiment of the present disclosure, by detecting the trigger mode of each target code string, when the trigger mode of any one target code string meets a preset condition, the target code symbol to be corrected is determined, then, according to the source code character corresponding to the target code symbol, the replacement target code character is determined, and the target code character is replaced by the selected replacement target code character, so as to generate the target code string.
In a specific implementation, after determining a target codeword to be corrected according to a trigger mode of any target code string that satisfies a preset condition, if the determined target codeword to be corrected is not the target codeword intended to be corrected by the user, the embodiment of the disclosure may further receive an input focus movement instruction, update the target code character to be corrected according to the input focus movement instruction, and perform correction processing on the updated target codeword to be corrected to obtain a target codeword string that satisfies the user's intention. The above-described procedure of the character string input method according to the embodiment of the present disclosure will be specifically described with reference to fig. 4.
Fig. 4 is a flowchart illustrating a character string input method according to another embodiment of the present disclosure. As shown in fig. 4, the character string input method of the embodiment of the present disclosure may include the steps of:
step 401, analyzing the obtained source code strings, and determining a plurality of candidate target code strings corresponding to the source code strings.
Step 402, displaying a plurality of candidate target code strings in an input interface.
Step 403, detecting whether a trigger mode of each target codeword string in the plurality of candidate target codeword strings meets a preset condition.
Step 404, if the trigger mode of any one of the target code strings satisfies the preset condition, determining the target code character to be corrected in any one of the target code strings.
Step 405, the current input focus is moved to the target codeword to be corrected.
After determining the target codeword to be corrected according to the implementation manner of the foregoing embodiment, the electronic device may correspondingly move the current input focus to the target codeword to be corrected, and determine the operation of replacing the target codeword according to the source code character corresponding to the target codeword to be corrected.
If an instruction for indicating the movement of the input focus is detected, the target code character to be corrected is updated according to the target position in the instruction, step 406.
In practical use, in order to facilitate a user to select a target codeword to be corrected, which meets the self intention, the electronic device in the embodiment of the present disclosure may further segment and display a target code string that meets a preset condition, so that when it is determined that the target code character to be corrected does not meet the user intention in the target code string, the user may update the target code character to be corrected by triggering and inputting a focus movement instruction.
For example, as shown in fig. 5, when it is determined that "star" in the target code character string "Zhu Xingguang" is the target codeword to be corrected, the electronic device may move the input focus to the position where the target code character "star" to be corrected is located. At this time, if the input focus movement instruction is detected, the electronic device may analyze the input focus movement instruction to obtain the target position. Assuming that the acquired target position is the position where the target codeword "light" is located, the electronic device may control the input focus to move to the position where the target codeword "light" is located.
Step 407, determining the replacement target code character according to the updated source code character corresponding to the target code character to be corrected.
Continuing to refer to the above example, when the updated target code character to be corrected is "light", the electronic device may determine that the source code character is "guide" according to the "light", and then determine that the replacement target code character may be: wide, strolling, rustic, bang, etc.
Step 408, when it is determined that any of the replacement target code characters is selected, replaces the target code character with the selected replacement target code character to generate a target codeword string corresponding to the source codeword string.
Continuing with the above example, if "wide" of the replacement target code characters "wide, shopping, rustic, and bang" is selected, and the target codeword string corresponding to the target codeword to be processed is: "Zhu Xingguang", the electronic device may replace the target codeword "light" to be processed with the selected "broad" to generate a codeword with the source code string: the target codeword string corresponding to "zhuxingguang": "Zhu Xingan".
According to the character string input method, when the trigger mode of any one of a plurality of candidate target code character strings is determined to meet the preset condition, the target code character to be corrected in any one of the candidate target code character strings is determined, the current input focus is moved to the position of the target code character to be corrected, if an instruction for indicating the movement of the input focus is detected, the target code character to be corrected is updated according to the target position in the instruction, then the replacement target code character is determined according to the source code character corresponding to the updated target code character to be corrected, and when any one of the replacement target code character is selected, the target code character corresponding to the source code character is replaced by the selected replacement target character, and the target code character string corresponding to the source code character is generated, so that when the determined target code character to be corrected does not meet the user intention, the target code character to be corrected is updated according to the user operation instruction, the current candidate result can be utilized, the cost of re-input of a user can be reduced, and the input experience of the user is improved.
In order to implement the above embodiment, the present disclosure further proposes a character string input device.
Fig. 6 is a schematic structural view of a character string input device according to one embodiment of the present disclosure. As shown in fig. 6, a character string input device of an embodiment of the present disclosure includes: the device comprises a first determining module 11, a display module 12, a judging module 13, a second determining module 14, a third determining module 15 and a replacing module 16.
The first determining module 11 is configured to parse the obtained source code strings and determine a plurality of candidate target code strings corresponding to the source code strings;
the display module 12 is used for displaying the candidate target code character strings in the input interface;
the judging module 13 is configured to detect whether a trigger mode of each target codeword string in the plurality of candidate target codeword strings meets a preset condition;
the second determining module 14 is configured to determine a target codeword to be corrected in any target code string if the trigger mode of the any target code string meets a preset condition;
the third determining module 15 is configured to determine, according to the source code character corresponding to the target codeword, a replacement target code character;
the replacing module 16 is configured to replace the target codeword with the selected replacement target code character to generate a target codeword string corresponding to the source code string when it is determined that any one of the replacement target code characters is selected.
Optionally, in an optional implementation manner of the present disclosure, the determining module 13 is specifically configured to:
detecting whether the touch pressure of each target codeword string in the candidate target code strings is larger than a preset value;
or alternatively, the process may be performed,
and detecting whether the touch mode of each target codeword string in the candidate target code strings is matched with a preset mode.
Optionally, in an optional implementation manner of the disclosure, the second determining module 14 is specifically configured to:
and determining target code characters to be corrected in any target code character string according to the number of the replacement characters corresponding to each target code character in any target code character string.
Optionally, in an optional implementation of the disclosure, the character string input device further includes: and a fourth determination module.
The fourth determining module is configured to determine, according to the number of candidate target code characters corresponding to each source code character in the source code character string, the number of replacement characters corresponding to each target code character.
Optionally, in an optional implementation manner of the disclosure, the second determining module 14 is specifically configured to:
and determining target code characters to be corrected in any target code character string according to the historical correction frequency corresponding to each target code character in any target code character string.
Optionally, in an optional implementation of the disclosure, the character string input device further includes: a mobile module and an update module.
The moving module is used for moving the current input focus to the target codeword to be corrected;
and the updating module is used for updating the target code character to be corrected according to the target position in the instruction if the instruction for indicating the movement of the input focus is detected.
Optionally, in an optional implementation manner of the present disclosure, the first determining module 11 is further configured to:
determining a plurality of candidate target code strings corresponding to the source code strings, including:
word segmentation is carried out on the source code character string to determine each source code character in the source code character string;
and determining a plurality of candidate target code character strings according to the candidate target code characters corresponding to the source code characters and the combined probability values among the candidate target code characters.
It should be noted that the foregoing explanation of the embodiment of the string input method is also applicable to the string input device of this embodiment, and the implementation principle is similar, which is not repeated here.
According to the character string input device provided by the embodiment of the disclosure, firstly, an acquired source code character string is analyzed, a plurality of candidate target code character strings corresponding to the source code character string are determined, the candidate target code character strings are displayed in an input interface, a trigger mode of each target code character string in the candidate target code character strings is detected, whether a preset condition is met or not is judged, if the trigger mode of any target code character string meets the preset condition, a target code character to be corrected in any target code character string is determined, a replacement target code character is determined according to the source code character corresponding to the target code character, and when any replacement target code character is determined to be selected, the selected replacement target code character is utilized to replace the target code character, so that a target code character string corresponding to the source code character string is generated. Therefore, the candidate character strings which meet the intention of the user are selected to correct the candidate character strings, and the expected character strings are obtained, so that the candidate character strings provided by the display interface can be effectively utilized, the user operation is simplified, the cost of re-input of the user is reduced, and the character string input efficiency is improved.
In order to implement the above embodiments, the present disclosure also proposes an electronic device.
Fig. 7 is a schematic structural view of an electronic device according to an embodiment of the present disclosure.
Referring now to fig. 7, a schematic diagram of an electronic device 800 suitable for use in implementing embodiments of the present disclosure is shown. Electronic devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, PDAs (personal digital assistants), PADs (tablet computers), and the like, as well as stationary terminals such as desktop computers, and the like. The electronic device shown in fig. 7 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 7, the electronic device 800 may include a processing means (e.g., a central processor, a graphics processor, etc.) 801, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
In general, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, etc.; storage 808 including, for example, magnetic tape, hard disk, etc.; communication means 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 shows an electronic device 800 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 809, or installed from storage device 808, or installed from ROM 802. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 801.
It should be noted that, the implementation process and the technical principle of the electronic device in this embodiment refer to the foregoing explanation of the character string input method in the first embodiment, and are not repeated herein.
The electronic device provided by the embodiment of the disclosure first analyzes an obtained source code string, determines a plurality of candidate target code strings corresponding to the source code string, displays the plurality of candidate target code strings in an input interface, detects a trigger mode of each target code string in the plurality of candidate target code strings, and if the trigger mode of any target code string meets a preset condition, determines a target code symbol to be corrected in any target code string, determines a replacement target code character according to the source code character corresponding to the target code symbol, and when any replacement target code character is determined to be selected, replaces the target code character with the selected replacement target code character to generate a target code symbol string corresponding to the source code string. Therefore, the candidate character strings which meet the intention of the user are selected to correct the candidate character strings, and the expected character strings are obtained, so that the candidate character strings provided by the display interface can be effectively utilized, the user operation is simplified, the cost of re-input of the user is reduced, and the character string input efficiency is improved.
To achieve the above object, the present disclosure also proposes a computer-readable storage medium.
Wherein the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the character string input method according to the embodiment of the first aspect.
In alternative implementations, the present embodiments may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
To achieve the above object, the present disclosure also proposes a computer program. Wherein the computer program is configured to implement the character string input method according to the embodiment of the first aspect when executed by the processor.
In the present disclosure, unless explicitly stated and limited otherwise, the terms "disposed," "connected," and the like should be construed broadly, and may be, for example, mechanically or electrically connected; either directly or indirectly, through intermediaries, or both, may be in communication with each other or in interaction with each other, unless expressly defined otherwise. The specific meaning of the terms in this disclosure will be understood by those of ordinary skill in the art as the case may be.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and further implementations are included within the scope of the preferred embodiment of the present disclosure in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present disclosure.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. Although embodiments of the present disclosure have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the present disclosure, and that variations, modifications, alternatives, and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the present disclosure.

Claims (7)

1. A character string input method, comprising:
analyzing the obtained source code character strings and determining a plurality of candidate target code character strings corresponding to the source code character strings;
displaying the plurality of candidate target code strings in an input interface;
detecting whether a triggering mode of each target codeword string in the candidate target code strings meets a preset condition;
if the triggering mode of any target code character string meets a preset condition, determining a target codeword to be corrected in any target code character string;
The determining the target codeword to be corrected in any target code string includes: determining the number of the replacement characters corresponding to each target codeword according to the number of the candidate target code characters corresponding to each source code character in the source code character string; determining target code characters to be corrected in any target code character string according to the number of replacement characters corresponding to each target code character in the any target code character string; or determining the target codeword to be corrected in any target code string according to the historical correction frequency corresponding to each target codeword in any target code string;
determining a replacement target code character according to the source code character corresponding to the target code character;
when any one of the replacement target code characters is determined to be selected, the target codeword is replaced with the selected replacement target code character to generate a target codeword string corresponding to the source code string.
2. The method of claim 1, wherein the detecting whether the trigger pattern of each target codeword string of the plurality of candidate target codeword strings meets a preset condition comprises:
detecting whether the touch pressure of each target codeword string in the candidate target code strings is larger than a preset value;
Or alternatively, the process may be performed,
and detecting whether the touch mode of each target codeword string in the candidate target code strings is matched with a preset mode.
3. The method of any of claims 1-2, wherein after determining the target codeword to be modified in any of the target code strings, further comprising:
moving the current input focus to the target codeword to be corrected;
and if the instruction for indicating the input focus to move is detected, updating the target code character to be corrected according to the target position in the instruction.
4. The method of any of claims 1-2, wherein determining a plurality of candidate target code strings corresponding to the source code string comprises:
word segmentation is carried out on the source code character string to determine each source code character in the source code character string;
and determining a plurality of candidate target code character strings according to the candidate target code characters corresponding to the source code characters and the combined probability values among the candidate target code characters.
5. A character string input device, comprising:
the first determining module is used for analyzing the acquired source code character strings and determining a plurality of candidate target code character strings corresponding to the source code character strings;
The display module is used for displaying the candidate target code character strings in the input interface;
the judging module is used for detecting whether the triggering mode of each target code character string in the candidate target code character strings meets the preset condition or not;
the second determining module is used for determining a target codeword to be corrected in any target code character string if the triggering mode of the any target code character string meets a preset condition;
the determining the target codeword to be corrected in any target code string includes:
determining the number of the replacement characters corresponding to each target codeword according to the number of the candidate target code characters corresponding to each source code character in the source code character string; determining target code characters to be corrected in any target code character string according to the number of replacement characters corresponding to each target code character in the any target code character string; or determining the target codeword to be corrected in any target code string according to the historical correction frequency corresponding to each target codeword in any target code string;
the third determining module is used for determining the replacement target code character according to the source code character corresponding to the target code character;
And the replacing module is used for replacing the target codeword by the selected replacing target code character when any replacing target code character is determined to be selected, so as to generate a target codeword string corresponding to the source code string.
6. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the program implementing the character string input method of any one of claims 1-4.
7. A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a character string input method as claimed in any one of claims 1 to 4.
CN201811581792.0A 2018-12-24 2018-12-24 Character string input method and device Active CN109656384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811581792.0A CN109656384B (en) 2018-12-24 2018-12-24 Character string input method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811581792.0A CN109656384B (en) 2018-12-24 2018-12-24 Character string input method and device

Publications (2)

Publication Number Publication Date
CN109656384A CN109656384A (en) 2019-04-19
CN109656384B true CN109656384B (en) 2023-07-18

Family

ID=66115005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811581792.0A Active CN109656384B (en) 2018-12-24 2018-12-24 Character string input method and device

Country Status (1)

Country Link
CN (1) CN109656384B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110427328A (en) * 2019-08-07 2019-11-08 北京字节跳动网络技术有限公司 Text handling method, device, equipment and storage medium
CN113765769B (en) * 2020-06-02 2023-11-07 腾讯科技(深圳)有限公司 Message display method, message sending device, message display equipment and medium
CN111930245A (en) * 2020-08-10 2020-11-13 维沃移动通信有限公司 Character input control method and device and electronic equipment
CN112347142B (en) * 2020-11-17 2024-03-01 上海幻电信息科技有限公司 Data processing method and device
CN116088692B (en) * 2021-11-03 2024-04-19 百度国际科技(深圳)有限公司 Method and apparatus for presenting candidate character strings and training discriminant models

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276245A (en) * 2008-04-16 2008-10-01 北京搜狗科技发展有限公司 Reminding method and system for coding to correct error in input process
CN101710262A (en) * 2009-12-11 2010-05-19 北京搜狗科技发展有限公司 Error correction method and error correction device of characters
CN103473003A (en) * 2013-09-12 2013-12-25 天津三星通信技术研究有限公司 Character input error correction method and device
CN107092424A (en) * 2016-02-18 2017-08-25 北京搜狗科技发展有限公司 A kind of display methods of error correction, device and the device of the display for error correction
CN107436691A (en) * 2016-05-26 2017-12-05 北京搜狗科技发展有限公司 A kind of input method carries out method, client, server and the device of error correction

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886294B (en) * 2015-12-15 2020-10-27 北京搜狗科技发展有限公司 Input method error correction method and device
CN107179835A (en) * 2016-03-11 2017-09-19 北京搜狗科技发展有限公司 A kind of input method and device, a kind of device for being used to input
CN107544684B (en) * 2016-06-29 2021-11-02 北京搜狗科技发展有限公司 Candidate word display method and device
CN107688397B (en) * 2016-08-03 2022-10-21 北京搜狗科技发展有限公司 Input method, system and device for inputting
CN106468960A (en) * 2016-09-07 2017-03-01 北京新美互通科技有限公司 A kind of method and system of candidates of input method sequence
CN109002183B (en) * 2017-06-07 2022-11-29 北京搜狗科技发展有限公司 Information input method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276245A (en) * 2008-04-16 2008-10-01 北京搜狗科技发展有限公司 Reminding method and system for coding to correct error in input process
CN101710262A (en) * 2009-12-11 2010-05-19 北京搜狗科技发展有限公司 Error correction method and error correction device of characters
CN103473003A (en) * 2013-09-12 2013-12-25 天津三星通信技术研究有限公司 Character input error correction method and device
CN107092424A (en) * 2016-02-18 2017-08-25 北京搜狗科技发展有限公司 A kind of display methods of error correction, device and the device of the display for error correction
CN107436691A (en) * 2016-05-26 2017-12-05 北京搜狗科技发展有限公司 A kind of input method carries out method, client, server and the device of error correction

Also Published As

Publication number Publication date
CN109656384A (en) 2019-04-19

Similar Documents

Publication Publication Date Title
CN109656384B (en) Character string input method and device
US11573698B2 (en) Neural network for keyboard input decoding
US10698604B2 (en) Typing assistance for editing
US8751972B2 (en) Collaborative gesture-based input language
JP6594534B2 (en) Text information processing method and device
CN110334360B (en) Machine translation method and device, electronic device and storage medium
US20170003749A1 (en) Method of hand-gesture input
US20180300542A1 (en) Drawing emojis for insertion into electronic text-based messages
US20110242000A1 (en) Method for optimization of soft keyboards for multiple languages
CN104731509A (en) Searching method and device based on touch operation and terminal
CN114740981B (en) Information processing method, information processing apparatus, readable medium, electronic device, and program product
EP2731018A2 (en) Method of providing predictive text
US20130346905A1 (en) Targeted key press zones on an interactive display
KR102087807B1 (en) Character inputting method and apparatus
JP2018185792A (en) Method and device for correcting error of input method based on user input speed
CN112560499B (en) Pre-training method and device for semantic representation model, electronic equipment and storage medium
CN111563593A (en) Training method and device of neural network model
CN104281275B (en) The input method of a kind of English and device
US9697184B2 (en) Adjusting layout size of hyperlink
CN111143564B (en) Unsupervised multi-target chapter-level emotion classification model training method and device
CN106886294B (en) Input method error correction method and device
JP7285899B2 (en) USER IMAGE RECOGNITION MODEL UPDATE METHOD, APPARATUS, ELECTRONIC DEVICE, COMPUTER-READABLE RECORDING MEDIUM, AND COMPUTER PROGRAM
JP7456287B2 (en) Display device, program, display method
CN105589570A (en) Input error processing method and apparatus
CN110262672B (en) Suggested candidate list generation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: Room B0035, 2nd floor, No. 3 Courtyard, 30 Shixing Street, Shijingshan District, Beijing, 100041

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant