protected function type(\DOMNode $node)
    {
        $type = null;
        if ($node instanceof \DOMText) {
            $type = WordType::TEXT;
        } elseif ($node instanceof \DOMAttr) {
            $type = WordType::VALUE;
        } else {
            throw new ParserCrawlerAfterListenerException('No word type set for this kind of node.');
        }
        return $type;
    }