A computer-implemented method for inputting text into an electronic device has a virtual keyboard having keys displayed on a display screen and one or more characters are associated with each key. An input pattern is generated by a user and the keys positioned on or proximal to the input pattern are identified. The keys are allocated to pre-defined groups, such that each group comprises a plurality of said keys. The input pattern is encoded depending on the pre-defined groups in which each of said one or more identified keys are arranged. A candidate word or words is identified to be input into the electronic device based on the encoded input pattern. Computer- implemented methods identify candidate words based on the correlation between input and candidate string lengths; and/or upper/lower input length thresholds; and/or the identification of valid/invalid string combinations. A corresponding system, such as a computational apparatus, implements the methods.