<commit_before><?php
App::import('Lib', 'AssetCompress.AssetFilterInterface');
/**
 * A collection for creating and interacting with filter sets.
 *
 *
 * @package asset_compress
 */
class AssetFilterCollection {
	protected $_config = array();

	protected $_filters = array();

/**
 * Construct a filter collection.
 *
 * @param array $filters An array of filters as keys, with their settings as the values.
 * @param array $config An array of global settings for all filters. Contains 'paths'
 */
	function __construct(array $filters, array $config) {
		$this->_config = $config;
		$this->_buildFilters($filters);	
	}

	protected function _buildFilters($filters) {
		foreach ($filters as $className) {
			list($plugin, $className) = pluginSplit($className, true);
			App::import('Lib', $plugin . 'asset_compress/filter/' . $className);
			if (!class_exists($className)) {
				App::import('Lib', 'AssetCompress.filters/' . $className);
				if (!class_exists($className)) {
					throw new Exception(sprintf('Cannot not load filter "%s".', $className));
				}
			}
			$filter = new $className();
			$this->addFilter($filter);<commit_msg>Fixing incorrect plurals.<commit_after><?php
App::import('Lib', 'AssetCompress.AssetFilterInterface');
/**
 * A collection for creating and interacting with filter sets.
 *
 *
 * @package asset_compress
 */
class AssetFilterCollection {
	protected $_config = array();

	protected $_filters = array();

/**
 * Construct a filter collection.
 *
 * @param array $filters An array of filters as keys, with their settings as the values.
 * @param array $config An array of global settings for all filters. Contains 'paths'
 */
	function __construct(array $filters, array $config) {
		$this->_config = $config;
		$this->_buildFilters($filters);	
	}

	protected function _buildFilters($filters) {
		foreach ($filters as $className) {
			list($plugin, $className) = pluginSplit($className, true);
			App::import('Lib', $plugin . 'asset_compress/filter/' . $className);
			if (!class_exists($className)) {
				App::import('Lib', 'AssetCompress.filter/' . $className);
				if (!class_exists($className)) {
					throw new Exception(sprintf('Cannot not load filter "%s".', $className));
				}
			}
			$filter = new $className();
			$this->addFilter($filter);
{'fraction_non_alphanumeric': 0.14861902674265673, 'fraction_numerical': 0.0, 'mean_word_length': 4.538834951456311, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4206268', 'n_tokens_mistral': 698, 'n_tokens_neox': 640, 'n_words': 193}