<commit_before>package org.analogweb.core.response;

import java.util.Map;

import org.analogweb.ResponseFormatter;
import org.analogweb.util.Assertion;

/**
 * @author snowgoose
 */
public class Html extends TextFormattable<Html> {

    private static final String DEFAULT_HTML_CHARSET = "UTF-8";
    private static final String DEFAULT_HTML_CONTENT_TYPE = "text/html";

    public static Html as(String templatePath,Map<String,Object> context) {
        Html html = new Html(new HtmlTemplate(templatePath, context));
        return html;
    }

    public static class HtmlTemplate {
        private String templateResourcePath;
        private Map<String,Object> context;
        public HtmlTemplate(String templateResourcePath,Map<String,Object> context){
            Assertion.notNull(templateResourcePath, "Template resource path");
            this.templateResourcePath = templateResourcePath;
            this.context = context;
        }
        public String getTemplateResource() {
            return templateResourcePath;
        }
        public Map<String, Object> getContext() {
            return context;
        }
    }

    @SuppressWarnings("unchecked")
    public static Html with(String str) {
        Html html = new Html(str);
        return html;
    }

    protected Html(Object source) {
        super(source);
        super.typeAs(DEFAULT_HTML_CONTENT_TYPE);
        super.withCharset(DEFAULT_HTML_CHARSET);
    }

    protected Html(String input) {
        super(input);
        super.typeAs(DEFAULT_HTML_CONTENT_TYPE);
        super.withCharset(DEFAULT_HTML_CHARSET);
    }

    @Override
    protected ResponseFormatter getDefaultFormatter() {
        // TODO Implement!
        throw new UnsupportedOperationException();
    }

}<commit_msg>Add Constractor<commit_after>package org.analogweb.core.response;

import java.util.Map;

import org.analogweb.ResponseFormatter;
import org.analogweb.util.Assertion;
import org.analogweb.util.Maps;

/**
 * @author snowgoose
 */
public class Html extends TextFormattable<Html> {

	private static final String DEFAULT_HTML_CHARSET = "UTF-8";
	private static final String DEFAULT_HTML_CONTENT_TYPE = "text/html";

	public static Html as(String templatePath) {
		Html html = new Html(new HtmlTemplate(templatePath,
				Maps.<String, Object> newEmptyHashMap()));
		return html;
	}

	public static Html as(String templatePath, Map<String, Object> context) {
		Html html = new Html(new HtmlTemplate(templatePath, context));
		return html;
	}

	public static class HtmlTemplate {
		private String templateResourcePath;
		private Map<String, Object> context;

		public HtmlTemplate(String templateResourcePath,
				Map<String, Object> context) {
			Assertion.notNull(templateResourcePath, "Template resource path");
			this.templateResourcePath = templateResourcePath;
			this.context = context;
		}

		public String getTemplateResource() {
			return templateResourcePath;
		}

		public Map<String, Object> getContext() {
			return context;
		}
	}

	@SuppressWarnings("unchecked")
	public static Html with(String str) {
		Html html = new Html(str);
		return html;
	}

	protected Html(Object source) {
		super(source);
		super.typeAs(DEFAULT_HTML_CONTENT_TYPE);
		super.withCharset(DEFAULT_HTML_CHARSET);
	}

	protected Html(String input) {
		super(input);
		super.typeAs(DEFAULT_HTML_CONTENT_TYPE);
		super.withCharset(DEFAULT_HTML_CHARSET);
	}

	@Override
	protected ResponseFormatter getDefaultFormatter() {
		// TODO Implement!
		throw new UnsupportedOperationException();
	}

}
{'fraction_non_alphanumeric': 0.09080654258319233, 'fraction_numerical': 0.0005640157924421884, 'mean_word_length': 3.748326639892905, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '5039037', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1018, 'n_words': 237}