/*
Only substantive, names, verbs and adjectives are checked
355367
protected boolean isTokenToCheck(AnalyzedTokenReadings token) {
    return (token.matchesPosTagRegex("(SUB|EIG|VER|ADJ):.*") 
        && !token.matchesPosTagRegex("(PRO|A(RT|DV)|VER:(AUX|MOD)):.*")
        && !StringUtils.equalsAny(token.getToken(), "sicher", "weit", "Sie", "Ich"))
        || isUnknownWord(token);
  }
9951
function() {
        var name_parts = [],
            proto_ref  = this.reflector.getProto()[this.name],
            name       = '',
            body       = '';

        if (this.meta.is_abstract) { name_parts.push('abstract'); }
        if (this.meta.is_final) { name_parts.push('final'); }

        name_parts.push(this.meta.visibility);
        
        if (this.meta.is_static) { name_parts.push('static'); }

        if (this.meta.is_nullable) { name_parts.push('nullable'); }
        if (this.meta.is_read_only) { name_parts.push('read'); }

        // If type === null, attempt to detect it by the predefined value.
        if (this.meta.type === null) {
            if (proto_ref === null) {
                name_parts.push('mixed');
            } else {
                name_parts.push(typeof (proto_ref));
            }
        } else {
            name_parts.push(this.meta.type);
        }

        name_parts.push('"' + this.meta.name + '"');
        name = name_parts.join(' ');

        if (typeof (proto_ref) === 'function') {
            body = '[Function]';
        } else if (typeof (proto_ref) === 'object' && proto_ref !== null) {
            body = '[Object (' + proto_ref.length + ')]';
        } else if (typeof (proto_ref) === 'string') {
            body = '"' + proto_ref + '"';
        } else {
            body = proto_ref;
        }
        return name + ': ' + body;
    }
10197
function clean(test) {
  return {
    title: test.title,
    fullTitle: test.fullTitle(),
    duration: test.duration,
    currentRetry: test.currentRetry()
  };
}
1166891
function(verb) {
                        var matches = verb.value.match(/^VB[^P\s]+ (\S+)$/);
                        if (matches) {
                            var index = s.indexOf(matches[1]);

                            this._log('Use imperative present tense, eg. "Fix bug" not ' +
                            '"Fixed bug" or "Fixes bug". To get it right ask yourself: "If applied, ' +
                            'this patch will <YOUR-COMMIT-MESSAGE-HERE>"',
                            cfg.imperativeVerbsInSubject.type, [1, index+1+this._colOffset]);

                            hasError = true;
                            return false; // stop loop
                        }
                        return true;
                    }
854673
function cleanConditionally(e, tag) {
  var tagsList = e.getElementsByTagName(tag);
  var curTagsLength = tagsList.length;

  /**
   * Gather counts for other typical elements embedded within.
   * Traverse backwards so we can remove nodes at the same time without effecting the traversal.
   *
   * TODO: Consider taking into account original contentScore here.
   **/
  for (var i = curTagsLength - 1; i >= 0; i--) {
    var weight = getClassWeight(tagsList[i]);

    dbg("Cleaning Conditionally " + tagsList[i] + " (" + tagsList[i].className + ":" + tagsList[i].id + ")" + ((typeof tagsList[i].readability != 'undefined') ? (" with score " + tagsList[i].readability.contentScore) : ''));

    if (weight < 0) {
      tagsList[i].parentNode.removeChild(tagsList[i]);
    } else if (getCharCount(tagsList[i], ',') < 10) {
      /**
       * If there are not very many commas, and the number of
       * non-paragraph elements is more than paragraphs or other ominous signs, remove the element.
       **/

      var p = tagsList[i].getElementsByTagName("p").length;
      var img = tagsList[i].getElementsByTagName("img").length;
      var li = tagsList[i].getElementsByTagName("li").length - 100;
      var input = tagsList[i].getElementsByTagName("input").length;

      var embedCount = 0;
      var embeds = tagsList[i].getElementsByTagName("embed");
      for (var ei = 0, il = embeds.length; ei < il; ei++) {
        if (embeds[ei].src && embeds[ei].src.search(regexps.videoRe) == -1) {
          embedCount++;
        }
      }

      var linkDensity = getLinkDensity(tagsList[i]);
      var contentLength = getInnerText(tagsList[i]).length;
      var toRemove = false;

      if (img > p && img > 1) {
        toRemove = true;
      } else if (li > p && tag != "ul" && tag != "ol") {
        toRemove = true;
      } else if (input > Math.floor(p / 3)) {
        toRemove = true;
      } else if (contentLength < 25 && (img == 0 || img > 2)) {
        toRemove = true;
      } else if (weight < 25 && linkDensity > .2) {
        toRemove = true;
      } else if (weight >= 25 && linkDensity > .5) {
        toRemove = true;
      } else if ((embedCount == 1 && contentLength < 75) || embedCount > 1) {
        toRemove = true;
      }

      if (toRemove) {
        tagsList[i].parentNode.removeChild(tagsList[i]);
      }
    }
  }
}
472619
public function analyze(): iterable
    {
        if (\count($this->rules) === 0) {
            throw new GrammarException('No rules specified');
        }

        $this->parsedRules = [];

        foreach ($this->rules as $delegate) {
            $this->ruleName = $delegate->getRuleName();
            $nodeId = $delegate->isKept()
                ? $delegate->getRuleName()
                : null;

            $pNodeId = $nodeId;
            $rule = $this->rule($delegate->getInnerTokens(), $pNodeId);

            if ($rule === null) {
                $error = \sprintf('Error while parsing rule %s.', $delegate->getRuleName());
                throw new GrammarException($error, 1);
            }

            $zeRule = $this->parsedRules[$rule];
            $zeRule->setName($delegate->getRuleName());

            if ($nodeId !== null) {
                $zeRule->setDefaultId($nodeId);
            }

            unset($this->parsedRules[$rule]);
            $this->parsedRules[$delegate->getRuleName()] = $zeRule;
        }

        foreach ($this->parsedRules as $builder) {
            yield $builder->build();
        }
    }
839099
@Override
	public boolean check(WyilFile wf) {
		for (Decl decl : wf.getModule().getUnits()) {
			checkDeclaration(decl);
		}
		return status;
	}
778855
function(mocha, test) {
        test.parent._onlyTests = test.parent._onlyTests.concat(test);
        mocha.options.hasOnly = true;
        return test;
      }
767520
private static function checkStaticProperties()
    {
        static $checkedClasses = [];
        if (!in_array(static::class, $checkedClasses)) {
            if (empty(static::$dbTableName)
                || empty(static::$dbProperties)
                || empty(static::$primaryDbPropertyKey)
                || (is_scalar(static::$primaryDbPropertyKey)
                    && !isset(static::$dbProperties[static::$primaryDbPropertyKey]['type']))
                || (is_array(static::$primaryDbPropertyKey)
                    && !Arr::allIn(static::$primaryDbPropertyKey, array_keys(static::$dbProperties)))
            ) {
                throw new \LogicException("All db entity's static properties not set");
            }
            $checkedClasses[] = static::class;
        }
    }
630150
function isVoidElement(elName) {
    var result = false;
    if (elName && elName.toLowerCase) {
        result = VOID_HTML_ELEMENTS.hasOwnProperty(elName.toLowerCase());
    }
    return result;
}
482301
function isSearchPartIncomplete( $part )
    {
        switch ( $part['subtype'] )
        {
            case 'fulltext':
            {
                if ( !isset( $part['value'] ) || $part['value'] == '' )
                    return true;
            }
            break;

            case 'patterntext':
            {
                if ( !isset( $part['value'] ) || $part['value'] == '' )
                    return true;
            }
            break;

            case 'integer':
            {
                if ( !isset( $part['value'] ) || $part['value'] == '' )
                    return true;
            }
            break;

            case 'integers':
            {
                if ( !isset( $part['values'] ) || count( $part['values'] ) == 0 )
                    return true;
            }
            break;

            case 'byrange':
            {
                if ( !isset( $part['from'] ) || $part['from'] == '' ||
                     !isset( $part['to'] ) || $part['to'] == '' )
                    return true;
            }
            break;

            case 'byidentifier':
            {
                if ( !isset( $part['value'] ) || $part['value'] == '' )
                    return true;
            }
            break;

            case 'byidentifierrange':
            {
                if ( !isset( $part['from'] ) || $part['from'] == '' ||
                     !isset( $part['to'] ) || $part['to'] == '' )
                    return true;
            }
            break;

            case 'integersbyidentifier':
            {
                if ( !isset( $part['values'] ) || count( $part['values'] ) == 0 )
                    return true;
            }
            break;

            case 'byarea':
            {
                if ( !isset( $part['from'] ) || $part['from'] == '' ||
                     !isset( $part['to'] ) || $part['to'] == '' ||
                     !isset( $part['minvalue'] ) || $part['minvalue'] == '' ||
                     !isset( $part['maxvalue'] ) || $part['maxvalue'] == '' )
                {
                    return true;
                }
            }
        }
        return false;
    }
1342290
private boolean checkFilteredXSSF() {
		XSSFWorkbook currentXSSFWorkbook = (XSSFWorkbook) this.currentWorkbook;
     		POIXMLProperties props = currentXSSFWorkbook.getProperties();
		SimpleDateFormat format = new SimpleDateFormat(MSExcelParser.DATE_FORMAT); 
		// check for each defined property
		// check if we need to match all
		boolean matchAll=true;
		boolean matchFull=true;
		boolean matchOnce=false;
		if (this.hocr.getMetaDataFilter().get(MATCH_ALL)!=null) {
			if ("true".equalsIgnoreCase(this.hocr.getMetaDataFilter().get(MATCH_ALL))) {
				matchAll=true;
				LOG.info("matching all metadata properties");
			} else if ("false".equalsIgnoreCase(this.hocr.getMetaDataFilter().get(MATCH_ALL)))	{
				matchAll=false;
				LOG.info("matching at least one metadata property");
			} else {
				LOG.error("Metadata property matchAll not defined correctly. Assuming that at only least one attribute needs to match");
			}
		}
		// check core properties
		String corePropertyName;
		POIXMLProperties.CoreProperties coreProp=props.getCoreProperties();
		corePropertyName="category";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getCategory();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
					LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		corePropertyName="contentstatus";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getContentStatus();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		corePropertyName="contenttype";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getContentType();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		corePropertyName="created";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				Date corePropStr=coreProp.getCreated();
				if ((corePropStr!=null) && (format.format(corePropStr).matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+format.format(corePropStr)+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
						LOG.debug(corePropertyName);
				}
		}
		corePropertyName="creator";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getCreator();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		corePropertyName="description";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getDescription();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		corePropertyName="identifier";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getIdentifier();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		corePropertyName="keywords";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getKeywords();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		corePropertyName="lastmodifiedbyuser";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getLastModifiedByUser();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		corePropertyName="lastprinted";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				Date corePropStr=coreProp.getLastPrinted();
				if ((corePropStr!=null) && (format.format(corePropStr).matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+format.format(corePropStr)+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
						LOG.debug(corePropertyName);
				}
		}
		corePropertyName="modified";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				Date corePropStr=coreProp.getModified();
				if ((corePropStr!=null) && (format.format(corePropStr).matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
						LOG.debug(corePropertyName);
				}
		}
		corePropertyName="revision";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getRevision();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		corePropertyName="subject";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getSubject();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		corePropertyName="title";
		if (this.hocr.getMetaDataFilter().get(corePropertyName)!=null) {
				String corePropStr=coreProp.getTitle();
				if ((corePropStr!=null) && (corePropStr.matches(this.hocr.getMetaDataFilter().get(corePropertyName)))) {
					matchOnce=true;
				 } else {
						matchFull=false;
						LOG.debug(NOT_MATCHING+corePropStr+":"+this.hocr.getMetaDataFilter().get(corePropertyName));
				}
		}
		// check for custom properties
		POIXMLProperties.CustomProperties custProp = props.getCustomProperties();
		for (Map.Entry<String,String> entry: this.hocr.getMetaDataFilter().entrySet()) {
			if (entry.getKey().startsWith("custom.")) {
				String strippedKey=entry.getKey().substring("custom.".length());
				if (strippedKey.length()>0) {
					String valueMatch=entry.getValue();
					if (valueMatch!=null) {
						
						if ((custProp.getProperty(strippedKey)!=null) && (custProp.getProperty(strippedKey).getName()!=null)&& (custProp.getProperty(strippedKey).getLpwstr().matches(valueMatch))) {
		matchOnce=true;
	} else {
		matchFull=false;
	}
					}
				}
			}
		}		
		
		if (!(matchAll)) {
			return  matchOnce;
		} else {
			return matchFull;
		}
	}
1156025
private function createCheckMatcher($verbs, $nouns, ...$matcherArguments)
    {
        return new CheckMatcher(
            $this->createLexer($verbs, $nouns),
            ...$matcherArguments
        );
    }
808349
public function ConditionalTerm()
    {
        $conditionalFactors = array();
        $conditionalFactors[] = $this->ConditionalFactor();

        while ($this->lexer->isNextToken(Lexer::T_AND)) {
            $this->match(Lexer::T_AND);

            $conditionalFactors[] = $this->ConditionalFactor();
        }

        // Phase 1 AST optimization: Prevent AST\ConditionalTerm
        // if only one AST\ConditionalFactor is defined
        if (count($conditionalFactors) == 1) {
            return $conditionalFactors[0];
        }

        return new AST\ConditionalTerm($conditionalFactors);
    }
252558
private String sanitizeWord(String word) {
    String result = word;

    //Find the last part of the word that is not nothing
    //Skip words ending in a dash as they'll be misrecognized
    if (!word.endsWith("-")) {
      String[] splitWord = word.split("-");
      String lastPart = splitWord.length > 1 && !splitWord[splitWord.length - 1].trim().equals("") ? splitWord[splitWord.length - 1] : word;

      //Find only the actual important part of the word
      List<String> compoundedWord = compoundTokenizer.tokenize(lastPart);
      if (compoundedWord.size() > 1) {
        lastPart = StringTools.uppercaseFirstChar(compoundedWord.get(compoundedWord.size() - 1));
      } else {
        lastPart = compoundedWord.get(compoundedWord.size() - 1);
      }

      //Only give result if the last part is either a noun or an adjective (or adjective written in Uppercase)
      List<TaggedWord> tagged = tag(lastPart);
      if (tagged.size() > 0 && (StringUtils.startsWithAny(tagged.get(0).getPosTag(), "SUB", "ADJ") || matchesUppercaseAdjective(lastPart))) {
        result = lastPart;
      }
    }
    return result;
  }
1317262
function validateSentence(parsed) {
  const sentences = parsed.sentences();
  return [
    !isSingleSentence(sentences) ? 'Must be one and only one sentence.' : null,
    !isNotTooShort(parsed) ? 'Must be at least two words long.' : null,
    !isNotPunctuated(sentences) ? 'Must not have any end punctuation.' : null,
  ].filter(Boolean);
}
41529
function matchTags(rule, runOnly) {
	'use strict';
	var include, exclude, matching;
	var defaultExclude =
		axe._audit && axe._audit.tagExclude ? axe._audit.tagExclude : [];

	// normalize include/exclude
	if (runOnly.hasOwnProperty('include') || runOnly.hasOwnProperty('exclude')) {
		// Wrap include and exclude if it's not already an array
		include = runOnly.include || [];
		include = Array.isArray(include) ? include : [include];

		exclude = runOnly.exclude || [];
		exclude = Array.isArray(exclude) ? exclude : [exclude];
		// add defaults, unless mentioned in include
		exclude = exclude.concat(
			defaultExclude.filter(function(tag) {
				return include.indexOf(tag) === -1;
			})
		);

		// Otherwise, only use the include value, ignore exclude
	} else {
		include = Array.isArray(runOnly) ? runOnly : [runOnly];
		// exclude the defaults not included
		exclude = defaultExclude.filter(function(tag) {
			return include.indexOf(tag) === -1;
		});
	}

	matching = include.some(function(tag) {
		return rule.tags.indexOf(tag) !== -1;
	});
	if (matching || (include.length === 0 && rule.enabled !== false)) {
		return exclude.every(function(tag) {
			return rule.tags.indexOf(tag) === -1;
		});
	} else {
		return false;
	}
}