<commit_before>package org.jpc;

import java.lang.reflect.Type;
import java.util.List;

import org.jconverter.JConverter;
import org.jconverter.factory.FactoryManager;
import org.jpc.converter.JpcConverterManager;
import org.jpc.term.Compound;
import org.jpc.term.ListTerm;
import org.jpc.term.Term;
import org.jpc.term.jterm.JTermManager;

/**
 * A class providing an interface for the main JPC functionality (such as converting between terms and Java objects)
 * @author sergioc
 *
 */
public abstract class Jpc extends JConverter {
	
	public Jpc(JpcConverterManager converterManager, FactoryManager factoryManager) {
		super(converterManager, factoryManager);
	}
	
	public abstract <T> T fromTerm(Term term);
	
	public abstract <T> T fromTerm(Term term, Type type);
	
	public abstract <T extends Term> T toTerm(Object object);
	
	public abstract <T extends Term> T toTerm(Object object, Class<T> termClass);
	
	public abstract Compound toCompound(Object name, List<?> args);
	
	public abstract ListTerm listTerm(Object ...objects);
	
	public abstract ListTerm listTerm(List<?> objects);

	/**
	 * 
	 * @param object the object which conversion target type to infer.
	 * @return the inferred type.
	 */
	public abstract Type getType(Object object);<commit_msg>adding a default static jpc context<commit_after>package org.jpc;

import java.lang.reflect.Type;
import java.util.List;

import org.jconverter.JConverter;
import org.jconverter.factory.FactoryManager;
import org.jpc.converter.JpcConverterManager;
import org.jpc.term.Compound;
import org.jpc.term.ListTerm;
import org.jpc.term.Term;
import org.jpc.term.jterm.JTermManager;

/**
 * A class providing an interface for the main JPC functionality (such as converting between terms and Java objects)
 * @author sergioc
 *
 */
public abstract class Jpc extends JConverter {
	
	private static Jpc defaultJpc;
	
	public static Jpc getDefault() {
		if(defaultJpc == null)
			setDefault(new DefaultJpc());
		return defaultJpc;
	}
	
	public static void setDefault(Jpc jpc) {
		defaultJpc = jpc;
	}
	
	public Jpc(JpcConverterManager converterManager, FactoryManager factoryManager) {
		super(converterManager, factoryManager);
	}
	
	public abstract <T> T fromTerm(Term term);
	
	public abstract <T> T fromTerm(Term term, Type type);
	
	public abstract <T extends Term> T toTerm(Object object);
	
	public abstract <T extends Term> T toTerm(Object object, Class<T> termClass);
	
	public abstract Compound toCompound(Object name, List<?> args);
	
	public abstract ListTerm listTerm(Object ...objects);
	
	public abstract ListTerm listTerm(List<?> objects);

	/**
	 * 
	 * @param object the object which conversion target type to infer.
	 * @return the inferred type.
	 */
	public abstract Type getType(Object object);
{'fraction_non_alphanumeric': 0.09367088607594937, 'fraction_numerical': 0.0, 'mean_word_length': 4.726708074534161, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '2989527', 'n_tokens_mistral': 860, 'n_tokens_neox': 798, 'n_words': 267}