docs: def loadCONLLannotations( in_file, addDepRels = False, splitIntoSentences = True ):
      ''' Loads syntactically annotated text from CONLL format input file and 
          returns as an array of tokens, where each token is represented as 
          an array in the format:
             [sentenceID, wordID, tokenString, morphInfo, selfID, parentID]
          If addDepRels == True, then the dependency relation label is also extracted
          and added to the end of the array:
             [sentenceID, wordID, tokenString, morphInfo, selfID, parentID, depRel]
          If splitIntoSentences == True, the array of tokens is further divided
          into subarrays representing sentences.
          
           Example input:
          2	Monstrumteleskoobid	Monstrum_tele_skoop	S	S	prop|pl|nom	0	ROOT	_	_
          3	(	(	Z	Z	Opr	4	xxx	_	_
          4	mosaiik-	mosaiik	A	A	pos|sg|nom	2	@<AN	_	_
          5	ja	ja	J	J	crd	6	@J	_	_
          6	mitmepeeglilised	mitme_peegli=line	A	A	pos|pl|nom	4	@<NN	_	_
          7	)	)	Z	Z	Cpr	6	xxx	_	_
          8	.	.	Z	Z	Fst	7	xxx	_	_
          
      '''
      sentenceCount   = 0
      wordCountInSent = 0
      tokens = []
      in_f = codecs.open(in_file, mode='r', encoding='utf-8')
      for line in in_f:
          line = line.rstrip()
          if len(line) == 0 or re.match('^\s+$', line):
              sentenceCount += 1
              wordCountInSent = 0
              continue
          features = line.split('\t')
          if len(features) != 10:
              raise Exception(' In file '+in_file+', line with unexpected format: "'+line+'" ')
          selfLabel   = features[0]
          token       = features[1]
          lemma       = features[2]
          cpos        = features[3]
          pos         = features[4]
          form        = features[5]
          parentLabel = features[6]
          tokens.append( [ str(sentenceCount), str(wordCountInSent), \
                           token, lemma+" "+pos+" "+form, selfLabel, parentLabel ] )
          if addDepRels:
              tokens[-1].append( features[7] )
          wordCountInSent += 1
      in_f.close()
      if not splitIntoSentences:
          return tokens
      else:
          sentences = []
          lastSentID = ''
          for tok in tokens:
              if tok[0] != lastSentID:
                  sentences.append([])
              sentences[-1].append(tok)
              lastSentID = tok[0]
          return sentences