What is language detection?
Language detection is the automatic recognition of the language a text is written in, such as English, Spanish or Japanese. For a PDF, a tool reads the text of the pages and compares it with statistical profiles of many languages: which letters, combinations and short words appear most often. The result is the most likely language, sometimes with a level of confidence or a list of languages when a document mixes several.
Why it needs real text
Detection works on characters, so the PDF must contain selectable text. In a scanned document each page is only an image, and there are no characters to read. Run text recognition first: it adds a text layer, after which the language can be detected. Very short texts, lists of names or numbers, and pages full of tables give less reliable results, because there are few words to compare.
Where it helps
Knowing the language of a file helps to sort large collections of documents, send each one to the right reader or translator, pick the right dictionary for text recognition, and check that a document delivered for one market is not in another language by mistake. Archives and search systems also store the language so that searches and screen readers work properly.
Language of the text and of the file
A PDF can also declare its language in its internal settings, which screen readers use to choose the pronunciation. That declaration is set by the program that created the file and may be missing or wrong. Detection looks at the actual words, so the two can differ.
Tools that use this
Guides that put it into practice
Common questions
- Can it detect the language of a scanned PDF?
- Only after text recognition. A scan holds pictures of pages; recognition turns them into text that can be analysed.
- What about documents in several languages?
- Detection reports the main language and may list others it finds. For mixed documents, check sections separately if the detail matters.
- Does the detected language change the file?
- No. Detection only reads the text and reports the result; the PDF is not modified.