LanguageDetector: expectedInputLanguages property
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The expectedInputLanguages
read-only property of the LanguageDetector
interface returns the expected languages to be detected in the input text.
A LanguageDetector
instance's expectedInputLanguages
are set when creating it via a create()
call.
Value
An array of strings specifying the expected input languages. These will be valid BCP 47 language tags (as specified in RFC 5646).
Examples
js
const detector = await LanguageDetector.create({
expectedInputLanguages: ["en-US", "zh"],
});
// Logs ["en-US", "zh"]
console.log(detector.expectedInputLanguages);
Specifications
No specification found
No specification data found for api.LanguageDetector.expectedInputLanguages
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.