Example #1
0
        public IEnumerable <TPair> FindAll()
        {
            var nodes = source.Fetch().ToList();

            measure.Sources = nodes.Count();

            var representations = nodes.Select(node => preprocessor.Process(node)).ToList();

            var pairs = representations.InnerPairs <TPair, TRepresentation>().Select((x) =>
            {
                measure.Pairs += 1;

                return(x);
            });

            measure.Similarities = Enumerable.Repeat((long)0, comparators.Count()).ToList();
            foreach (var element in pairs)
            {
                var cIndex = 0;
                foreach (var comparator in comparators)
                {
                    if (!comparator.SyntaxEquals(element, information))
                    {
                        goto SkipThisElement;
                    }

                    measure.Similarities[cIndex++]++;
                }

                yield return(element);

SkipThisElement:
                ;
            }
        }
        public IEnumerable <TPair> FindAll()
        {
            var nodes = source.Fetch();
            IEnumerable <TRepresentation> representations = nodes.Select(node => preprocessor.Process(node)).ToList();
            var pairs = representations.InnerPairs <TPair, TRepresentation>();
            var found = pairs.Where(comparators, information);

            return(found);
        }