Example #1
0
        /// <summary>
        ///     Invoked during fetching.
        /// </summary>
        /// <param name="value">The value.</param>
        public void AddValue(SimilarityValue value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            _similarityValues.Add(value.Value, value);
        }
Example #2
0
        /// <summary>
        ///     Adds a similarity value, if the similarity value exists its count is incremented.
        /// </summary>
        /// <param name="value">Value may be null</param>
        public void AddValue(string value)
        {
            if (value == null)
            {
                value = "";
            }

            SimilarityValue similarityValue;

            if (!_similarityValues.TryGetValue(value, out similarityValue))
            {
                similarityValue = new SimilarityValue(value);
                _similarityValues.Add(value, similarityValue);
            }

            ValueCount += 1;
            similarityValue.IncreaseUsage(ValueCount);

            foreach (var value1 in _similarityValues)
            {
                value1.Value.Recalculate(ValueCount);
            }
        }