14. A non-transitory computer-readable medium storing instructions, the instructions comprising: a plurality of instructions which, when executed by a device, cause the device to: receive information identifying a location, on a virtual keyboard of the device, selected by a user and a character, on the virtual keyboard of the device, corresponding to the location; form a plurality of prefixes including a prefix formed based on the character and prefixes formed based on characters, on the virtual keyboard, in proximity to the character; calculate a distance factor for each of the plurality of prefixes, the distance factor, for each of the plurality of prefixes, being calculated as a difference between: a distance between the location and a key, of the virtual keyboard, corresponding to a respective character of the characters, and a key width corresponding to a distance between a key corresponding to the character and the key corresponding to the respective character; generate candidate words from the plurality of prefixes; calculate a rank of each of the candidate words, the rank of each of the candidate words being calculated based on: the distance factor determined for a respective prefix of the plurality of prefixes, and a frequency of occurrence of the candidate word; and display one or more of the ranked candidate words, where the one or more of the candidate words being displayed based on the rank of each of the candidate words.
15. The non-transitory computer-readable medium of claim 14 , the instructions further comprising: one or more instructions to receive a selection, from the user, of a candidate word of the one or more of the ranked candidate words; and one or more instructions to use the selected candidate word in an application run by the portable device.