<commit_before>package com.soywiz.kpspemu.util.io

import com.soywiz.klogger.Logger
import com.soywiz.korio.async.asyncGenerate
import com.soywiz.korio.coroutine.withCoroutineContext
import com.soywiz.korio.error.invalidOp
import com.soywiz.korio.lang.ASCII
import com.soywiz.korio.lang.LATIN1
import com.soywiz.korio.lang.UTF8
import com.soywiz.korio.lang.format
import com.soywiz.korio.stream.*
import com.soywiz.korio.vfs.Vfs
import com.soywiz.korio.vfs.VfsFile
import com.soywiz.korio.vfs.VfsOpenMode
import com.soywiz.korio.vfs.VfsStat

suspend fun IsoVfs2(file: VfsFile): VfsFile = ISO2.openVfs(file.open(VfsOpenMode.READ))
suspend fun IsoVfs2(s: AsyncStream): VfsFile = ISO2.openVfs(s)
suspend fun AsyncStream.openAsIso2(): VfsFile {
	val iso = IsoVfs2(this)
	for (file in iso.listRecursive()) {
		println(file)
	}
	return iso
}
suspend fun VfsFile.openAsIso2() = IsoVfs2(this)

object ISO2 {
	val logger = Logger("ISO2")

	val CHARSET = ASCII
	//val CHARSET = UTF8

	const val SECTOR_SIZE = 0x800L

	val SCE_LBN_REGEX = Regex("^/?sce_lbn0x([0-9a-fA-F]+)_size0x([0-9a-fA-F]+)$")

	suspend fun read(s: AsyncStream): IsoFile = IsoReader(s).read()<commit_msg>Remove iso println<commit_after>package com.soywiz.kpspemu.util.io

import com.soywiz.klogger.Logger
import com.soywiz.korio.async.asyncGenerate
import com.soywiz.korio.coroutine.withCoroutineContext
import com.soywiz.korio.error.invalidOp
import com.soywiz.korio.lang.ASCII
import com.soywiz.korio.lang.LATIN1
import com.soywiz.korio.lang.UTF8
import com.soywiz.korio.lang.format
import com.soywiz.korio.stream.*
import com.soywiz.korio.vfs.Vfs
import com.soywiz.korio.vfs.VfsFile
import com.soywiz.korio.vfs.VfsOpenMode
import com.soywiz.korio.vfs.VfsStat

suspend fun IsoVfs2(file: VfsFile): VfsFile = ISO2.openVfs(file.open(VfsOpenMode.READ))
suspend fun IsoVfs2(s: AsyncStream): VfsFile = ISO2.openVfs(s)
suspend fun AsyncStream.openAsIso2(): VfsFile {
	val iso = IsoVfs2(this)
	//for (file in iso.listRecursive()) println(file)
	return iso
}
suspend fun VfsFile.openAsIso2() = IsoVfs2(this)

object ISO2 {
	val logger = Logger("ISO2")

	val CHARSET = ASCII
	//val CHARSET = UTF8

	const val SECTOR_SIZE = 0x800L

	val SCE_LBN_REGEX = Regex("^/?sce_lbn0x([0-9a-fA-F]+)_size0x([0-9a-fA-F]+)$")

	suspend fun read(s: AsyncStream): IsoFile = IsoReader(s).read()
{'fraction_non_alphanumeric': 0.12811693895098883, 'fraction_numerical': 0.019776440240756664, 'mean_word_length': 5.221925133689839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2893241', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1023, 'n_words': 165}