<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package dev.ligature

import kotlinx.coroutines.flow.Flow

sealed class Object

data class CollectionName(val identifier: String) {
    init {
        require(validNamedEntity(identifier)) {
            "Invalid NamedEntity: $identifier"
        }
    }
}

sealed class Entity: Object()
data class NamedEntity(val identifier: String): Entity() {
    init {
        require(validNamedEntity(identifier)) {
            "Invalid NamedEntity: $identifier"
        }
    }
}
data class AnonymousEntity(val identifier: Long): Entity()

data class Predicate(val identifier: String) {
    init {
        require(validNamedEntity(identifier)) {
            "Invalid NamedEntity: $identifier"
        }
    }
}

sealed class Literal: Object()
data class LangLiteral(val value: String, val langTag: String): Literal() {
    init {
        require(validLangTag(langTag)) {
            "Invalid lang tag: $langTag"
        }
    }
}
data class StringLiteral(val value: String): Literal()
data class BooleanLiteral(val value: Boolean): Literal()
data class LongLiteral(val value: Long): Literal()
data class DoubleLiteral(val value: Double): Literal()

val a = Predicate("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")

data class Statement(val subject: Entity, val predicate: Predicate, val `object`: Object)
data class PersistedStatement(val collection: CollectionName, val statement: Statement, val context: AnonymousEntity)

sealed class Range<T>(open val start: T, open val end: T)
data class LangLiteralRange(override val start: LangLiteral, override val end: LangLiteral): Range<LangLiteral>(start, end)
data class StringLiteralRange(override val start: String, override val end: String): Range<String>(start, end)
data class LongLiteralRange(override val start: Long, override val end: Long): Range<Long>(start, end)
data class DoubleLiteralRange(override val start: Double, override val end: Double): Range<Double>(start, end)

interface LigatureStore {
    suspend fun readTx(): ReadTx
    suspend fun writeTx(): WriteTx<commit_msg>removing require conditions in constructors<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package dev.ligature

import kotlinx.coroutines.flow.Flow

sealed class Object

data class CollectionName(val identifier: String)
sealed class Entity: Object()
data class NamedEntity(val identifier: String): Entity()
data class AnonymousEntity(val identifier: Long): Entity()
data class Predicate(val identifier: String)
sealed class Literal: Object()
data class LangLiteral(val value: String, val langTag: String): Literal()
data class StringLiteral(val value: String): Literal()
data class BooleanLiteral(val value: Boolean): Literal()
data class LongLiteral(val value: Long): Literal()
data class DoubleLiteral(val value: Double): Literal()

val a = Predicate("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")

data class Statement(val subject: Entity, val predicate: Predicate, val `object`: Object)
data class PersistedStatement(val collection: CollectionName, val statement: Statement, val context: AnonymousEntity)

sealed class Range<T>(open val start: T, open val end: T)
data class LangLiteralRange(override val start: LangLiteral, override val end: LangLiteral): Range<LangLiteral>(start, end)
data class StringLiteralRange(override val start: String, override val end: String): Range<String>(start, end)
data class LongLiteralRange(override val start: Long, override val end: Long): Range<Long>(start, end)
data class DoubleLiteralRange(override val start: Double, override val end: Double): Range<Double>(start, end)

interface LigatureStore {
    suspend fun readTx(): ReadTx
    suspend fun writeTx(): WriteTx
{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.006435643564356435, 'mean_word_length': 4.848046309696093, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6426307', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1100, 'n_words': 420}