<commit_before>package cafe.test;

import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.util.List;

import cafe.image.png.PNGTweaker;
import cafe.image.png.Chunk;
import cafe.image.png.ChunkType;
import cafe.image.png.TextBuilder;
import cafe.io.IOUtils;

public class TestPNGTweaker {
	/** PNG signature constant */
    private static final long SIGNATURE = 0x89504E470D0A1A0AL;
    
	public static void main(String[] args) throws Exception {
	    String text = PNGTweaker.read_text_chunks(args[0]);
		System.out.print(text);
        System.out.println("=================================");        
       
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
        	    new FileOutputStream("textinfo.txt"), "UTF-8"));
       	try {
        	    out.write(text);
       	} finally {
        	    out.close();
       	}         	
     
        TextBuilder builder = new TextBuilder(ChunkType.ITXT).keyword("Author").text("<NAME>");
        Chunk authorChunk = builder.build();
        builder.keyword("Software").text("PNGTweaker 1.0");
        Chunk softwareChunk = builder.build();
        builder.keyword("Copyright").text("Copyright 2014 <NAME>\nat Actuate Inc.");
        Chunk copyrightChunk = builder.build();
        
        Chunk[] chunks = new Chunk[] {authorChunk, softwareChunk, copyrightChunk};
        PNGTweaker.dump_text_chunks(chunks);
        
        FileInputStream fi = new FileInputStream(args[0]);
        FileOutputStream fo = new FileOutputStream("NEW.png");
        
        PNGTweaker.insertChunks(chunks,	fi, fo);<commit_msg>Copyright field change<commit_after>package cafe.test;

import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.util.List;

import cafe.image.png.PNGTweaker;
import cafe.image.png.Chunk;
import cafe.image.png.ChunkType;
import cafe.image.png.TextBuilder;
import cafe.io.IOUtils;

public class TestPNGTweaker {
	/** PNG signature constant */
    private static final long SIGNATURE = 0x89504E470D0A1A0AL;
    
	public static void main(String[] args) throws Exception {
	    String text = PNGTweaker.read_text_chunks(args[0]);
		System.out.print(text);
        System.out.println("=================================");        
       
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
        	    new FileOutputStream("textinfo.txt"), "UTF-8"));
       	try {
        	    out.write(text);
       	} finally {
        	    out.close();
       	}         	
     
        TextBuilder builder = new TextBuilder(ChunkType.ITXT).keyword("Author").text("<NAME>");
        Chunk authorChunk = builder.build();
        builder.keyword("Software").text("PNGTweaker 1.0");
        Chunk softwareChunk = builder.build();
        builder.keyword("Copyright").text("Copyright 2015 <NAME> (<EMAIL>).");
        Chunk copyrightChunk = builder.build();
        
        Chunk[] chunks = new Chunk[] {authorChunk, softwareChunk, copyrightChunk};
        PNGTweaker.dump_text_chunks(chunks);
        
        FileInputStream fi = new FileInputStream(args[0]);
        FileOutputStream fo = new FileOutputStream("NEW.png");
        
        PNGTweaker.insertChunks(chunks,	fi, fo);
{'fraction_non_alphanumeric': 0.1346326836581709, 'fraction_numerical': 0.012593703148425787, 'mean_word_length': 3.033857315598549, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '6867496', 'n_tokens_mistral': 1005, 'n_tokens_neox': 948, 'n_words': 194}