<commit_before>package org.zanata

import org.concordion.integration.junit4.ConcordionRunner
import org.junit.After
import org.junit.runner.RunWith

// This is a quick and dirty way of generating an index page for all concordion tests.
@RunWith(ConcordionRunner)
class ZanataTest {

    @After
    void generateIndex() {
        URL url = Thread.currentThread().getContextClassLoader().getResource(getClass().name.replace('.', '/') + ".class");

        File currentDir = new File(url.getFile());

        def packagePath = getClass().getPackage().getName().replace('.', '/') + '/'

        def dirPath = "$currentDir.parentFile.absolutePath/"

        def htmls = []
        currentDir.getParentFile().eachFileRecurse {
            if (it.name.endsWith(".html")) {
                // because we write index.html to concordion output dir root,
                // we need to prepend package path of this class
                def relativePath = packagePath + (it.absolutePath - dirPath)
                htmls << "<li><a href='$relativePath'>$it.name</a></li>"
            }
        }

//        println(htmls)

        def links = htmls.join("\n")
        String content = """
            <html>
            <head><title>Concordion Tests</title></head>
            <body>
                <ul>
                    $links
                </ul>
            </body>
            </html>
        """

        def concordionOutputDir = System.getProperty("concordion.output.dir", "/tmp/concordion")

        def indexFile = new File(concordionOutputDir, "index.html")

        indexFile.withWriter {
            it.write(content)
        }
    }
}
<commit_msg>Fix hard-coded tmp path<commit_after>package org.zanata

import org.concordion.integration.junit4.ConcordionRunner
import org.junit.After
import org.junit.runner.RunWith

// This is a quick and dirty way of generating an index page for all concordion tests.
@RunWith(ConcordionRunner)
class ZanataTest {

    @After
    void generateIndex() {
        URL url = Thread.currentThread().getContextClassLoader().getResource(getClass().name.replace('.', '/') + ".class");

        File currentDir = new File(url.getFile());

        def packagePath = getClass().getPackage().getName().replace('.', '/') + '/'

        def dirPath = "$currentDir.parentFile.absolutePath/"

        def htmls = []
        currentDir.getParentFile().eachFileRecurse {
            if (it.name.endsWith(".html")) {
                // because we write index.html to concordion output dir root,
                // we need to prepend package path of this class
                def relativePath = packagePath + (it.absolutePath - dirPath)
                htmls << "<li><a href='$relativePath'>$it.name</a></li>"
            }
        }

//        println(htmls)

        def links = htmls.join("\n")
        String content = """
            <html>
            <head><title>Concordion Tests</title></head>
            <body>
                <ul>
                    $links
                </ul>
            </body>
            </html>
        """

        def concordionOutputDir = System.getProperty("concordion.output.dir",
                System.getProperty("java.io.tmpdir")+"/concordion")

        def indexFile = new File(concordionOutputDir, "index.html")

        indexFile.withWriter {
            it.write(content)
        }
    }
}

{'fraction_non_alphanumeric': 0.12905144216473388, 'fraction_numerical': 0.0005947071067499256, 'mean_word_length': 1.9743589743589745, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 31, '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': '4820160', 'n_tokens_mistral': 952, 'n_tokens_neox': 910, 'n_words': 205}