A system for inputting text into an electronic device and for inferring a term boundary in an input sequence, the system comprising: a candidate generator configured to: generate one or more candidates from the input sequence consisting of a contiguous sequence of characters, wherein each candidate comprises two or more terms separated by one or more term boundaries, wherein the candidate generator is configured to generate the one or more candidates from the input sequence by converting the input sequence into a probabilistic constrained sequence graph comprising one or more paths, wherein the one or more paths correspond to the one or more candidates, wherein the probabilistic constrained sequence graph is a variant of a directed acyclic graph comprising a collection of nodes and directed edges, each edge connecting one node to another, wherein in the probabilistic constrained sequence graph each character of each set of characters is assigned a node, the incoming edge for each node corresponding to the probability for the associated character; assign a first probability estimate to each candidate by: searching for one or more terms of that candidate in a context language model, wherein the context language model comprises sequences of terms, each sequence of terms having a corresponding probability of occurring, and assigning the probability corresponding to the one or more terms of that candidate from the context language model to the candidate; generate a second probability estimate for each candidate by determining the cumulative probability of the path through the probabilistic constrained sequence graph that represents that candidate; combine first and second probability estimates for each candidate to obtain a combined probability for each candidate; and discard one or more candidates on the basis of the combined probabilities for the candidates. generate one or more candidates from the input sequence consisting of a contiguous sequence of characters, wherein each candidate comprises two or more terms separated by one or more term boundaries, wherein the candidate generator is configured to generate the one or more candidates from the input sequence by converting the input sequence into a probabilistic constrained sequence graph comprising one or more paths, wherein the one or more paths correspond to the one or more candidates, wherein the probabilistic constrained sequence graph is a variant of a directed acyclic graph comprising a collection of nodes and directed edges, each edge connecting one node to another, wherein in the probabilistic constrained sequence graph each character of each set of characters is assigned a node, the incoming edge for each node corresponding to the probability for the associated character; assign a first probability estimate to each candidate by: searching for one or more terms of that candidate in a context language model, wherein the context language model comprises sequences of terms, each sequence of terms having a corresponding probability of occurring, and assigning the probability corresponding to the one or more terms of that candidate from the context language model to the candidate; searching for one or more terms of that candidate in a context language model, wherein the context language model comprises sequences of terms, each sequence of terms having a corresponding probability of occurring, and assigning the probability corresponding to the one or more terms of that candidate from the context language model to the candidate; generate a second probability estimate for each candidate by determining the cumulative probability of the path through the probabilistic constrained sequence graph that represents that candidate; combine first and second probability estimates for each candidate to obtain a combined probability for each candidate; and discard one or more candidates on the basis of the combined probabilities for the candidates.