code: def addRule(self, field, regExpPattern):
          '''Adds new rule for checking whether a value of the field matches given regular 
             expression regExpPattern;
          
             Parameters
             ----------
             field: str
                  keyword, e.g. 'partofspeech', 'root', 'text' etc
             regExpPattern: str
                  a regular expression that the value of the field must match (using method 
                  re.match( regExpPattern, token[field]) ).
          '''
          compiled = re.compile( regExpPattern )
          if field in self.analysisFields:
              if self.analysisRules == None:
                  self.analysisRules = dict()
              self.analysisRules[field] = compiled
          else:
              if self.otherRules == None:
                  self.otherRules = dict()
              self.otherRules[field] = compilef addRule(self, field, regExpPattern):
          '''Adds new rule for checking whether a value of the field matches given regular 
             expression regExpPattern;
          
             Parameters
             ----------
             field: str
                  keyword, e.g. 'partofspeech', 'root', 'text' etc
             regExpPattern: str
                  a regular expression that the value of the field must match (using method 
                  re.match( regExpPattern, token[field]) ).
          '''
          compiled = re.compile( regExpPattern )
          if field in self.analysisFields:
              if self.analysisRules == None:
                  self.analysisRules = dict()
              self.analysisRules[field] = compiled
          else:
              if self.otherRules == None:
                  self.otherRules = dict()
              self.otherRules[field] = compiled
docs: Adds new rule for checking whether a value of the field matches given regular 
             expression regExpPattern;
          
             Parameters
             ----------
             field: str
                  keyword, e.g. 'partofspeech', 'root', 'text' etc
             regExpPattern: str
                  a regular expression that the value of the field must match (using method 
                  re.match( regExpPattern, token[field]) ).