20. A non-transitory computer readable medium on which is stored machine readable instructions that when executed by a processor implement a method of identifying one or more languages for a document, the languages being selected from a set of candidate languages, the machine readable instructions comprising code to: for each language (M) in the set of candidate languages, define a set of non overlapping languages (N(M)), the set N(M) consisting of one or more languages (L), wherein each language L in the set N(M) does not overlap with the language M; obtain n-gram data for a target document; for each language M in the set of candidate languages, use the n-gram data to determine a final score S F (M) based on relative probabilities of a first hypothesis that the target document is entirely in the language M and a second hypothesis that one portion of the target document is in the language M while another portion of the target document is in a language L selected from the set N(M); identify one or more of the candidate languages as being languages of the document based on the final scores S F (M) for different languages M; and store information indicating the one or more languages of the document.
21. The non-transitory computer readable medium of claim 20 , wherein each language L in the set N(M) for the language M has no characters in common with the language M.