class_docstr: Classify the language of documents and add the detected language to their metadata.
  A MetadataRouter can then route them onto different output connections depending on their language.
  This is useful to route documents to different models in a pipeline depending on their language.
  The set of supported languages can be specified.
  For routing plain text using the same logic, use the related TextLanguageRouter component instead.
  
  Example usage within an indexing pipeline, storing in a Document Store
  only documents written in English:
  
  ```python
  document_store = InMemoryDocumentStore()
  p = Pipeline()
  p.add_component(instance=TextFileToDocument(), name="text_file_converter")
  p.add_component(instance=DocumentLanguageClassifier(), name="language_classifier")
  p.add_component(instance=MetadataRouter(rules={"en": {"language": {"$eq": "en"}}}), name="router")
  p.add_component(instance=DocumentWriter(document_store=document_store), name="writer")
  p.connect("text_file_converter.documents", "language_classifier.documents")
  p.connect("language_classifier.documents", "router.documents")
  p.connect("router.en", "writer.documents")
  ```
docstr: :param languages: A list of languages in ISO code, each corresponding to a different output connection
      (see [langdetect` documentation](https://github.com/Mimino666/langdetect#languages)).
      By default, only ["en"] is supported and Documents of any other language are routed to "unmatched".
docstr_tok: [":","param","languages",":","A","list","of","languages","in","ISO","code",",","each","corresponding","to","a","different","output","connection","(","see","[","langdetect","`","documentation","]","(","https",":","\/\/github.com\/Mimino666\/langdetect","#","languages",")",")",".","By","default",",","only","[","``","en","''","]","is","supported","and","Documents","of","any","other","language","are","routed","to","``","unmatched","''","."]
code: def __init__(self, languages: Optional[List[str]] = None):
      """
      :param languages: A list of languages in ISO code, each corresponding to a different output connection
          (see [langdetect` documentation](https://github.com/Mimino666/langdetect#languages)).
          By default, only ["en"] is supported and Documents of any other language are routed to "unmatched".
      """
      langdetect_import.check()
      if not languages:
          languages = ["en"]
      self.languages = languages
  
imports: import logging
  from typing import List, Dict, Optional
  from haystack import component, Document
  from haystack.lazy_imports import LazyImport
label_desc: Use image node_id 1 to create a new DocumentLanguageClassifier object  with example: obj = DocumentLanguageClassifier(languages)