docs: def analyze_text( self, text, **kwargs ):
          ''' 
          Analyzes given Text for noun phrase chunks. 
  
           As result of analysis, a layer NOUN_CHUNKS will be attached to the input
          Text object, containing a noun phrases detected from the Text;
          
           Note: for preprocessing the Text, MaltParser is used by default. In order 
          to obtain a decent performance with MaltParser, it is advisable to analyse 
          texts at their full extent with this method. Splitting a text into smaller 
          chunks, such as clauses or sentences, and analysing one-small-chunk-at-time 
          may be rather demanding in terms of performance, because a file-based 
          preprocessing is used for obtaining the dependency relations.
  
          Parameters
          ----------
          text:  estnltk.text.Text
              The input text that should be analysed for noun phrases; 
  
          force_parsing : bool 
              If True, uses the *self.parser* to parse the given *text*, and overrides
              the syntactic annotations in *text* with the new layer obtained from the 
              parser;
              (default: False)
          
          syntax_layer : str
              Specifies which layer of syntactic annotations should be used as a
              basis for NP chunking; If the *syntax_layer* exists within the *text*
              (and force_parsing==False), uses the syntactic annotations from 
              *text[syntax_layer]*;
              (default: LAYER_CONLL)
  
          cutPhrases: bool
              If True, all phrases exceeding the cutMaxThreshold will be 
              cut into single word phrases, consisting only of part-of-speech 
              categories 'S', 'Y', 'H';
              (default: True)
  
          cutMaxThreshold: int
              Threshold indicating the maximum number of words allowed in a 
              phrase.
              If cutPhrases is set, all phrases exceeding the threshold will be 
              cut into single word phrases, consisting only of part-of-speech 
              categories 'S', 'Y', 'H';
              Automatic analysis of the Balanced Corpus of Estonian suggests 
              that 97% of all NP chunks are likely chunks of length 1-3, thus 
              the default threshold is set to 3;
              (default value: 3)
          
          return_type: string
              If return_type=="text" (Default), 
                  returns the input Text object;
              If return_type=="labels", 
                  returns a list of NP labels (strings), containing a label for 
                  each word token in Text, indicating whether the word is at the 
                  beginning of a phrase ('B'), inside a phrase ('I') or does 
                  not belong to any phrase ('O').
              If return_type=="tokens", 
                  returns a list of phrases, where each phrase is a list of
                  tokens, and each token is a dictionary representing word;
              If return_type=="strings", 
                  returns a list of text strings, where each string is phrase's 
                  text;
              Regardless the return type, a layer named NOUN_CHUNKS will be added 
              to the input Text containing noun phrase annotations;
          
          '''
          # 0) Parse given arguments
          #
          # Output specifics
          all_return_types = ["text", "labels", "tokens", "strings"]
          return_type     = all_return_types[0]
          cutPhrases      = True
          cutMaxThreshold = 3
          annotate_text   = True
          # Syntax layer & Parsing specifics
          syntax_layer_name = LAYER_CONLL
          force_parsing     = False
          for argName, argVal in kwargs.items():
              if argName == 'cutPhrases':
                  cutPhrases = bool(argVal)
              elif argName == 'force_parsing':
                  force_parsing = bool(argVal)
              elif argName == 'syntax_layer':
                  syntax_layer_name = argVal
              elif argName == 'cutMaxThreshold':
                  cutMaxThreshold = int(argVal)
              elif argName == 'return_type':
                  if argVal.lower() in all_return_types:
                      return_type = argVal.lower()
                  else:
                      raise Exception(' Unexpected return type: ', argVal)
              else:
                  raise Exception(' Unsupported argument given: '+argName)
  
          #
          # 1) Acquire the layers of morphological & syntactic annotations:
          #
          if not syntax_layer_name in text or force_parsing:
              # No existing layer found: produce a new layer with the parser
              self.parser.parse_text( text )
              if isinstance(self.parser, MaltParser):
                  syntax_layer_name = LAYER_CONLL
              elif isinstance(self.parser, VISLCG3Parser):
                  syntax_layer_name = LAYER_VISLCG3
              else:
                  raise Exception(' (!) Unknown type of syntactic parser: ',self.parser)
  
          if not text.is_tagged(ANALYSIS):
              # If missing, add the layer of morphological analyses
              text = text.tag_analysis()
  
          # 2) Process text sentence by sentence
          all_np_labels = []
          for sentence_text in text.split_by( SENTENCES ):
              tokens       = sentence_text[WORDS]
              syntax_layer = sentence_text[syntax_layer_name]
              # Find phrases
              np_labels = self._find_phrases( tokens, syntax_layer, cutPhrases, cutMaxThreshold )
              # Normalize labels
              np_labels = [ 'O' if not l in ['B', 'I'] else l for l in np_labels ]
              # Collect results
              all_np_labels.extend( np_labels )
  
          # 3) Return input text, labels, phrases or phrase texts
          if annotate_text:
              self.annotateText( text, NOUN_CHUNKS, all_np_labels )
          if return_type == "text":
              return text
          elif return_type == "labels":
              return all_np_labels
          elif return_type == "tokens":
              return self.get_phrases(text, all_np_labels)
          else:
              return self.get_phrase_texts(text, all_np_labels)