<commit_before>package jp.co.qoncept.kaja

import jp.co.qoncept.util.Result
import jp.co.qoncept.util.ap
import jp.co.qoncept.util.flatMap
import jp.co.qoncept.util.mp
import org.testng.Assert.*
import org.testng.annotations.AfterClass
import org.testng.annotations.BeforeClass
import org.testng.annotations.Test
import java.io.File

class JsonTest {
    class ExampleTest {
        @Test
        fun testExample() {
            data class Person(
                    val firstName: String,
                    val lastName: String,
                    val age: Int
            )

            val jsonString = """
            | {
            |   "firstName": "Albert",
            |   "lastName": "Einstein",
            |   "age": 28
            | }
            """

            val json: Result<Json, JsonException>
                    = Json.parse(jsonString)

            val person: Result<Person, JsonException>
                    = curry(::Person) mp
                        json["firstName"].string ap
                        json["lastName"] .string ap<commit_msg>Fix `testExample`<commit_after>package jp.co.qoncept.kaja

import jp.co.qoncept.util.Result
import jp.co.qoncept.util.ap
import jp.co.qoncept.util.flatMap
import jp.co.qoncept.util.mp
import org.testng.Assert.*
import org.testng.annotations.AfterClass
import org.testng.annotations.BeforeClass
import org.testng.annotations.Test
import java.io.File

class JsonTest {
    class ExampleTest {
        @Test
        fun testExample() {
            data class Person(
                    val firstName: String,
                    val lastName: String,
                    val age: Int
            )

            val jsonString = """{
                |  "firstName": "Albert",
                |  "lastName": "Einstein",
                |  "age": 28
                |}""".trimMargin()

            val json: Result<Json, JsonException>
                    = Json.parse(jsonString)

            val person: Result<Person, JsonException>
                    = curry(::Person) mp
                        json["firstName"].string ap
                        json["lastName"] .string ap
{'fraction_non_alphanumeric': 0.10051186598417869, 'fraction_numerical': 0.0018613308515588647, 'mean_word_length': 1.5656324582338903, 'pattern_counts': {'":': 6, '<': 7, '<?xml version=': 0, '>': 7, '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': '1063466', 'n_tokens_mistral': 620, 'n_tokens_neox': 585, 'n_words': 127}