GetLinkDensity() public method

public GetLinkDensity ( ) : float
return float
        protected internal virtual bool Classify(TextBlock prev, TextBlock curr, TextBlock
			 next)
        {
            bool isContent;
            if (curr.GetLinkDensity() <= 0.333333)
            {
                if (prev.GetLinkDensity() <= 0.555556)
                {
                    if (curr.GetTextDensity() <= 9)
                    {
                        if (next.GetTextDensity() <= 10)
                        {
                            if (prev.GetTextDensity() <= 4)
                            {
                                isContent = false;
                            }
                            else
                            {
                                isContent = true;
                            }
                        }
                        else
                        {
                            isContent = true;
                        }
                    }
                    else
                    {
                        if (next.GetTextDensity() == 0)
                        {
                            isContent = false;
                        }
                        else
                        {
                            isContent = true;
                        }
                    }
                }
                else
                {
                    if (next.GetTextDensity() <= 11)
                    {
                        isContent = false;
                    }
                    else
                    {
                        isContent = true;
                    }
                }
            }
            else
            {
                isContent = false;
            }
            return curr.SetIsContent(isContent);
        }
 public bool MeetsCondition(TextBlock tb)
 {
     return tb.GetLinkDensity() == 0 && tb.GetNumWords() > 6;
 }
Example #3
0
 protected internal bool Classify(TextBlock prev, TextBlock curr, TextBlock next)
 {
     bool isContent = (curr.GetLinkDensity() > 0 && next.GetNumWords() > 11) || (curr.
         GetNumWords() > 19 || (next.GetNumWords() > 6 && next.GetLinkDensity() == 0 && prev
         .GetLinkDensity() == 0 && (curr.GetNumWords() > 6 || prev.GetNumWords() > 7 || next
         .GetNumWords() > 19)));
     return curr.SetIsContent(isContent);
 }