<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FastExcel
{
    /// <summary>
    /// Represents a range of cells
    /// </summary>
    public class CellRange
    {
        public string SheetName,
            ColumnStart,
            ColumnEnd;
        public int RowStart = 1;
        public int? RowEnd;
        public bool IsColumn = false;

        /// <summary>
        /// Defines a range of cells using a reference string
        /// </summary>
        /// <param name="reference">Reference string i.e. Sheet1!$A$1</param>
        public CellRange(string reference)
        {
            string[] splitReference = reference.Split('!');

            SheetName = splitReference[0];
            string range = splitReference[1];

            if (range.Contains(":"))
            {
                string[] splitRange = range.Split(':');
                IsColumn = splitRange[0].Count(c => c == '$') == 1;
                ColumnStart = splitRange[0].Split('$')[1];
                ColumnEnd = splitRange[1].Split('$')[1];
                if (!IsColumn)
                {
                    RowStart = Convert.ToInt32(splitRange[0].Split('$')[2]);
                    RowEnd = Convert.ToInt32(splitRange[1].Split('$')[2]);
                }
            }
            else
            {
                ColumnStart = ColumnEnd = range.Split('$')[1];
                RowEnd = RowStart = Convert.ToInt32(range.Split('$')[2]);
            }<commit_msg>Made a CellRange contructor internal only<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FastExcel
{
    /// <summary>
    /// Represents a range of cells
    /// </summary>
    public class CellRange
    {
        public string SheetName,
            ColumnStart,
            ColumnEnd;
        public int RowStart = 1;
        public int? RowEnd;
        public bool IsColumn = false;

        /// <summary>
        /// Defines a range of cells using a reference string
        /// </summary>
        /// <param name="reference">Reference string i.e. Sheet1!$A$1</param>
        internal CellRange(string reference)
        {
            string[] splitReference = reference.Split('!');

            SheetName = splitReference[0];
            string range = splitReference[1];

            if (range.Contains(":"))
            {
                string[] splitRange = range.Split(':');
                IsColumn = splitRange[0].Count(c => c == '$') == 1;
                ColumnStart = splitRange[0].Split('$')[1];
                ColumnEnd = splitRange[1].Split('$')[1];
                if (!IsColumn)
                {
                    RowStart = Convert.ToInt32(splitRange[0].Split('$')[2]);
                    RowEnd = Convert.ToInt32(splitRange[1].Split('$')[2]);
                }
            }
            else
            {
                ColumnStart = ColumnEnd = range.Split('$')[1];
                RowEnd = RowStart = Convert.ToInt32(range.Split('$')[2]);
            }
{'fraction_non_alphanumeric': 0.136986301369863, 'fraction_numerical': 0.015003261578604044, 'mean_word_length': 1.6035653650254669, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 17, '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': '5486346', 'n_tokens_mistral': 854, 'n_tokens_neox': 807, 'n_words': 183}