<commit_before>namespace $.$mol {
	export class $mol_text extends $.$mol_text {
		
		@ $mol_mem()
		tokens_flow() {
			return $mol_syntax_md_flow.tokenize( this.text() )
		}
		
		rows() {
			return this.tokens_flow().map( ( token , index )=> {
				switch( token.name ) {
					case 'table' : return this.Table( index )
					case 'header' : return this.Header( index )
				}
				return this.Row( index )
			} )
		}
		
		header_level( index : number ) {
			return this.tokens_flow()[ index ].chunks[0].length
		}
		
		header_content( index : number ) {
			return this.text2spans( `${ index }` , this.tokens_flow()[ index ].chunks[2] )
		}
		
		block_type( index : number ) {
			return this.tokens_flow()[ index ].name
		}
		
		@ $mol_mem_key()
		cell_contents( indexBlock : number ) {
			return this.tokens_flow()[ indexBlock ].chunks[ 0 ]
			.split( /\r?\n/g )
			.filter( row => row && !/\|--/.test( row ) )
			.map( ( row , rowId ) => {
				return row.split( /\|/g )
				.filter( cell => cell )
				.map( ( cell , cellId )=> cell.trim() )
			} )
		}
		
		table_rows( blockId : number ) {
			return this.cell_contents( blockId )
			.slice( 1 )
			.map( ( row , rowId )=> this.Table_row({ block : blockId , row : rowId + 1 }) )
		}
		
		table_head_cells( blockId : number ) {
			return this.cell_contents( blockId )[ 0 ]
			.map( ( cell , cellId )=> this.Table_cell_head({ block : blockId , row : 0 , cell : cellId }) )
		}
		
		table_cells( id : { block : number , row : number } ) {
			return this.cell_contents( id.block )[ id.row ]
			.map( ( cell , cellId )=> this.Table_cell({ block : id.block , row : id.row , cell : cellId }) )
		}
		
		table_cell_content( id : { block : number , row : number , cell : number } ) {
			return this.text2spans( `${ id.block }/${ id.row }/${ id.cell }` , this.cell_contents( id.block )[ id.row ][ id.cell ] )
		}
		
		uri_resolve( uri : string ) {
			const url = new URL( uri , this.uri_base() )
			return url.toString()
		}
		
		text2spans( prefix : string , text : string ) {
			return $mol_syntax_md_line.tokenize( text ).map( ( token , index )=> {<commit_msg>Fixed uri resolving in mol/text.<commit_after>namespace $.$mol {
	export class $mol_text extends $.$mol_text {
		
		@ $mol_mem()
		tokens_flow() {
			return $mol_syntax_md_flow.tokenize( this.text() )
		}
		
		rows() {
			return this.tokens_flow().map( ( token , index )=> {
				switch( token.name ) {
					case 'table' : return this.Table( index )
					case 'header' : return this.Header( index )
				}
				return this.Row( index )
			} )
		}
		
		header_level( index : number ) {
			return this.tokens_flow()[ index ].chunks[0].length
		}
		
		header_content( index : number ) {
			return this.text2spans( `${ index }` , this.tokens_flow()[ index ].chunks[2] )
		}
		
		block_type( index : number ) {
			return this.tokens_flow()[ index ].name
		}
		
		@ $mol_mem_key()
		cell_contents( indexBlock : number ) {
			return this.tokens_flow()[ indexBlock ].chunks[ 0 ]
			.split( /\r?\n/g )
			.filter( row => row && !/\|--/.test( row ) )
			.map( ( row , rowId ) => {
				return row.split( /\|/g )
				.filter( cell => cell )
				.map( ( cell , cellId )=> cell.trim() )
			} )
		}
		
		table_rows( blockId : number ) {
			return this.cell_contents( blockId )
			.slice( 1 )
			.map( ( row , rowId )=> this.Table_row({ block : blockId , row : rowId + 1 }) )
		}
		
		table_head_cells( blockId : number ) {
			return this.cell_contents( blockId )[ 0 ]
			.map( ( cell , cellId )=> this.Table_cell_head({ block : blockId , row : 0 , cell : cellId }) )
		}
		
		table_cells( id : { block : number , row : number } ) {
			return this.cell_contents( id.block )[ id.row ]
			.map( ( cell , cellId )=> this.Table_cell({ block : id.block , row : id.row , cell : cellId }) )
		}
		
		table_cell_content( id : { block : number , row : number , cell : number } ) {
			return this.text2spans( `${ id.block }/${ id.row }/${ id.cell }` , this.cell_contents( id.block )[ id.row ][ id.cell ] )
		}
		
		uri_base() {
			return $mol_dom_context.document.location.href
		}
		
		uri_resolve( uri : string ) {
			const url = new URL( uri , this.uri_base() )
			return url.toString()
		}
		
		text2spans( prefix : string , text : string ) {
			return $mol_syntax_md_line.tokenize( text ).map( ( token , index )=> {
{'fraction_non_alphanumeric': 0.16732696341179212, 'fraction_numerical': 0.004660918200885575, 'mean_word_length': 2.6097560975609757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '6155186', 'n_tokens_mistral': 1821, 'n_tokens_neox': 1523, 'n_words': 361}