class_docstr: Parse BCP-47 composite language tags
  
  Supports all the main subtags, and the 'u-sd' extension:
  
  >>> from nltk.corpus import bcp47
  >>> bcp47.name('oc-gascon-u-sd-fr64')
  'Occitan (post 1500): Gascon: Pyrénées-Atlantiques'
  
  Can load a conversion table to Wikidata Q-codes:
  >>> bcp47.load_wiki_q()
  >>> bcp47.wiki_q['en-GI-spanglis']
  'Q79388'
docstr: Convert a BCP-47 tag to a colon-separated string of subtag names
  
  >>> from nltk.corpus import bcp47
  >>> bcp47.name('ca-Latn-ES-valencia')
  'Catalan: Latin: Spain: Valencian'
docstr_tok: ["Convert","a","BCP-47","tag","to","a","colon-separated","string","of","subtag","names",">",">",">","from","nltk.corpus","import","bcp47",">",">",">","bcp47.name","(","'ca-Latn-ES-valencia","'",")","'Catalan",":","Latin",":","Spain",":","Valencian","'"]
code: def name(self, tag):
      """
      Convert a BCP-47 tag to a colon-separated string of subtag names
  
      >>> from nltk.corpus import bcp47
      >>> bcp47.name('ca-Latn-ES-valencia')
      'Catalan: Latin: Spain: Valencian'
  
      """
      for label in ["redundant", "grandfathered"]:
          val = None
          if tag in self.db[label]:
              val = f"{self.db[label][tag]['Description']}"
              note = f"The {tag!r} code is {label}"
          elif tag in self.db["deprecated"][label]:
              val = (
                  f"{self.db['deprecated'][label][tag]['Description']}"
              )
              note = f"The {tag!r} code is {label} and deprecated"
              if "Preferred-Value" in self.db["deprecated"][label][tag]:
                  prefer = self.db["deprecated"][label][tag][
                      "Preferred-Value"
                  ]
                  note += f", prefer {self.val2str(prefer)!r}"
          if val:
              warn(note)
              return val
      try:
          return self.lang2str(self.parse_tag(tag))
      except:
          warn(f"Tag {tag!r} was not recognized")
          return None
  
file_path: nltk/nltk/corpus/reader/bcp47.py
imports: import re
  from warnings import warn
  from xml.etree import ElementTree
  from nltk.corpus.reader import CorpusReader
label_desc: Use image node_id 10 for calling the BCP47CorpusReader obj's underlying member method code with example usage: obj.name(tag) and returns: self, val, None