CN115981486A - Input method, device and medium - Google Patents

Input method, device and medium Download PDF

Info

Publication number
CN115981486A
CN115981486A CN202111199223.1A CN202111199223A CN115981486A CN 115981486 A CN115981486 A CN 115981486A CN 202111199223 A CN202111199223 A CN 202111199223A CN 115981486 A CN115981486 A CN 115981486A
Authority
CN
China
Prior art keywords
candidate
candidate item
type
determining
width
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.)
Pending
Application number
CN202111199223.1A
Other languages
Chinese (zh)
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.)
Beijing Sogou Technology Development Co Ltd
Original Assignee
Beijing Sogou Technology Development 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 Beijing Sogou Technology Development Co Ltd filed Critical Beijing Sogou Technology Development Co Ltd
Priority to CN202111199223.1A priority Critical patent/CN115981486A/en
Publication of CN115981486A publication Critical patent/CN115981486A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides an input method, an input device and a medium, wherein the method specifically comprises the following steps: determining the type of the candidate item; determining the drawing width corresponding to the candidate item according to the processing mode corresponding to the type of the candidate item; wherein, different types correspond to different processing modes; and drawing the candidate items according to the drawing width. The embodiment of the invention can improve the showing efficiency of the candidate items.

Description

Input method, apparatus and medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to an input method, an input device and an input medium.
Background
Currently, a keyboard is generally used as an input device for a terminal such as a computer, a mobile phone, and a personal digital assistant. In the case that a user triggers a key in the keyboard, the operating system generally transmits a corresponding virtual-key-code to the input method program; and after receiving the virtual key code, the input method program converts the virtual key code into characters.
At present, an input method program processes a key after detecting a trigger event of the key; the corresponding processing process specifically comprises the following steps: and identifying key values, acquiring candidate items, displaying the candidate items and the like.
The inventor finds that in the process of presenting the candidate items, characters contained in the candidate items need to be drawn respectively, so that the presenting efficiency of the candidate items is low.
Disclosure of Invention
How to improve the display efficiency of the candidates is a technical problem to be solved by those skilled in the art. In view of the above problems. In view of the above problems, embodiments of the present invention are proposed to provide an input method, apparatus and medium that overcome the above problems or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses an input method, including:
determining the type of the candidate item;
determining the drawing width corresponding to the candidate item according to the processing mode corresponding to the type of the candidate item; wherein, different types correspond to different processing modes;
and drawing the candidate items according to the drawing width.
In another aspect, an embodiment of the present invention discloses an input device, including:
the type determining module is used for determining the types of the candidate items;
the drawing width determining module is used for determining the drawing width corresponding to the candidate item according to the processing mode corresponding to the type of the candidate item; wherein, different types correspond to different processing modes; and
and the drawing module is used for drawing the candidate items according to the drawing width.
Optionally, the type of the candidate item includes: and presetting a language type or a mixed type of a language and a preset character.
Optionally, the drawing width determining module includes:
and the overall width determining module is used for determining the drawing width corresponding to the candidate item according to the width information of the single character and the number of characters contained in the candidate item under the condition that the type of the candidate item is a preset language type.
Optionally, the drawing width determining module includes:
the single character width determining module is used for determining width information corresponding to the single characters contained in the candidate items under the condition that the types of the candidate items are mixed types;
and the fusion module is used for fusing the width information corresponding to all the single characters contained in the candidate items to obtain the drawing width corresponding to the candidate items.
Optionally, the drawing width determining module includes:
the asynchronous determining module is used for enabling the first thread to determine the drawing width corresponding to the candidate item from the character information of the single character contained in the candidate item to the second thread Cheng Fasong under the condition that the type of the candidate item is a mixed type.
Optionally, the apparatus further comprises:
and the candidate item determining module is used for determining a candidate item corresponding to the key under the condition that a pressing event of the key is detected.
Optionally, the candidate determining module is specifically configured to, when the first thread detects a pressing event of a key, determine a key value corresponding to the key, and send the key value to the third thread, so that the third thread obtains the corresponding candidate according to the key value.
In another aspect, an embodiment of the present invention discloses an apparatus for inputting, which includes a memory and one or more programs, where the one or more programs are stored in the memory, and when the programs are executed by the one or more processors, the steps of the foregoing method are implemented.
One or more machine-readable media having stored thereon instructions, which when executed by one or more processors, cause an apparatus to perform the foregoing methods are disclosed.
The embodiment of the invention has the following advantages:
according to the embodiment of the invention, the drawing width corresponding to the candidate item is determined according to the processing mode corresponding to the type of the candidate item; since different types can correspond to different processing modes, the drawing width corresponding to the candidate can be determined by using the processing mode matched with the type, so that the determination efficiency of the drawing width is improved. Under the condition of improving the determination efficiency of the drawing width, the drawing efficiency and the display efficiency of the candidate items can be improved.
Drawings
FIG. 1 is a schematic illustration of an environment in which an input method of an embodiment of the invention may be used;
FIG. 2 is a flow chart of the steps of an input method of an embodiment of the present invention;
FIG. 3 is a flow chart of the steps of an input method of an embodiment of the present invention;
FIG. 4 is a block diagram of an input device according to an embodiment of the present invention;
FIG. 5 is a block diagram of an apparatus 1300 for input according to an embodiment of the present invention; and
fig. 6 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention more comprehensible, the present invention is described in detail with reference to the accompanying drawings and the detailed description thereof.
The current input method program usually executes key value recognition, candidate item acquisition, candidate item display and other processing after detecting a key triggering event. The presenting of the candidate items specifically includes: the drawing width of the candidate item is calculated firstly, and then the candidate item is drawn according to the drawing width.
The inventor finds that the calculation of the drawing width in the traditional technology is long in time consumption in the process of implementing the embodiment of the invention; the situation that the drawing opportunity arrives but the drawing width is not calculated is often generated, so that the drawing efficiency and the presentation efficiency of the candidate items are low. In some cases, the problem of stuttering of the refresh of candidates may also arise.
In order to solve the technical problem of how to improve the presentation efficiency of candidate items, an embodiment of the present invention provides an input scheme, which specifically includes: determining the type of the candidate item; determining the drawing width corresponding to the candidate item according to the processing mode corresponding to the type of the candidate item; wherein, different types can correspond to different processing modes; and drawing the candidate item according to the drawing width.
According to the method and the device for processing the candidate items, the drawing width corresponding to the candidate items is determined according to the processing mode corresponding to the types of the candidate items; because different types can correspond to different processing modes, the drawing width corresponding to the candidate item can be determined by using the processing mode matched with the type, so that the determination efficiency of the drawing width is improved, and the drawing efficiency and the display efficiency of the candidate item can be improved under the condition of improving the determination efficiency of the drawing width.
The request processing method provided by the embodiment of the present invention can be applied to the application environment shown in fig. 1, as shown in fig. 1, the client 100 and the server 200 are located in a wired or wireless network, and the client 100 and the server 200 perform data interaction through the wired or wireless network.
Optionally, the client 100 may run on a terminal, which specifically includes but is not limited to: smart phones, tablet computers, e-book readers, MP3 (moving Picture Experts Group Audio Layer III) players, MP4 (moving Picture Experts Group Audio Layer IV) players, laptop portable computers, car-mounted computers, desktop computers, set-top boxes, smart televisions, wearable devices, and the like. The client 100 may correspond to a website, or APP (Application). The client 100 may correspond to an application program such as an input method APP.
The server in the embodiment of the invention can be a cloud server (cloud). The cloud is a computing service which is simple, efficient, safe, reliable and elastic in processing capacity. The resource information of the cloud end has dynamic property, so that the processing capacity of the cloud end can be elastically stretched.
The embodiment of the invention can be applied to input method programs of input modes such as keyboard symbols, handwriting, voice and the like. Taking a keyboard symbol input mode as an example, a user can input characters through a code character string, and the input string can refer to the code character string input by the user. In the field of input methods, for input method programs in, for example, chinese, japanese, korean, or other languages, an input string input by a user may be generally converted into a candidate for the corresponding language. Hereinafter, the description will be mainly given by taking Chinese as an example, and other languages such as Japanese and Korean may be referred to each other. It can be understood that the above-mentioned chinese input methods may include, but are not limited to, full pinyin, simple pinyin, strokes, five strokes, etc., and the embodiment of the present invention does not impose a limitation on a specific input method program corresponding to a certain language.
Taking the input of chinese as an example, the types of the encoding character string may include: pinyin strings, character strings (such as pencils, etc.). Taking english input as an example, the types of the encoding strings may include: alphabetic strings, and the like.
In practical applications, for the input mode of keyboard symbols, a user may input the input string through a physical keyboard, a virtual keyboard, or the like. For example, for a terminal with a touch screen, a virtual keyboard may be set in the input interface to perform input of an input string by triggering virtual keys included in the virtual keyboard. Optionally, examples of the virtual keyboard may include: a 9-key keyboard, a 26-key keyboard, etc. Moreover, it can be understood that, in addition to the virtual keys corresponding to the letters, the input interface may also be provided with symbol keys, numeric keys, and function keys such as a chinese-english switching key, or may also be provided with toolbar keys, and it can be understood that the specific keys included in the input interface are not limited in the embodiments of the present invention.
According to some embodiments, the input string may include, but is not limited to: a key symbol or a combination of a plurality of key symbols input by a user through a key. The key symbol may specifically include: pinyin, strokes, kana, etc.
In the embodiment of the invention, the candidate item can be used for representing one or more characters provided by the input method program and to be selected by the user. The candidate item can be a character of a language such as a Chinese character, an English character, a Japanese character and the like, and can also be a symbol combination in the forms of a character, an Emoji, a picture and the like. The above-mentioned characters include but are not limited to drawings composed of lines, symbols, and words, for example, examples of the above-mentioned characters may include: ": p ",": o ",": etc.
The candidates may include: local candidates, and/or cloud candidates. The local candidate may be a candidate provided by the client. In practical application, the client can search in a local word bank according to the input string to obtain a local candidate. For example, the local candidates corresponding to the input string "meilijianh" may include: "charm will", "beauty hard", "beauty" etc.
The cloud candidate may be a candidate provided by the server. The cloud candidate may be an associative candidate or a non-associative candidate that matches the input string. For example, if the input string is "meilijianh", its corresponding non-associative candidate may include "Mei Lijian hua", and the like. As another example, if the input string is "meilijianh", its corresponding association candidate may include "united states of america" or the like. It is to be understood that the embodiment of the present invention does not limit the specific cloud candidates and the specific determination manner of the cloud candidates.
Example one
Referring to fig. 2, a flowchart illustrating steps of an input method according to an embodiment of the present invention is shown, which may specifically include the following steps:
step 201, determining the type of a candidate item;
step 202, determining a drawing width corresponding to the candidate item according to a processing mode corresponding to the type of the candidate item; wherein, different types can correspond to different processing modes;
step 203, drawing the candidate item according to the drawing width.
The embodiment of the present invention may be executed by a client of an input method program, and it is understood that the specific execution subject of the method shown in fig. 2 is not limited by the embodiment of the present invention.
In step 201, the type of the candidate may be determined according to the type of the character contained in the candidate. In other words, the type of the candidate may characterize the type of the character contained by the candidate.
According to one implementation, the types of candidates may include: and presetting language types. In this case, the languages corresponding to the characters included in the candidate items are all the preset languages. The preset languages may include: chinese, japanese, korean, etc. For example, the type of the candidate "hello" is a chinese type.
According to another implementation, the types of candidates may include: and mixing types of the preset languages and the preset characters.
In a case where the preset language is the first preset language, the presetting of the character may include: and a character of a second predetermined language. For example, the first predetermined language is Chinese, the second predetermined language is English, etc.
Alternatively, the preset characters may include: symbols, such as punctuation marks, numerical symbols, and the like. Alternatively, the preset characters may include: numbers, and the like.
In step 202, the processing manner may be used to process the type of the candidate item to determine a corresponding drawing width; in other words, the processing manner may be a calculation method of the rendering width.
In practical application, a matched processing mode can be provided for the type of the candidate item so as to improve the determination speed of the drawing width.
According to an implementation manner, the processing manner corresponding to the preset language type may be: and an overall processing mode, wherein the overall processing mode can determine the drawing width by taking the characters contained in the candidate as a whole. The width information corresponding to the single characters of the preset languages is uniform. For example, the width information corresponding to the Chinese word or Japanese word or Korean word is uniform. The width information corresponding to the english characters is not uniform, for example, the width information corresponding to the english characters in upper and lower case forms is different. Alternatively, the width information corresponding to different english characters in lower case format is also different, for example, the width information of the lower case "a" is different from that of the lower case "l". Therefore, english does not fall into the category of the predetermined language.
Accordingly, the determining the drawing width corresponding to the candidate item may specifically include: and under the condition that the type of the candidate item is a preset language type, determining the drawing width corresponding to the candidate item according to the width information of the single character and the number of characters contained in the candidate item.
In a specific implementation, a first mapping relationship between a single character of a preset language and width information may be pre-stored. Further, the drawing width may be determined based on the product p of the width information w1 and the number N of characters. For example, the product p may be taken as the drawing width, or the drawing width or the like may be determined from the product p and a preset interval. The predetermined character may represent an interval I between adjacent single characters within the candidate. For example, the product of the preset interval and the number of intervals may be added on the basis of the product p to obtain the drawing width. Wherein the number of intervals may be the number of characters minus 1.
According to another implementation manner, the processing manner corresponding to the mixing type may be: the character-by-character processing mode may be to determine the drawing widths of the single characters included in the candidate items one by one.
Accordingly, the determining the drawing width corresponding to the candidate item may specifically include: determining width information corresponding to a single character contained in the candidate item under the condition that the type of the candidate item is a mixed type; and fusing the width information corresponding to all the single characters contained in the candidate items to obtain the drawing width corresponding to the candidate items.
In a specific implementation, the second mapping relationship between the single character and the width information may be stored in advance. In the second mapping relationship, the single character may be represented by a virtual key code, and examples of the virtual key code may include: unicode (Unicode). Unicode is a type of character encoding used on computers. It sets uniform and unique binary code for each character in each language to meet the requirements of cross-language and cross-platform text conversion and processing. Of course, the embodiment of the present invention does not limit the specific representation of the single character.
In practical application, the search may be performed in the second mapping relationship according to the single character included in the candidate item, so as to obtain the corresponding width information w2. Further, the width information corresponding to all the single characters contained in the candidate items may be fused, and the corresponding fusion mode may include: summing, and the like. The spacing I between adjacent single characters may also be considered in the fusion process.
In order to increase the determination speed of the drawing width, the processing of the candidates may be performed in an asynchronous thread manner. The asynchronous threads may include: a first thread and a second thread. The first thread may be configured to perform rendering of the candidate, and the second thread may be configured to determine a rendering width corresponding to the candidate. Assuming that the number of the candidate items to be presented is M (M may be a positive integer), after obtaining the rendering width corresponding to one candidate item, the second thread may send the rendering width corresponding to the candidate item to the first thread, so that the first thread performs rendering of the candidate item according to the rendering width corresponding to the candidate item. The asynchronous thread mode can be used for drawing a candidate item under the condition that the drawing width corresponding to the candidate item is obtained, and compared with the method for drawing after the drawing widths corresponding to the M candidate items are obtained, the processing efficiency of the candidate items can be improved.
In an embodiment, the determining the drawing width corresponding to the candidate item may specifically include: when the type of the candidate is a blend type, the first thread provides character information of a single character to the second line Cheng Fasong, so that the second thread determines the drawing width corresponding to the candidate according to the character information. The character information may include: virtual key code, etc.
In practical applications, the second thread may store a second mapping relationship between the single character and the width information in the cache, determine a rendering width corresponding to the candidate according to the second mapping relationship, and may also store a rendering width corresponding to one candidate in the cache. In this way, the second thread may send the cache address of the drawing width corresponding to the candidate to the first thread, so that the first thread reads the drawing width corresponding to the candidate from the cache.
Of course, in the case that the type of the candidate is the preset language type, the drawing width corresponding to one candidate may also be determined by the second thread.
In step 203, the candidate item may be drawn according to the drawing width. The rendering may be based on rendering techniques, displaying the candidate on a screen.
The embodiment of the invention determines the drawing width corresponding to the candidate item aiming at the processing mode matched with the type, thereby improving the determination efficiency of the drawing width. Under the condition of improving the determination efficiency of the drawing width, the problem of stuttering of the refreshing of the candidate items can be effectively solved, and the drawing efficiency and the display efficiency of the candidate items can be further improved.
To sum up, according to the input method of the embodiment of the present invention, the drawing width corresponding to the candidate item is determined according to the processing manner corresponding to the type of the candidate item; since different types can correspond to different processing modes, the drawing width corresponding to the candidate can be determined by using the processing mode matched with the type, so that the determination efficiency of the drawing width is improved. In the case of improving the determination efficiency of the drawing width, the drawing efficiency and the presentation efficiency of the candidates can be improved.
Example two
Referring to fig. 3, a flowchart illustrating steps of an input method according to an embodiment of the present invention is shown, which may specifically include the following steps:
step 301, the first thread determines the type of a candidate item;
step 302, if the type of the candidate item is a preset language type, the first thread determines the drawing width corresponding to the candidate item according to the width information of the single character and the number of characters contained in the candidate item;
step 303, the first thread draws the candidate item according to the drawing width;
step 304, if the type of the candidate item is a mixed type, the first thread sends character information of a single character contained in the candidate item to the second thread;
step 305, the second thread determines the width information corresponding to the single character contained in the candidate item according to the character information of the single character contained in the candidate item, and fuses the width information corresponding to all the single characters contained in the candidate item to obtain the drawing width corresponding to the candidate item;
step 306, the first thread acquires a drawing width corresponding to the candidate item from the second thread, and draws the candidate item according to the drawing width.
The embodiment of the invention determines the drawing width corresponding to the candidate item by using the processing mode matched with the type so as to improve the determination efficiency of the drawing width.
The processing mode corresponding to the preset language type may be: and an overall processing mode, wherein the overall processing mode can determine the drawing width by taking the characters contained in the candidate as a whole. The overall processing mode can rapidly determine the drawing width corresponding to the candidate item according to the width information of the single character and the number of characters contained in the candidate item, so as to improve the calculation speed of the drawing width.
The processing mode corresponding to the mixing type may be: the character-by-character processing mode may be to determine the drawing widths of the single characters included in the candidate items one by one. Since the character-by-character processing method needs to consume a certain calculation time, the processing can be performed in an asynchronous thread mode so as to improve the calculation speed of the drawing width.
EXAMPLE III
The inventor finds that the triggering operation of the key is various in general in the process of implementing the embodiment of the invention, such as short-time pressing operation, long-time pressing operation, sliding operation and the like; moreover, different trigger operations generally correspond to different response modes. For example, a short press operation corresponds to the input of a character. For another example, in the case of using a 9-key keyboard, a long-press operation is performed to select a corresponding character, for example, the candidate character corresponding to the key "2" specifically includes: A. b, C, 2, a, b, c, etc. As another example, a lateral sliding operation corresponds to movement of a cursor, and so on.
Since different triggering operations are executed for the same key, different response modes are usually caused, so as to improve the accuracy of key response, the conventional technology generally considers that the complete triggering operation of the key starts from the pressing of the key and ends with the lifting of the key. Therefore, the conventional technology processes the complete trigger operation according to the corresponding response mode after detecting the corresponding complete trigger operation of pressing and lifting the key. However, in practical applications, there is a time period from the pressing to the lifting of the key, and the time period causes a delay in the response to the trigger operation, resulting in a low key processing efficiency.
In order to solve the technical problem of how to improve the key processing efficiency, an embodiment of the present invention provides a method for obtaining candidate items, where the method specifically includes: and under the condition that a pressing event of the key is detected, determining a candidate item corresponding to the key. Specifically, the first thread determines a key value corresponding to the key when detecting a pressing event of the key, and sends the key value to the third thread; and the third thread acquires a corresponding candidate item according to the key value.
The embodiment of the invention utilizes an asynchronous thread mode to process the key-press under the condition of detecting the press event of the key-press. Typically, the duration from key press to key lift typically lasts for a certain duration, such as a duration of 70ms (milliseconds). According to the embodiment of the invention, the key processing is carried out under the condition that the pressing event of the key is detected, so that the duration corresponding to the time from the key pressing to the key lifting can be saved, and the key processing efficiency can be improved.
In addition, the embodiment of the invention utilizes an asynchronous thread mode to carry out key processing. The first thread is used for key value recognition, and the third thread is used for acquiring candidate items. The asynchronous thread mode can reduce waiting time, so that the key processing efficiency can be improved.
The key press event firstly enters the message queue of the operating system, and the operating system sends the key press event to the input method program. In particular, in the embodiment of the present invention, the first thread may receive a key-down event transmitted by the operating system.
The information corresponding to the pressing event of the key may include: virtual key codes of the keys. Examples of virtual keys may include: unicode (Unicode). Unicode is a type of character encoding used on computers. It sets uniform and unique binary code for each character in each language to meet the requirements of cross-language and cross-platform text conversion and processing.
The first thread may determine the key value corresponding to the key by using a key value recognition technology. The key value can represent the input character or function corresponding to the key.
In practical applications, there are various triggering operations of the key, such as short-press operation, long-press operation, sliding operation, etc. Wherein, different trigger operations generally correspond to different response modes. For example, a short press operation corresponds to the input of an input string. For another example, in the context of a 9-keypad, a long press operation may be performed to select a corresponding character, for example, the candidate character corresponding to the key "2" specifically includes: A. b, C, 2, a, b, c, etc. As another example, the lateral sliding operation corresponds to movement of a cursor, and so on.
The inventor finds that the input string can be obtained by short-press operation in the process of implementing the embodiment of the invention, and the input string needs to be converted into a candidate item when the input string is obtained. The input string is generally unavailable for the long press operation and the slide operation, so that the long press operation and the slide operation do not have corresponding candidates.
Therefore, the embodiment of the invention can perform key value identification on the key according to the target triggering operation corresponding to the candidate item. The target trigger operation may characterize the trigger operation that can result in the input string and that can convert the candidate. For example, the target trigger operation corresponding to the candidate may be a short press operation. It is understood that different input method programs may provide different target trigger operations, and the specific target trigger operation is not limited by the embodiment of the present invention.
In an example of the present invention, in a case of using a 9-key keyboard, a pressing event for a key "2" is detected, and assuming that key value recognition is performed on the key according to a short-press operation, a resulting key value recognition result may include: a. b, C, A, B, C, etc.
In practical application, after obtaining a key value corresponding to a key, the first thread may send the key value to the third thread, so that the third thread determines the key value corresponding to the key. The third thread may determine the input string corresponding to the key value by using a candidate item obtaining technology, and may further obtain a corresponding candidate item.
Assuming that key "2" corresponds to the first position of the input string, the determined input string may include: "a", "B", "C", "A", "B", "C", etc.; further, candidate items corresponding to the input string, such as "o", "a", "bar", and the like, may be obtained by using a thesaurus search, and the like.
Assuming that key "3" corresponds to the first position of the input string and key "2" corresponds to the second position of the input string, the determined input string may include: "da", "fa", "e", "d", "f", etc.; further, the candidate items corresponding to the input string, such as "big", "send", "hit", "answer", etc., may be obtained by utilizing a thesaurus search, etc.
It is understood that the candidate acquisition technique is known to those skilled in the art and will not be described herein.
It should be noted that, for simplicity of description, the method embodiments are described as a series of motion combinations, but those skilled in the art should understand that the present invention is not limited by the described motion sequences, because some steps may be performed in other sequences or simultaneously according to the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no moving act is required as an embodiment of the invention.
Device embodiment
Referring to fig. 4, a block diagram of an input device according to an embodiment of the present invention is shown, which may specifically include:
a type determining module 401 for determining the type of the candidate item;
a drawing width determining module 402, configured to determine a drawing width corresponding to a candidate item according to a processing manner corresponding to the type of the candidate item; wherein, different types correspond to different processing modes;
a drawing module 403, configured to draw the candidate item according to the drawing width.
Optionally, the type of the candidate item may specifically include: the language type is preset, or the mixed type of the preset language and the preset character is preset.
Optionally, the drawing width determining module 402 may specifically include:
and the overall width determining module is used for determining the drawing width corresponding to the candidate item according to the width information of the single character and the number of characters contained in the candidate item under the condition that the type of the candidate item is a preset language type.
Optionally, the drawing width determining module 402 may specifically include:
the single character width determining module is used for determining the width information corresponding to the single characters contained in the candidate items under the condition that the types of the candidate items are mixed types;
and the fusion module is used for fusing the width information corresponding to all the single characters contained in the candidate item to obtain the drawing width corresponding to the candidate item.
Optionally, the drawing width determining module 402 may specifically include:
and the asynchronous determining module is used for sending character information of the single character contained in the candidate item to a second thread by a first thread under the condition that the type of the candidate item is a mixed type, so that the second thread determines the drawing width corresponding to the candidate item according to the character information.
Optionally, the apparatus may further include:
and the candidate determining module is used for determining the candidate corresponding to the key under the condition that the pressing event of the key is detected.
Optionally, the candidate determining module is specifically configured to determine, by the first thread, a key value corresponding to the key when a key press event is detected, and send the key value to the third thread, so that the third thread obtains the corresponding candidate according to the key value.
For the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The embodiments in the present specification are all described in a progressive manner, and each embodiment focuses on differences from other embodiments, and portions that are the same and similar between the embodiments may be referred to each other.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 5 is a block diagram illustrating an apparatus 1300 for input according to an example embodiment. For example, the apparatus 1300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and so forth.
Referring to fig. 5, apparatus 1300 may include one or more of the following components: a processing component 1302, a memory 1304, a power component 1306, a multimedia component 1308, an audio component 1310, an input/output (I/O) interface 1312, a sensor component 1314, and a communication component 1316.
The processing component 1302 generally controls the overall operation of the device 1300, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing element 1302 may include one or more processors 1320 to execute instructions to perform all or part of the steps of the methods described above. Further, processing component 1302 can include one or more modules that facilitate interaction between processing component 1302 and other components. For example, the processing component 1302 may include a multimedia module to facilitate interaction between the multimedia component 1308 and the processing component 1302.
The memory 1304 is configured to store various types of data to support operation at the device 1300. Examples of such data include instructions for any application or method operating on device 1300, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1304 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply component 1306 provides power to the various components of device 1300. The power components 1306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 1300.
The multimedia component 1308 includes a screen between the device 1300 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide motion action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1308 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 1300 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1310 is configured to output and/or input audio signals. For example, the audio component 1310 includes a Microphone (MIC) configured to receive an external audio signal when the apparatus 1300 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1304 or transmitted via the communication component 1316. In some embodiments, the audio component 1310 also includes a speaker for outputting audio signals.
The I/O interface 1312 provides an interface between the processing component 1302 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1314 includes one or more sensors for providing various aspects of state assessment for the device 1300. For example, the sensor assembly 1314 may detect an open/closed state of the device 1300, the relative positioning of components, such as a display and keypad of the apparatus 1300, the sensor assembly 1314 may also detect a change in position of the apparatus 1300 or a component of the apparatus 1300, the presence or absence of user contact with the apparatus 1300, orientation or acceleration/deceleration of the apparatus 1300, and a change in temperature of the apparatus 1300. The sensor assembly 1314 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1314 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1316 is configured to facilitate communications between the apparatus 1300 and other devices in a wired or wireless manner. The apparatus 1300 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication section 1316 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1316 also includes a Near Field Communications (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 1300 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 1304 comprising instructions, executable by the processor 1320 of the apparatus 1300 to perform the method described above is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium in which instructions, when executed by a processor of a terminal, enable the terminal to perform an input method, the method comprising: . Determining the type of the candidate item; determining the drawing width corresponding to the candidate item according to the processing mode corresponding to the type of the candidate item; wherein, different types correspond to different processing modes; drawing the candidate items according to the drawing width
Fig. 6 is a schematic structural diagram of a server in some embodiments of the invention. The server 1900, which may vary widely in configuration or performance, may include one or more Central Processing Units (CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) that store applications 1942 or data 1944. Memory 1932 and storage medium 1930 can be, among other things, transient or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a sequence of instructions operating on a server. Further, a central processor 1922 may be arranged to communicate with the storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input/output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, and so forth.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is only limited by the appended claims
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
The above detailed description is provided for an input method, an input device, a device for inputting and a machine readable medium, which are provided by the embodiments of the present invention, and the detailed examples are applied herein to illustrate the principles and embodiments of the present invention, and the above descriptions of the embodiments are only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (15)

1. An input method, comprising:
determining the type of the candidate item;
determining the drawing width corresponding to the candidate item according to the processing mode corresponding to the type of the candidate item; wherein, different types correspond to different processing modes;
and drawing the candidate items according to the drawing width.
2. The method of claim 1, wherein the type of candidate item comprises: the language type is preset, or the mixed type of the preset language and the preset character is preset.
3. The method of claim 1, wherein the determining a drawing width corresponding to a candidate comprises:
and under the condition that the type of the candidate item is a preset language type, determining the drawing width corresponding to the candidate item according to the width information of the single character and the number of characters contained in the candidate item.
4. The method of claim 1, wherein the determining a drawing width corresponding to a candidate comprises:
determining width information corresponding to a single character contained in a candidate item under the condition that the type of the candidate item is a mixed type;
and fusing width information corresponding to all the single characters contained in the candidate items to obtain drawing widths corresponding to the candidate items.
5. The method of claim 1, wherein the determining a drawing width corresponding to a candidate comprises:
when the type of the candidate is a blend type, the first thread provides character information of a single character to the second line Cheng Fasong, so that the second thread determines the drawing width corresponding to the candidate according to the character information.
6. The method according to any one of claims 1 to 5, further comprising:
and under the condition that a pressing event of the key is detected, determining a candidate item corresponding to the key.
7. The method of claim 6, wherein said determining a candidate for said key press comprises:
the first thread determines a key value corresponding to the key under the condition that a pressing event of the key is detected, and the key value is described to a third thread Cheng Fasong, so that the third thread can obtain a corresponding candidate item according to the key value.
8. An input device, comprising:
the type determining module is used for determining the types of the candidate items;
the drawing width determining module is used for determining the drawing width corresponding to the candidate item according to the processing mode corresponding to the type of the candidate item; wherein, different types correspond to different processing modes; and
and the drawing module is used for drawing the candidate items according to the drawing width.
9. The apparatus of claim 8, wherein the type of candidate item comprises: the language type is preset, or the mixed type of the preset language and the preset character is preset.
10. The apparatus of claim 8, wherein the rendering width determination module comprises:
and the overall width determining module is used for determining the drawing width corresponding to the candidate item according to the width information of the single character and the number of characters contained in the candidate item under the condition that the type of the candidate item is a preset language type.
11. The apparatus of claim 8, wherein the rendering width determination module comprises:
the single character width determining module is used for determining the width information corresponding to the single character contained in the candidate item under the condition that the type of the candidate item is a mixed type;
and the fusion module is used for fusing the width information corresponding to all the single characters contained in the candidate items to obtain the drawing width corresponding to the candidate items.
12. The apparatus of claim 8, wherein the rendering width determination module comprises:
the asynchronous determining module is used for enabling the first thread to determine the drawing width corresponding to the candidate item from character information of a single character contained in the candidate item to a second line Cheng Fasong under the condition that the type of the candidate item is a mixed type.
13. The apparatus of any of claims 8 to 12, further comprising:
and the candidate item determining module is used for determining a candidate item corresponding to the key under the condition that a pressing event of the key is detected.
14. An apparatus for input, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and wherein the one or more programs, when executed by the one or more processors, perform the steps of the method of any of claims 1 to 7.
15. One or more machine readable media having instructions stored thereon that, when executed by one or more processors, cause an apparatus to perform the method of any of claims 1-7.
CN202111199223.1A 2021-10-14 2021-10-14 Input method, device and medium Pending CN115981486A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111199223.1A CN115981486A (en) 2021-10-14 2021-10-14 Input method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111199223.1A CN115981486A (en) 2021-10-14 2021-10-14 Input method, device and medium

Publications (1)

Publication Number Publication Date
CN115981486A true CN115981486A (en) 2023-04-18

Family

ID=85958638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111199223.1A Pending CN115981486A (en) 2021-10-14 2021-10-14 Input method, device and medium

Country Status (1)

Country Link
CN (1) CN115981486A (en)

Similar Documents

Publication Publication Date Title
USRE46139E1 (en) Language input interface on a device
CN101593080B (en) Identification of candidate characters for text input
CN107688399B (en) Input method and device and input device
CN107918496B (en) Input error correction method and device for input error correction
US10241670B2 (en) Character entry apparatus and associated methods
CN107665046B (en) Input method and device and input device
CN107132927B (en) Input character recognition method and device for recognizing input characters
CN109783244B (en) Processing method and device for processing
CN108536653B (en) Input method, input device and input device
CN110795014B (en) Data processing method and device and data processing device
CN109542244B (en) Input method, device and medium
CN115981486A (en) Input method, device and medium
CN113407099A (en) Input method, device and machine readable medium
CN115981485A (en) Key processing method, device and medium
CN112764551A (en) Vocabulary display method and device and electronic equipment
CN108227952B (en) Method and system for generating custom word and device for generating custom word
CN107977089B (en) Input method and device and input device
CN112068793A (en) Voice input method and device
CN111258691B (en) Input method interface processing method, device and medium
CN110633017A (en) Input method, input device and input device
CN110716653B (en) Method and device for determining association source
CN109388328B (en) Input method, device and medium
CN112214154B (en) Interface processing method and device and interface processing device
CN113407039A (en) Input method, device and machine readable medium
CN110244861B (en) Data processing 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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40084271

Country of ref document: HK