<commit_before><?php
namespace MOC\MarkIV\Core\Xml\Reader\Source;

/**
 * Class Token
 *
 * @package MOC\MarkIV\Core\Xml\Reader\Source
 */
class Token extends TokenPattern {

	private $Name = '';
	private $AttributeList = array();
	private $Position = 0;

	/**
	 * @param array $Content
	 */
	function __construct( $Content ) {

		$this->Position = $Content[1];
		$this->Name = rtrim( substr( $Content[0], 0, strpos( $Content[0], ' ' ) ) );
		preg_match_all( '![\w:]+="[^"]*?"!is', $Content[0], $Matches );
		$Token = $Matches[0];

		$Attribute = array();
		while( null !== ( $AttributeString = array_pop( $Token ) ) ) {
			if( $AttributeString != '/' ) {
				preg_match( '!(.*?)="(.*?)(?=")!is', $AttributeString, $Attribute );
				if( count( $Attribute ) == 3 ) {
					$this->AttributeList[$Attribute[1]] = $Attribute[2];
				}
			}
		}
		$this->determineType( $Content[0] );
	}

	/**
	 * @return string
	 */
	public function getName() {

		return $this->Name;
	}

	/**
	 * @return int
	 */
	public function getPosition() {

		return $this->Position;
	}
<commit_msg>Core: Improved Xml (Fix: Missing name)<commit_after><?php
namespace MOC\MarkIV\Core\Xml\Reader\Source;

/**
 * Class Token
 *
 * @package MOC\MarkIV\Core\Xml\Reader\Source
 */
class Token extends TokenPattern {

	private $Name = '';
	private $AttributeList = array();
	private $Position = 0;

	/**
	 * @param array $Content
	 */
	function __construct( $Content ) {

		$this->Position = $Content[1];
		$this->Name = preg_replace( '!\s.*?$!is', '', $Content[0] );
		preg_match_all( '![\w:]+="[^"]*?"!is', $Content[0], $Matches );
		$Token = $Matches[0];

		$Attribute = array();
		while( null !== ( $AttributeString = array_pop( $Token ) ) ) {
			if( $AttributeString != '/' ) {
				preg_match( '!(.*?)="(.*?)(?=")!is', $AttributeString, $Attribute );
				if( count( $Attribute ) == 3 ) {
					$this->AttributeList[$Attribute[1]] = $Attribute[2];
				}
			}
		}
		$this->determineType( $Content[0] );
	}

	/**
	 * @return string
	 */
	public function getName() {

		return $this->Name;
	}

	/**
	 * @return int
	 */
	public function getPosition() {

		return $this->Position;
	}

{'fraction_non_alphanumeric': 0.21958041958041957, 'fraction_numerical': 0.009324009324009324, 'mean_word_length': 3.4522821576763487, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '3807786', 'n_tokens_mistral': 855, 'n_tokens_neox': 762, 'n_words': 152}