<commit_before>/**
 * Cleave - A tool to break apart English text.
 *
 * Written in 2014 by <NAME> <<EMAIL>>
 *
 * To the extent possible under law, the author(s) have dedicated all copyright
 * and related and neighboring rights to this software to the public domain
 * worldwide. This software is distributed without any warranty.
 *
 * You should have received a copy of the CC0 Public Domain Dedication along
 * with this software. If not, see
 * <http://creativecommons.org/publicdomain/zero/1.0/>.
 */

package com.groundrise.cleave;

import java.io.PrintStream;

/**
 * Receives words, one character at a time and outputs those words onto the
 * given print stream.
 *
 * On output:
 * - characters are separated by spaces " "
 * - words are delimited by newlines "\n"
 * - lines are delimited by a blank line "\n"
 *
 * @author <NAME> (<EMAIL>)
 */
class ReceiveIntoStream implements Receiver {

    /**
     * State machine states.
     */
    private enum Input { START, CHAR, WORD }

    /**
     * Stream to write output to.
     */
    private final PrintStream out;

    /**
     * Keep track of state changes.
     */
    private Input last = Input.START;

    /**
     * Construct a receiver stream that will write output to the given
     * PrintStream.
     * @param out Stream to write to
     */
    ReceiveIntoStream(final PrintStream out) {
        this.out = out;
    }

    @Override
    public void addChar(final String c) {
        this.out.append(c);
        this.out.append('\n');
        this.last = Input.CHAR;
    }

    @Override
    public void endWord() {
        if (Input.CHAR == this.last) {
            this.out.append(' ');
            this.out.append('\n');
        }
        this.last = Input.WORD;
    }
<commit_msg>Unhide parameter from member variable.<commit_after>/**
 * Cleave - A tool to break apart English text.
 *
 * Written in 2014 by <NAME> <<EMAIL>>
 *
 * To the extent possible under law, the author(s) have dedicated all copyright
 * and related and neighboring rights to this software to the public domain
 * worldwide. This software is distributed without any warranty.
 *
 * You should have received a copy of the CC0 Public Domain Dedication along
 * with this software. If not, see
 * <http://creativecommons.org/publicdomain/zero/1.0/>.
 */

package com.groundrise.cleave;

import java.io.PrintStream;

/**
 * Receives words, one character at a time and outputs those words onto the
 * given print stream.
 *
 * On output:
 * - characters are separated by spaces " "
 * - words are delimited by newlines "\n"
 * - lines are delimited by a blank line "\n"
 *
 * @author <NAME> (<EMAIL>)
 */
class ReceiveIntoStream implements Receiver {

    /**
     * State machine states.
     */
    private enum Input { START, CHAR, WORD }

    /**
     * Stream to write output to.
     */
    private final PrintStream out;

    /**
     * Keep track of state changes.
     */
    private Input last = Input.START;

    /**
     * Construct a receiver stream that will write output to the given
     * PrintStream.
     * @param out Stream to write to
     */
    ReceiveIntoStream(final PrintStream ps) {
        this.out = ps;
    }

    @Override
    public void addChar(final String c) {
        this.out.append(c);
        this.out.append('\n');
        this.last = Input.CHAR;
    }

    @Override
    public void endWord() {
        if (Input.CHAR == this.last) {
            this.out.append(' ');
            this.out.append('\n');
        }
        this.last = Input.WORD;
    }

{'fraction_non_alphanumeric': 0.1065272675897146, 'fraction_numerical': 0.003955919751342187, 'mean_word_length': 2.352272727272727, 'pattern_counts': {'":': 0, '<': 15, '<?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': '934555', 'n_tokens_mistral': 1038, 'n_tokens_neox': 999, 'n_words': 376}