<commit_before><?php

/**
 * @author <NAME> <<EMAIL>>
 * @copyright 2012 <NAME>
 * @package Biriani
 */


/**
 * class ExtractableBiriani
 */
abstract class Biriani_Extractable_Abstract implements IExtractable {
 
    protected $response;
    
    public function __construct(Biriani_Response $resp) {
        if($resp instanceof Biriani_Response){
            $this->response = $resp;
        }<commit_msg>Biriani_Data and DomDocument added so that extractors can easily extract<commit_after><?php

/**
 * @author <NAME> <<EMAIL>>
 * @copyright 2012 <NAME>
 * @package Biriani
 */


/**
 * class ExtractableBiriani
 * @property Biriani_Response $response HTTP response
 * @property Biriani_Data $data last extracted data is cached here
 * @property DOMDocument $dom internal DOM manipulation object. Access is protected
 */
abstract class Biriani_Extractable_Abstract implements IExtractable {
 
    protected $response;
    protected $dom;
    public $data;
    public function __construct(Biriani_Response $resp) {
        if($resp instanceof Biriani_Response){
            $this->response = $resp;
        }
        $this->data = new Biriani_Data();
        
        // setting up DOMDocument
        $this->dom = new DOMDocument(); 
        $this->dom->recover = true;
        
        // Disabling dom error and enabling libxml internal error.
        // This is because if any invalid markup found DOM shows 
        // a lot of warning.
        libxml_use_internal_errors(true);
    }
    
    public function __destruct(){
        // Reverting back the internal errors flag.
        libxml_use_internal_errors(false);
{'fraction_non_alphanumeric': 0.09471094710947109, 'fraction_numerical': 0.004920049200492005, 'mean_word_length': 2.8646080760095014, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '2991714', 'n_tokens_mistral': 453, 'n_tokens_neox': 427, 'n_words': 135}