<commit_before><?php
namespace elasticsearch;

/**
* This class provides a convenient way of accessing configuration values set through the plugin's admin interface.
*
* @license http://opensource.org/licenses/MIT
* @author <NAME> <<EMAIL>>
* @version 2.0.0
**/
class Config{
	private static $options = null;

	/**
	* Retrieve a specific option from the wordpress database for this plugin. Note: This is cached once per request.
	*	
	* @param string $name The name of the option
	*
	* @return object
	**/
	static function option($name){
		if(self::$options == null){
			self::$options = &get_option('elasticsearch');
		}

		return self::apply_filters('config_option', isset(self::$options[$name]) ? self::$options[$name] : null, $name);
	}

	/**
	* The score given to a data point that determines the impact on search results. May return null if the setttings have not been saved.
	*
	* @param string $type The type of wordpress object that is being scored (tax|field)
	* @param string $name The slug and/or logical name of that type 
	*
	* @return integer<commit_msg>Add ability to set default option value<commit_after><?php
namespace elasticsearch;

/**
* This class provides a convenient way of accessing configuration values set through the plugin's admin interface.
*
* @license http://opensource.org/licenses/MIT
* @author <NAME> <<EMAIL>>
* @version 2.0.0
**/
class Config{
	private static $options = null;

	/**
	* Retrieve a specific option from the wordpress database for this plugin. Note: This is cached once per request.
	*	
	* @param string $name The name of the option
	*
	* @return object
	**/
	static function option($name, $default = null){
		if(self::$options == null){
			self::$options = get_option('elasticsearch');
		}

		return self::apply_filters('config_option', isset(self::$options[$name]) ? self::$options[$name] : $default, $name);
	}

	/**
	* The score given to a data point that determines the impact on search results. May return null if the setttings have not been saved.
	*
	* @param string $type The type of wordpress object that is being scored (tax|field)
	* @param string $name The slug and/or logical name of that type 
	*
	* @return integer
{'fraction_non_alphanumeric': 0.11778185151237397, 'fraction_numerical': 0.002749770852428964, 'mean_word_length': 4.324390243902439, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1656998', 'n_tokens_mistral': 646, 'n_tokens_neox': 637, 'n_words': 253}