/// <summary> /// Determines if the provided Adjective is similar to the provided AdjectivePhrase. /// </summary> /// <param name="first">The Adjective.</param> /// <param name="second">The AdjectivePhrase.</param> /// <returns> /// <c>true</c> if the provided Adjective is similar to the provided AdjectivePhrase; /// otherwise, <c>false</c>. /// </returns> public static Similarity IsSimilarTo(this Adjective first, AdjectivePhrase second) => Similarity.FromBoolean(second.Words.OfAdjective().Any(a => a.IsSimilarTo(first)));
/// <summary> /// Determines if the two provided Adjective instances are similar. /// </summary> /// <param name="first">The first Adjective.</param> /// <param name="second">The second Adjective.</param> /// <returns> /// <c>true</c> if the first Adjective is similar to the second; otherwise, <c>false</c>. /// </returns> public static Similarity IsSimilarTo(this Adjective first, Adjective second) => Similarity.FromBoolean(Similarity.FromBoolean(Equals(first, second) || (first?.GetSynonyms().Contains(second?.Text) ?? false)));