<commit_before>/*
 * Copyright 2014-2015 ChalkPE
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package pe.chalk.takoyaki;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.mozilla.javascript.RhinoException;
import pe.chalk.takoyaki.logger.Logger;
import pe.chalk.takoyaki.logger.LoggerStream;
import pe.chalk.takoyaki.plugin.JavaScriptPlugin;
import pe.chalk.takoyaki.plugin.Plugin;
import pe.chalk.takoyaki.target.Target;
import pe.chalk.takoyaki.utils.Prefix;
import pe.chalk.takoyaki.utils.TextFormat;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author ChalkPE <<EMAIL>>
 * @since 2015-04-07
 */
public class Takoyaki implements Prefix {
    public static final String VERSION = "2.2.2-SNAPSHOT";

    private static Takoyaki instance = null;
    private static final List<String> DEFAULT_CONFIG = Arrays.asList(
            "{",
            "  \"options\": {\"excludedPlugins\": [\"debug.js\"]},",
            "  \"targets\": [",
            "    {",
            "      \"type\": \"naver.cafe\",",
            "      \"address\": \"minecraftpe\",",
            "      \"prefix\": \"M.K\",",
            "      \"interval\": 2500,",
            "      \"timeout\": 5000,",
            "      \"filters\": [\"article\", \"commentary\", \"visitation\"],",
            "      \"naverAccount\": {\"username\": \"\", \"password\": \"\"}",
            "    },",
            "    {",
            "      \"type\": \"naver.cafe\",",
            "      \"address\": \"ourmcspace\",",
            "      \"prefix\": \"PMC\",",
            "      \"interval\": 5000,",
            "      \"timeout\": 5000,",
            "      \"filters\": [\"article\", \"commentary\", \"visitation\"],",
            "      \"naverAccount\": {\"username\": \"\", \"password\": \"\"}",
            "    }",
            "  ]",
            "}");

    private List<String> excludedPlugins;

    private List<Target> targets;
    private List<Plugin> plugins;
    private Logger logger;

    private boolean isAlive = false;
<commit_msg>Updated default configs<commit_after>/*
 * Copyright 2014-2015 ChalkPE
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package pe.chalk.takoyaki;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.mozilla.javascript.RhinoException;
import pe.chalk.takoyaki.logger.Logger;
import pe.chalk.takoyaki.logger.LoggerStream;
import pe.chalk.takoyaki.plugin.JavaScriptPlugin;
import pe.chalk.takoyaki.plugin.Plugin;
import pe.chalk.takoyaki.target.Target;
import pe.chalk.takoyaki.utils.Prefix;
import pe.chalk.takoyaki.utils.TextFormat;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author ChalkPE <<EMAIL>>
 * @since 2015-04-07
 */
public class Takoyaki implements Prefix {
    public static final String VERSION = "2.2.2-SNAPSHOT";

    private static Takoyaki instance = null;
    private static final List<String> DEFAULT_CONFIG = Arrays.asList(
            "{",
            "  \"options\": {\"excludedPlugins\": [\"debug.js\"]},",
            "  \"targets\": [",
            "    {",
            "      \"type\": \"naver.cafe\",",
            "      \"address\": \"minecraftpe\",",
            "      \"prefix\": \"M.K\",",
            "      \"interval\": 2500,",
            "      \"timeout\": 5000,",
            "      \"filters\": [\"article\", \"commentary\", \"visitation\"],",
            "      \"naverAccount\": {\"username\": \"\", \"password\": \"\"}",
            "    },",
            "    {",
            "      \"type\": \"naver.cafe\",",
            "      \"address\": \"ourmcspace\",",
            "      \"prefix\": \"PMC\",",
            "      \"interval\": 5000,",
            "      \"timeout\": 5000,",
            "      \"filters\": [\"article\", \"commentary\", \"visitation\"],",
            "      \"naverAccount\": {\"username\": \"\", \"password\": \"\"}",
            "    },",
            "    {",
            "      \"type\": \"namu.wiki\",",
            "      \"prefix\": \"N.W\",",
            "      \"interval\": 2500,",
            "      \"timeout\": 5000",
            "    }",
            "  ]",
            "}");

    private List<String> excludedPlugins;

    private List<Target> targets;
    private List<Plugin> plugins;
    private Logger logger;

    private boolean isAlive = false;

{'fraction_non_alphanumeric': 0.1643653302279155, 'fraction_numerical': 0.014307103643320579, 'mean_word_length': 2.2444684295736645, 'pattern_counts': {'":': 46, '<': 15, '<?xml version=': 0, '>': 15, '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': '2009461', 'n_tokens_mistral': 1828, 'n_tokens_neox': 1772, 'n_words': 432}