<commit_before><?php
/*
 * This file is part of the feed-io package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace FeedIo\Parser;


use FeedIo\FeedInterface;
use FeedIo\ParserAbstract;

class Rss extends ParserAbstract
{
    /**
     * Tells if the parser can handle the feed or not
     * @param \DOMDocument $document
     * @return mixed
     */
    public function canHandle(\DOMDocument $document)
    {
        // TODO: Implement canHandle() method.
    }

    /**
     * Performs the actual conversion into a FeedContent instance
     * @param \DOMDocument $document
     * @param FeedInterface $feed<commit_msg>Issue #1 rss::canHandle() implementation<commit_after><?php
/*
 * This file is part of the feed-io package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace FeedIo\Parser;


use FeedIo\FeedInterface;
use FeedIo\ParserAbstract;

class Rss extends ParserAbstract
{
    /**
     * RSS document must have a <rss> root node
     */
    const ROOT_NODE_TAGNAME = 'rss';

    /**
     * Tells if the parser can handle the feed or not
     * @param \DOMDocument $document
     * @return mixed
     */
    public function canHandle(\DOMDocument $document)
    {
        return self::ROOT_NODE_TAGNAME === $document->documentElement->tagName;
    }

    /**
     * Performs the actual conversion into a FeedContent instance
     * @param \DOMDocument $document
     * @param FeedInterface $feed
{'fraction_non_alphanumeric': 0.09685230024213075, 'fraction_numerical': 0.0006053268765133172, 'mean_word_length': 2.9545454545454546, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3679729', 'n_tokens_mistral': 476, 'n_tokens_neox': 461, 'n_words': 168}