<commit_before>package oracle.markov;

import oracle.MarkovManager;
import oracle.Oracle;
import oracle.Settings;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Optional;
import java.util.stream.IntStream;

/**
 * Created by raminsoleymani on 03/10/16.
 */
public class Markov {

    Oracle oracle;
    private ArrayList<MarkovManager> markovs = new ArrayList<>();

    public Markov(Oracle oracle) {
        this.oracle = oracle;
        System.out.println("MARKOV");
        loadMarkovs(); // can be changed if u wanna speed or selections... for just load all our stuff
    }

    public void loadMarkovs() {
        loadMarkovs(-1);
    }

    public void loadAuthor(String author){
        MarkovManager m = new MarkovManager();
        m.load(author);
        markovs.add(m);
    }

    public void loadMarkovs(final int number) {
        String[] files = oracle.loadStrings("authors.txt");
        markovs = new ArrayList<>();
        // I removed some load "oraclev2" comment here
        // TODO this was training stuff. bring it back

        IntStream.range(0,files.length)
                .filter(i -> number == -1 || i < number)
                .forEach(i -> loadAuthor(files[i]));
    }

    public Optional<String[]> askLocalMarkov(String text) {<commit_msg>removes CLI LINE_RREFIX from markov input text<commit_after>package oracle.markov;

import oracle.MarkovManager;
import oracle.Oracle;
import oracle.Settings;
import oracle.cli.CLI;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Optional;
import java.util.stream.IntStream;

/**
 * Created by raminsoleymani on 03/10/16.
 */
public class Markov {

    Oracle oracle;
    private ArrayList<MarkovManager> markovs = new ArrayList<>();

    public Markov(Oracle oracle) {
        this.oracle = oracle;
        System.out.println("MARKOV");
        loadMarkovs(); // can be changed if u wanna speed or selections... for just load all our stuff
    }

    public void loadMarkovs() {
        loadMarkovs(-1);
    }

    public void loadAuthor(String author){
        MarkovManager m = new MarkovManager();
        m.load(author);
        markovs.add(m);
    }

    public void loadMarkovs(final int number) {
        String[] files = oracle.loadStrings("authors.txt");
        markovs = new ArrayList<>();
        // I removed some load "oraclev2" comment here
        // TODO this was training stuff. bring it back

        IntStream.range(0,files.length)
                .filter(i -> number == -1 || i < number)
                .forEach(i -> loadAuthor(files[i]));
    }

    public Optional<String[]> askLocalMarkov(String text) {
        text = text.replace( CLI.LINE_PREFIX_CHARS, "");
{'fraction_non_alphanumeric': 0.11460258780036968, 'fraction_numerical': 0.0073937153419593345, 'mean_word_length': 2.6666666666666665, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, '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': '5615183', 'n_tokens_mistral': 834, 'n_tokens_neox': 776, 'n_words': 223}