<commit_before><?php

/**
* 
* Parses for anchor targets.
* 
* @category Text
* 
* @package Text_Wiki
* 
* @author <NAME> <<EMAIL>>
* @author <NAME> <purestorm at ggnore dot net>
*
* @author <NAME> <<EMAIL>>
* 
* @license LGPL
* 
* @version $Id: Anchor.php,v 1.1 2005-05-18 23:43:16 papercrane Exp $
* 
*/

/**
* 
* This class implements a Text_Wiki_Parse to add an anchor target name
* in the wiki page.
*
* @author <NAME> <<EMAIL>>
* @author <NAME> <purestorm at ggnore dot net>
*
* @author <NAME> <pmjones at ciaweb dot net>
*
* @category Text
* 
* @package Text_Wiki
* 
*/

class Text_Wiki_Parse_Anchor extends Text_Wiki_Parse {
    
    
    /**
    * 
    * The regular expression used to find source text matching this
    * rule.  Looks like a macro: [[# anchor_name]]
    * 
    * @access public
    * 
    * @var string
    * 
    */
    
    var $regex = '/(\[\[# )([-_A-Za-z0-9.]+?)( .+)?(\]\])/i';
    
    
    /**
    * 
    * Generates a token entry for the matched text.  Token options are:
    * 
    * 'text' => The full matched text, not including the <code></code> tags.
    * 
    * @access public
    *
    * @param array &$matches The array of matches from parse().
    *
    * @return A delimited token number to be used as a placeholder in
    * the source text.
    *
    */
    
    function process(&$matches) {
    
        $name = $matches[2];
        $text = $matches[3];
        
        $start = $this->wiki->addToken(
            $this->rule,
            array('type' => 'start', 'name' => $name)
        );
        
        $end = $this->wiki->addToken(
            $this->rule,
            array('type' => 'end', 'name' => $name)
        );
        
        // done, place the script output directly in the source
        return $start . trim($text) . $end;
    }
}
?>
<commit_msg>Don't capture unneeded sub-patterns<commit_after><?php

/**
* 
* Parses for anchor targets.
* 
* @category Text
* 
* @package Text_Wiki
* 
* @author <NAME> <<EMAIL>>
* @author <NAME> <purestorm at ggnore dot net>
*
* @author <NAME> <<EMAIL>>
* 
* @license LGPL
* 
* @version $Id: Anchor.php,v 1.2 2005-06-16 17:22:05 papercrane Exp $
* 
*/

/**
* 
* This class implements a Text_Wiki_Parse to add an anchor target name
* in the wiki page.
*
* @author <NAME> <<EMAIL>>
* @author <NAME> <purestorm at ggnore dot net>
*
* @author <NAME> <pmjones at ciaweb dot net>
*
* @category Text
* 
* @package Text_Wiki
* 
*/

class Text_Wiki_Parse_Anchor extends Text_Wiki_Parse {
    
    
    /**
    * 
    * The regular expression used to find source text matching this
    * rule.  Looks like a macro: [[# anchor_name]]
    * 
    * @access public
    * 
    * @var string
    * 
    */
    
    var $regex = '/\[\[# ([-_A-Za-z0-9.]+?)( .+)?\]\]/i';
    
    
    /**
    * 
    * Generates a token entry for the matched text.  Token options are:
    * 
    * 'text' => The full matched text, not including the <code></code> tags.
    * 
    * @access public
    *
    * @param array &$matches The array of matches from parse().
    *
    * @return A delimited token number to be used as a placeholder in
    * the source text.
    *
    */
    
    function process(&$matches) {
    
        $name = $matches[1];
        $text = $matches[2];
        
        $start = $this->wiki->addToken(
            $this->rule,
            array('type' => 'start', 'name' => $name)
        );
        
        $end = $this->wiki->addToken(
            $this->rule,
            array('type' => 'end', 'name' => $name)
        );
        
        // done, place the script output directly in the source
        return $start . trim($text) . $end;
    }
}
?>

{'fraction_non_alphanumeric': 0.15489874110563764, 'fraction_numerical': 0.010946907498631636, 'mean_word_length': 2.023159636062862, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 61, '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': '5203843', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1258, 'n_words': 355}