<commit_before>﻿using System;

namespace ExRam.Gremlinq.Core
{
    internal readonly struct BindingKey
    {
        private readonly int? _key;

        public BindingKey(int? key)
        {
            _key = key;
        }

        public static implicit operator BindingKey(int key)
        {
            return new(key);
        }

        public static implicit operator string(BindingKey key)
        {
            if (key._key is { } intKey)
            {
                var ret = string.Empty;
                
                do
                {
                    ret = (char)('a' + intKey % 26) + ret;
                    intKey /= 26;
                } while (intKey > 0);

                return "_" + ret;
            }

            throw new ArgumentException();
        }<commit_msg>BindingKey review.<commit_after>﻿using System;

namespace ExRam.Gremlinq.Core
{
    internal readonly struct BindingKey
    {
        private readonly string? _stringKey;

        public BindingKey(int key)
        {
            var stringKey = string.Empty;

            do
            {
                stringKey = (char)('a' + key % 26) + stringKey;
                key /= 26;
            } while (key > 0);

            _stringKey = "_" + stringKey;
        }

        public static implicit operator BindingKey(int key)
        {
            return new(key);
        }

        public static implicit operator string(BindingKey key)
        {
            if (key._stringKey is { } stringKey)
                return stringKey;

            throw new ArgumentException();
        }

        public override string ToString()
        {
            if (_stringKey is { } stringKey)
                return stringKey;

            return "(invalid)";
        }
{'fraction_non_alphanumeric': 0.08172531214528944, 'fraction_numerical': 0.0056753688989784334, 'mean_word_length': 1.2344740177439797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3013158', 'n_tokens_mistral': 478, 'n_tokens_neox': 432, 'n_words': 121}