コード例 #1
0
    public static string BaseItem(this string self)
    {
        if (self.Length == 0)
        {
            return(self);
        }

        ICollection <string> baseterms = new List <string>();

        foreach (string term in self.Split(new char[] { ' ' }))
        {
            if (BP.Equals(term, ic))
            {
                continue;
            }

            if (BLUEPRINT.Similarity(term) > 0.666)
            {
                continue;
            }

            baseterms.Add(term);
        }
        return(string.Join(" ", baseterms.ToArray <string>()));
    }
コード例 #2
0
    public static bool HasBPTerm(this string self)
    {
        bool flag = false;

        foreach (string term in self.Split(new char[] { ' ' }))
        {
            flag = BP.Equals(term, ic) ? true : false;
            if (flag)
            {
                break;
            }

            flag = BLUEPRINT.Similarity(term) > 0.666 ? true : false;

            if (flag)
            {
                break;
            }
        }
        return(flag);
    }