1. A method comprising: receiving, from an input component of a portable device that includes a virtual keyboard, a location on the portable device selected by a user and an input character corresponding to the location; forming, by the portable device, a plurality of prefixes including a prefix formed based on the input character and prefixes formed based on characters in proximity to the input character; determining, by the portable device, a distance factor for each of the plurality of prefixes, the distance factors being based on a distance between the location on the portable device selected by the user and characters on the virtual keyboard in proximity to the location; generating, by the portable device, candidate words from the plurality of prefixes; determining a rank value associated with each of the candidate words, the rank values being determined based on the distance factors; and displaying, by the portable device to the user of the portable device, a subset of the generated candidate words, where the subset is determined based on the rank values associated with the candidate words.