<commit_before><?php

/**
 * Return a subset of the string from offset start to offset end (both offsets are inclusive)
 * 
 * @param $name          Key name
 * @paran $start         Start
 * @param $end[optional] End. If end is omitted, the substring starting from $start until the end of the string will be returned.
 * @return string
 * 
 * @author <NAME>
 * @package Rediska
 * @version @package_version@
 * @link http://rediska.geometria-lab.net
 * @licence http://www.opensource.org/licenses/bsd-license.php
 */
class Rediska_Command_Substring extends Rediska_Command_Abstract
{
    public function create($name, $start, $end = null)
    {
        if ($end === null) {
            $end = -1;
        }

        $command = array('SUBSTR', $this->_rediska->getOption('namespace') . $name, $start, $end);

        $connection = $this->_rediska->getConnectionByKeyName($name);<commit_msg>small refactor substring<commit_after><?php

/**
 * Return a subset of the string from offset start to offset end (both offsets are inclusive)
 * 
 * @param $name          Key name
 * @paran $start         Start
 * @param $end[optional] End. If end is omitted, the substring starting from $start until the end of the string will be returned.
 * @return string
 * 
 * @author <NAME>
 * @package Rediska
 * @version @package_version@
 * @link http://rediska.geometria-lab.net
 * @licence http://www.opensource.org/licenses/bsd-license.php
 */
class Rediska_Command_Substring extends Rediska_Command_Abstract
{
    public function create($name, $start, $end = -1)
    {
        $command = array('SUBSTR', $this->_rediska->getOption('namespace') . $name, $start, $end);

        $connection = $this->_rediska->getConnectionByKeyName($name);
{'fraction_non_alphanumeric': 0.12920046349942063, 'fraction_numerical': 0.0011587485515643105, 'mean_word_length': 3.4168797953964196, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6799309', 'n_tokens_mistral': 519, 'n_tokens_neox': 507, 'n_words': 156}