class_docstr: Reader for the Alpino Dutch Treebank.
  This corpus has a lexical breakdown structure embedded, as read by `_parse`
  Unfortunately this puts punctuation and some other words out of the sentence
  order in the xml element tree. This is no good for `tag_` and `word_`
  `_tag` and `_word` will be overridden to use a non-default new parameter 'ordered'
  to the overridden _normalize function. The _parse function can then remain
  untouched.
docstr: Normalize the xml sentence element in t.
  The sentence elements <alpino_ds>, although embedded in a few overall
  xml elements, are separated by blank lines. That's how the reader can
  deliver them one at a time.
  Each sentence has a few category subnodes that are of no use to us.
  The remaining word nodes may or may not appear in the proper order.
  Each word node has attributes, among which:
  - begin : the position of the word in the sentence
  - pos   : Part of Speech: the Tag
  - word  : the actual word
  The return value is a string with all xml elementes replaced by
  clauses: either a cat clause with nested clauses, or a word clause.
  The order of the bracket clauses closely follows the xml.
  If ordered == True, the word clauses include an order sequence number.
  If ordered == False, the word clauses only have pos and word parts.
docstr_tok: ["Normalize","the","xml","sentence","element","in","t.","The","sentence","elements","<","alpino_ds",">",",","although","embedded","in","a","few","overall","xml","elements",",","are","separated","by","blank","lines",".","That","'s","how","the","reader","can","deliver","them","one","at","a","time",".","Each","sentence","has","a","few","category","subnodes","that","are","of","no","use","to","us",".","The","remaining","word","nodes","may","or","may","not","appear","in","the","proper","order",".","Each","word","node","has","attributes",",","among","which",":","-","begin",":","the","position","of","the","word","in","the","sentence","-","pos",":","Part","of","Speech",":","the","Tag","-","word",":","the","actual","word","The","return","value","is","a","string","with","all","xml","elementes","replaced","by","clauses",":","either","a","cat","clause","with","nested","clauses",",","or","a","word","clause",".","The","order","of","the","bracket","clauses","closely","follows","the","xml",".","If","ordered","==","True",",","the","word","clauses","include","an","order","sequence","number",".","If","ordered","==","False",",","the","word","clauses","only","have","pos","and","word","parts","."]
code: def _normalize(self, t, ordered=False):
      """Normalize the xml sentence element in t.
      The sentence elements <alpino_ds>, although embedded in a few overall
      xml elements, are separated by blank lines. That's how the reader can
      deliver them one at a time.
      Each sentence has a few category subnodes that are of no use to us.
      The remaining word nodes may or may not appear in the proper order.
      Each word node has attributes, among which:
      - begin : the position of the word in the sentence
      - pos   : Part of Speech: the Tag
      - word  : the actual word
      The return value is a string with all xml elementes replaced by
      clauses: either a cat clause with nested clauses, or a word clause.
      The order of the bracket clauses closely follows the xml.
      If ordered == True, the word clauses include an order sequence number.
      If ordered == False, the word clauses only have pos and word parts.
      """
      if t[:10] != "<alpino_ds":
          return ""
      # convert XML to sexpr notation
      t = re.sub(r'  <node .*? cat="(\w+)".*>', r"(\1", t)
      if ordered:
          t = re.sub(
              r'  <node. *?begin="(\d+)".*? pos="(\w+)".*? word="([^"]+)".*?/>',
              r"(\1 \2 \3)",
              t,
          )
      else:
          t = re.sub(
              r'  <node .*?pos="(\w+)".*? word="([^"]+)".*?/>',
              r"(\1 \2)",
              t,
          )
      t = re.sub(r"  </node>", r")", t)
      t = re.sub(r"<sentence>.*</sentence>", r"", t)
      t = re.sub(r"</?alpino_ds.*>", r"", t)
      return t
  
imports: import sys
  from nltk.corpus.reader.api import *
  from nltk.corpus.reader.util import *
  from nltk.tag import map_tag
  from nltk.tree import Tree
label_desc: Use image node_id 2 for calling the AlpinoCorpusReader obj's underlying member method code with example usage: obj._normalize(t, ordered) and returns: t, str