<commit_before>﻿using System.Collections;
using System.Collections.Specialized;
using System.Text;

namespace TweetDuck.Core.Other.Analytics{
    sealed class AnalyticsReport : IEnumerable{
        private OrderedDictionary data = new OrderedDictionary(32);
        private int separators;

        public void Add(int ignored){ // adding separators to pretty print
            data.Add((++separators).ToString(), null);
        }

        public void Add(string key, string value){
            data.Add(key, value);
        }

        public AnalyticsReport FinalizeReport(){
            if (!data.IsReadOnly){
                data = data.AsReadOnly();
            }

            return this;
        }

        public IEnumerator GetEnumerator(){
            return data.GetEnumerator();
        }

        public NameValueCollection ToNameValueCollection(){
            NameValueCollection collection = new NameValueCollection();

            foreach(DictionaryEntry entry in data){
                if (entry.Value != null){
                    collection.Add((string)entry.Key, (string)entry.Value);
                }
            }
<commit_msg>Tweak key format in analytics request<commit_after>﻿using System.Collections;
using System.Collections.Specialized;
using System.Text;

namespace TweetDuck.Core.Other.Analytics{
    sealed class AnalyticsReport : IEnumerable{
        private OrderedDictionary data = new OrderedDictionary(32);
        private int separators;

        public void Add(int ignored){ // adding separators to pretty print
            data.Add((++separators).ToString(), null);
        }

        public void Add(string key, string value){
            data.Add(key, value);
        }

        public AnalyticsReport FinalizeReport(){
            if (!data.IsReadOnly){
                data = data.AsReadOnly();
            }

            return this;
        }

        public IEnumerator GetEnumerator(){
            return data.GetEnumerator();
        }

        public NameValueCollection ToNameValueCollection(){
            NameValueCollection collection = new NameValueCollection();

            foreach(DictionaryEntry entry in data){
                if (entry.Value != null){
                    collection.Add(((string)entry.Key).ToLower().Replace(' ', '_'), (string)entry.Value);
                }
            }

{'fraction_non_alphanumeric': 0.09319148936170213, 'fraction_numerical': 0.001702127659574468, 'mean_word_length': 2.0772251308900525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2874360', 'n_tokens_mistral': 569, 'n_tokens_neox': 552, 'n_words': 143}