<commit_before>package org.uct.cs.simplify.simplifier;

import org.uct.cs.simplify.util.OSDetect;
import org.uct.cs.simplify.util.TempFileManager;

import java.io.*;

public class SimplifierWrapper
{
    private static final String PATH_TO_EXECUTABLE = "./simplifier/" + (OSDetect.isWindows ? "tridecimator_win.exe" : "tridecimator_unix");

    public static File simplify(File input, long numFaces, boolean preserveBoundary) throws IOException, InterruptedException
    {
        File tt = TempFileManager.provide("simp", ".ply");
        System.out.printf("Simplifying %s to %s...%n", input.getPath(), tt.getPath());
        Runtime r = Runtime.getRuntime();

        String flags = "";
        if (preserveBoundary) flags += " -By";

        Process proc = r.exec(
            String.format(
                "%s %s %s %d" + flags,
                PATH_TO_EXECUTABLE,
                input.getAbsolutePath(),<commit_msg>Add -P option to simplifier<commit_after>package org.uct.cs.simplify.simplifier;

import org.uct.cs.simplify.util.OSDetect;
import org.uct.cs.simplify.util.TempFileManager;

import java.io.*;

public class SimplifierWrapper
{
    private static final String PATH_TO_EXECUTABLE = "./simplifier/" + (OSDetect.isWindows ? "tridecimator_win.exe" : "tridecimator_unix");

    public static File simplify(File input, long numFaces, boolean preserveBoundary) throws IOException, InterruptedException
    {
        File tt = TempFileManager.provide("simp", ".ply");
        System.out.printf("Simplifying %s to %s...%n", input.getPath(), tt.getPath());
        Runtime r = Runtime.getRuntime();

        String flags = " -P";
        if (preserveBoundary) flags += " -By";

        Process proc = r.exec(
            String.format(
                "%s %s %s %d" + flags,
                PATH_TO_EXECUTABLE,
                input.getAbsolutePath(),
{'fraction_non_alphanumeric': 0.12573885008060182, 'fraction_numerical': 0.0, 'mean_word_length': 2.879166666666667, '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': '2139627', 'n_tokens_mistral': 594, 'n_tokens_neox': 557, 'n_words': 128}