<commit_before>﻿// Version compatibility level: 3.1.0
namespace BoboBrowse.Net.Facets.Data
{
    using BoboBrowse.Net.Support;
    using Common.Logging;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class TermFixedLengthLongArrayList : TermValueList<long[]>
    {
        private static ILog logger = LogManager.GetLogger<TermFixedLengthLongArrayList>();

        private List<long> _innerList2 = new List<long>();
        protected long[] _elements = null;
        protected int width;

        private long[] sanity;
        private bool withDummy = true;

        public TermFixedLengthLongArrayList(int width)
            : base()
        {
            this.width = width;
            sanity = new long[width];
            sanity[width - 1] = -1;
        }

        public TermFixedLengthLongArrayList(int width, int capacity)
            : base(capacity * width)
        {
            this.width = width;
            sanity = new long[width];
            sanity[width - 1] = -1;
        }

        protected long[] Parse(string s)
        {
            long[] r = new long[width];

            if (s == null || s.Length == 0)
                return r;

            string[] a = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            if (a.Length != width)
                throw new RuntimeException(s + " is not a " + width + " fixed width long.");

            for (int i = 0; i < width; ++i)
            {
                r[i] = long.Parse(a[i]);
                //if (r[i] < 0)<commit_msg>Fixed TermFixedLengthLongArrayList so it parses using the invariant culture.<commit_after>﻿// Version compatibility level: 3.1.0
namespace BoboBrowse.Net.Facets.Data
{
    using BoboBrowse.Net.Support;
    using Common.Logging;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Linq;
    using System.Text;

    public class TermFixedLengthLongArrayList : TermValueList<long[]>
    {
        private static ILog logger = LogManager.GetLogger<TermFixedLengthLongArrayList>();

        private List<long> _innerList2 = new List<long>();
        protected long[] _elements = null;
        protected int width;

        private long[] sanity;
        private bool withDummy = true;

        public TermFixedLengthLongArrayList(int width)
            : base()
        {
            this.width = width;
            sanity = new long[width];
            sanity[width - 1] = -1;
        }

        public TermFixedLengthLongArrayList(int width, int capacity)
            : base(capacity * width)
        {
            this.width = width;
            sanity = new long[width];
            sanity[width - 1] = -1;
        }

        protected long[] Parse(string s)
        {
            long[] r = new long[width];

            if (s == null || s.Length == 0)
                return r;

            string[] a = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            if (a.Length != width)
                throw new RuntimeException(s + " is not a " + width + " fixed width long.");

            for (int i = 0; i < width; ++i)
            {
                r[i] = long.Parse(a[i], CultureInfo.InvariantCulture);
                //if (r[i] < 0)
{'fraction_non_alphanumeric': 0.10787518573551264, 'fraction_numerical': 0.006537890044576523, 'mean_word_length': 1.84530853761623, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, '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': '2564365', 'n_tokens_mistral': 953, 'n_tokens_neox': 913, 'n_words': 252}