Goose\Modules\Formatters\OutputFormatter::removeParagraphsWithFewWords PHP 메소드

removeParagraphsWithFewWords() 개인적인 메소드

remove paragraphs that have less than x number of words, would indicate that it's some sort of link
private removeParagraphsWithFewWords ( DOMWrap\Element $topNode )
$topNode DOMWrap\Element
    private function removeParagraphsWithFewWords(Element $topNode)
    {
        if (!empty($topNode)) {
            $nodes = $topNode->find('p');
            foreach ($nodes as $node) {
                $stopWords = $this->config()->getStopWords()->getStopwordCount($node->text());
                if (mb_strlen(Helper::textNormalise($node->text())) < 8 && $stopWords->getStopWordCount() < 3 && $node->find('object')->count() == 0 && $node->find('embed')->count() == 0) {
                    $node->remove();
                }
            }
            /** @todo Implement */
        }
    }