<commit_before>package owltools.cli.sim2;

import org.junit.Test;

import owltools.cli.AbstractCommandRunnerTest;
import owltools.cli.CommandRunner;
import owltools.cli.Sim2CommandRunner;

/**
 * Tests for {@link CommandRunner}.
 * 
 * these are somewhat ad-hoc at the moment - output is written to stdout;
 * no attempt made to check results
 * 
 */
public class Sim2CommandRunnerTest extends AbstractCommandRunnerTest {
	
	protected void init() {
		runner = new Sim2CommandRunner();
	}

	
	@Test
	public void testSimRunnerMouse100() throws Exception {
		init();
		load("mp.obo");
		run("--load-instances "+path("mgi-g2p-100.txt"));
		run("--load-labels "+path("mgi-labels.txt"));
		//run("--sim-compare-atts -p "+path("test-sim.properties"));
		run("--sim-compare-atts");
		run("--sim-basic -p "+path("test-sim.properties") + " -o target/test100.out");

	}

	@Test
	public void testSimRunnerMouse100WithCache() throws Exception {
		init();
		load("mp.obo");
		run("--load-instances "+path("mgi-g2p-100.txt"));
		run("--load-labels "+path("mgi-labels.txt"));
		//load("Mus_musculus-label.owl");
		//load("Mus_musculus-label.obo");
		run("--sim-compare-atts -p "+path("test-sim.properties"));
		run("--sim-save-lcs-cache -m 2.0 target/lcs-cache");
		run("--sim-save-ic-cache target/ic-cache.ttl");

		//create a variety of sim property files and test here
    //this one tests that it runs with the default properties
		run("--sim-basic -p "+path("test-sim.properties") + " -o target/test100.out");
		//run("--sim-basic");
		
		init();
		load("mp.obo");
		run("--load-instances "+path("mgi-g2p-100.txt"));
		run("--load-labels "+path("mgi-labels.txt"));
		
		//run("-o -f obo /tmp/foo.obo");	
		run("--sim-load-lcs-cache target/lcs-cache");
		run("--sim-load-ic-cache target/ic-cache.ttl");
		//TODO
		//run("--sim-basic -p "+path("test-sim.properties") + " -o target/test100run2.out");


	}
	
	@Test
	public void testSimRunnerDefaultPropertiesFile() throws Exception {
    //will load the default properties file
		init();
		load("mp.obo");
		run("--load-instances "+path("mgi-g2p-100.txt"));
		run("--load-labels "+path("mgi-labels.txt"));
		run("--sim-basic -p "+path("default-sim.properties")+ " -o target/test100.default-sim.out");	
		run("--show-sim-properties");
//		run("--sim-basic -o target/test100.default.out");		
	}
	
	@Test
	public void testSimRunnerDefaultProperties() throws Exception {<commit_msg>restoring test, now works<commit_after>package owltools.cli.sim2;

import org.junit.Test;

import owltools.cli.AbstractCommandRunnerTest;
import owltools.cli.CommandRunner;
import owltools.cli.Sim2CommandRunner;

/**
 * Tests for {@link CommandRunner}.
 * 
 * these are somewhat ad-hoc at the moment - output is written to stdout;
 * no attempt made to check results
 * 
 */
public class Sim2CommandRunnerTest extends AbstractCommandRunnerTest {
	
	protected void init() {
		runner = new Sim2CommandRunner();
	}

	
	@Test
	public void testSimRunnerMouse100() throws Exception {
		init();
		load("mp.obo");
		run("--load-instances "+path("mgi-g2p-100.txt"));
		run("--load-labels "+path("mgi-labels.txt"));
		//run("--sim-compare-atts -p "+path("test-sim.properties"));
		run("--sim-compare-atts");
		run("--sim-basic -p "+path("test-sim.properties") + " -o target/test100.out");

	}

	@Test
	public void testSimRunnerMouse100WithCache() throws Exception {
		init();
		load("mp.obo");
		run("--load-instances "+path("mgi-g2p-100.txt"));
		run("--load-labels "+path("mgi-labels.txt"));
		//load("Mus_musculus-label.owl");
		//load("Mus_musculus-label.obo");
		run("--sim-compare-atts -p "+path("test-sim.properties"));
		run("--sim-save-lcs-cache -m 2.0 target/lcs-cache");
		run("--sim-save-ic-cache target/ic-cache.ttl");

		//create a variety of sim property files and test here
    //this one tests that it runs with the default properties
		run("--sim-basic -p "+path("test-sim.properties") + " -o target/test100.out");
		//run("--sim-basic");
		
		init();
		load("mp.obo");
		run("--load-instances "+path("mgi-g2p-100.txt"));
		run("--load-labels "+path("mgi-labels.txt"));
		
		//run("-o -f obo /tmp/foo.obo");	
		run("--sim-load-lcs-cache target/lcs-cache");
		run("--sim-load-ic-cache target/ic-cache.ttl");
		//TODO
		run("--sim-basic -p "+path("test-sim.properties") + " -o target/test100run2.out");


	}
	
	@Test
	public void testSimRunnerDefaultPropertiesFile() throws Exception {
    //will load the default properties file
		init();
		load("mp.obo");
		run("--load-instances "+path("mgi-g2p-100.txt"));
		run("--load-labels "+path("mgi-labels.txt"));
		run("--sim-basic -p "+path("default-sim.properties")+ " -o target/test100.default-sim.out");	
		run("--show-sim-properties");
//		run("--sim-basic -o target/test100.default.out");		
	}
	
	@Test
	public void testSimRunnerDefaultProperties() throws Exception {
{'fraction_non_alphanumeric': 0.19946258784621745, 'fraction_numerical': 0.018189334435717238, 'mean_word_length': 3.688953488372093, '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': '984367', 'n_tokens_mistral': 1855, 'n_tokens_neox': 1676, 'n_words': 335}