<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using HeterogeneousDataSources.LoadLinkExpressions;

namespace HeterogeneousDataSources {
    public class LoadLinkConfig {
        private readonly Dictionary<Type, Dictionary<int, List<Type>>> _referenceTypeByLoadingLevelByRootLinkedSourceType;
        private readonly List<ILoadLinkExpression> _allLoadLinkExpressions;
        private readonly List<ILoadLinkExpression> _referenceLoadLinkExpressions;
        private readonly List<ILoadLinkExpression> _nestedLinkedSourceLoadLinkExpressions;
        private readonly List<ILoadLinkExpression> _subLinkedSourceLoadLinkExpressions;

        #region Initialization
        public LoadLinkConfig(List<ILoadLinkExpression> loadLinkExpressions) {
            var linkExpressionTreeFactory = new LoadLinkExpressionTreeFactory(loadLinkExpressions);

            EnsureChildLinkedSourceTypeIsUniqueInRootLoadLinkExpressions(loadLinkExpressions);
            EnsureNoCyclesInRootLoadLinkExpressions(loadLinkExpressions, linkExpressionTreeFactory);

            _referenceTypeByLoadingLevelByRootLinkedSourceType =
                GetReferenceTypeByLoadingLevelByRootLinkedSourceType(
                    loadLinkExpressions,<commit_msg>Disable cycle validation for now<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using HeterogeneousDataSources.LoadLinkExpressions;

namespace HeterogeneousDataSources {
    public class LoadLinkConfig {
        private readonly Dictionary<Type, Dictionary<int, List<Type>>> _referenceTypeByLoadingLevelByRootLinkedSourceType;
        private readonly List<ILoadLinkExpression> _allLoadLinkExpressions;
        private readonly List<ILoadLinkExpression> _referenceLoadLinkExpressions;
        private readonly List<ILoadLinkExpression> _nestedLinkedSourceLoadLinkExpressions;
        private readonly List<ILoadLinkExpression> _subLinkedSourceLoadLinkExpressions;

        #region Initialization
        public LoadLinkConfig(List<ILoadLinkExpression> loadLinkExpressions) {
            var linkExpressionTreeFactory = new LoadLinkExpressionTreeFactory(loadLinkExpressions);

            EnsureChildLinkedSourceTypeIsUniqueInRootLoadLinkExpressions(loadLinkExpressions);
            //EnsureNoCyclesInRootLoadLinkExpressions(loadLinkExpressions, linkExpressionTreeFactory);

            _referenceTypeByLoadingLevelByRootLinkedSourceType =
                GetReferenceTypeByLoadingLevelByRootLinkedSourceType(
                    loadLinkExpressions,
{'fraction_non_alphanumeric': 0.04397330192383196, 'fraction_numerical': 0.0, 'mean_word_length': 5.081145584725537, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3619007', 'n_tokens_mistral': 589, 'n_tokens_neox': 581, 'n_words': 103}