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

namespace Grobid.NET
{
    public class AggregateLexicon : ILexicon
    {
        private readonly ILexicon[] lexicons;
        private Lexicon englishLexicon;
        private Lexicon germanLexicon;
        private org.grobid.core.lexicon.FastMatcher cityNameFastMatcher;
        private CountryCodes countryCodes;

        public AggregateLexicon(ILexicon lexicon, params ILexicon[] lexicons)
        {
            this.lexicons = Enumerable.Repeat<ILexicon>(lexicon, 1).Concat(lexicons).ToArray();
        }

        public AggregateLexicon(IEnumerable<ILexicon> lexicons)
        {
            this.lexicons = lexicons.ToArray();
        }

        public AggregateLexicon(
            Lexicon englishLexicon,
            Lexicon germanLexicon,
            org.grobid.core.lexicon.FastMatcher cityNameFastMatcher,
            CountryCodes countryCodes)
        {
            this.englishLexicon = englishLexicon;
            this.germanLexicon = germanLexicon;
            this.lexicons = new[] { this.englishLexicon, this.germanLexicon };

            this.cityNameFastMatcher = cityNameFastMatcher;
            this.countryCodes = countryCodes;
        }

        public bool IsFirstName(string name)
        {
            return this.lexicons.Any(x => x.IsFirstName(name));
        }

        public bool IsLastName(string name)
        {
            return this.lexicons.Any(x => x.IsLastName(name));
        }

        public bool HasWord(string word)
        {
            return this.lexicons.Any(x => x.HasWord(word));
        }

        public bool inDictionary(string word)<commit_msg>R# suggestions<commit_after>﻿using System.Collections.Generic;
using System.Linq;

namespace Grobid.NET
{
    public class AggregateLexicon : ILexicon
    {
        private readonly ILexicon[] lexicons;
        private readonly org.grobid.core.lexicon.FastMatcher cityNameFastMatcher;
        private readonly CountryCodes countryCodes;

        public AggregateLexicon(ILexicon lexicon, params ILexicon[] lexicons)
        {
            this.lexicons = Enumerable.Repeat<ILexicon>(lexicon, 1).Concat(lexicons).ToArray();
        }

        public AggregateLexicon(IEnumerable<ILexicon> lexicons)
        {
            this.lexicons = lexicons.ToArray();
        }

        public AggregateLexicon(
            ILexicon englishLexicon,
            ILexicon germanLexicon,
            org.grobid.core.lexicon.FastMatcher cityNameFastMatcher,
            CountryCodes countryCodes)
        {
            this.lexicons = new ILexicon[] { englishLexicon, germanLexicon };

            this.cityNameFastMatcher = cityNameFastMatcher;
            this.countryCodes = countryCodes;
        }

        public bool IsFirstName(string name)
        {
            return this.lexicons.Any(x => x.IsFirstName(name));
        }

        public bool IsLastName(string name)
        {
            return this.lexicons.Any(x => x.IsLastName(name));
        }

        public bool HasWord(string word)
        {
            return this.lexicons.Any(x => x.HasWord(word));
        }

        public bool inDictionary(string word)
{'fraction_non_alphanumeric': 0.08210128971374646, 'fraction_numerical': 0.0006291286568103177, 'mean_word_length': 2.189568706118355, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '7635101', 'n_tokens_mistral': 926, 'n_tokens_neox': 881, 'n_words': 167}