This paper highlights the interest of a language model in increasing the performances of on-line handwriting recognition systems. Models based on statistical approaches, trained on written corpora, have been investigated. Two kinds of models have been studied: ngram models and n-class models. In the latter case, the classes result either from a syntactic criteria or a contextual criteria. In order to integrate it into small capacity systems (mobile device), an n-class model has been designed by combining these criteria. It outperforms bulkier models based on n-gram. Integration into an online handwriting recognition system demonstrates a substantial performance improvement due to the language model.