// Path: core/src/main/java/org/soluvas/sanad/core/AsciidocUtils.java
// public class AsciidocUtils {
// 
// 	static final Pattern NOT_PRINT = Pattern.compile("([\\p{Punct}\\p{Cntrl}\\p{Sc}]|\\P{Print})+", Pattern.UNICODE_CHARACTER_CLASS);
// 	static final Pattern WHITESPACE = Pattern.compile("\\s+", Pattern.UNICODE_CHARACTER_CLASS);
// 	
// 	/**
// 	 * Normalize with Unicode aware.
// 	 * @param adoc
// 	 * @return
// 	 */
// 	public static String normalize(String adoc) {
// 		String normalized = Normalizer.normalize(adoc, Normalizer.Form.NFC);
// 		normalized = adoc.toLowerCase(Locale.ROOT);
// 		normalized = NOT_PRINT.matcher(adoc).replaceAll(" ");
// 		normalized = WHITESPACE.matcher(adoc).replaceAll(" ");
// 		normalized = normalized.trim();
// 		return normalized;
// 	}
// 	
// }


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.soluvas.sanad.core.AsciidocUtils;
import com.google.common.html.HtmlEscapers;
	 * href="http://tools.ietf.org/html/bcp47">IETF BCP 47</a>. <!--
	 * end-model-doc -->
	 * 
	 * @param newInLanguage
	 *            the new value of the '{@link Literal#getInLanguage()
	 *            inLanguage}' feature.
	 * @generated
	 */
	public void setInLanguage(String newInLanguage) {
		inLanguage = newInLanguage;
	}

	/**
	 * A toString method which prints the values of all EAttributes of this
	 * instance. <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */
	@Override
	public String toString() {
		return "Literal " + " [normalized: " + getNormalized() + "]"
				+ " [numeronym: " + getNumeronym() + "]" + " [inLanguage: "
				+ getInLanguage() + "]" + " [adoc: " + getAdoc() + "]"
				+ " [html: " + getHtml() + "]" + " [translator: "
				+ getTranslator() + "]";
	}

	public void assignAdoc(String adoc) {
		setAdoc(adoc);
		setHtml(HtmlEscapers.htmlEscaper().escape(adoc));
// Path: core/src/main/java/org/soluvas/sanad/core/AsciidocUtils.java
// public class AsciidocUtils {
// 
// 	static final Pattern NOT_PRINT = Pattern.compile("([\\p{Punct}\\p{Cntrl}\\p{Sc}]|\\P{Print})+", Pattern.UNICODE_CHARACTER_CLASS);
// 	static final Pattern WHITESPACE = Pattern.compile("\\s+", Pattern.UNICODE_CHARACTER_CLASS);
// 	
// 	/**
// 	 * Normalize with Unicode aware.
// 	 * @param adoc
// 	 * @return
// 	 */
// 	public static String normalize(String adoc) {
// 		String normalized = Normalizer.normalize(adoc, Normalizer.Form.NFC);
// 		normalized = adoc.toLowerCase(Locale.ROOT);
// 		normalized = NOT_PRINT.matcher(adoc).replaceAll(" ");
// 		normalized = WHITESPACE.matcher(adoc).replaceAll(" ");
// 		normalized = normalized.trim();
// 		return normalized;
// 	}
// 	
// }


// Path: core/src/main/java/org/soluvas/sanad/core/jpa/Literal.java
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.soluvas.sanad.core.AsciidocUtils;
import com.google.common.html.HtmlEscapers;

	 * href="http://tools.ietf.org/html/bcp47">IETF BCP 47</a>. <!--
	 * end-model-doc -->
	 * 
	 * @param newInLanguage
	 *            the new value of the '{@link Literal#getInLanguage()
	 *            inLanguage}' feature.
	 * @generated
	 */
	public void setInLanguage(String newInLanguage) {
		inLanguage = newInLanguage;
	}

	/**
	 * A toString method which prints the values of all EAttributes of this
	 * instance. <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */
	@Override
	public String toString() {
		return "Literal " + " [normalized: " + getNormalized() + "]"
				+ " [numeronym: " + getNumeronym() + "]" + " [inLanguage: "
				+ getInLanguage() + "]" + " [adoc: " + getAdoc() + "]"
				+ " [html: " + getHtml() + "]" + " [translator: "
				+ getTranslator() + "]";
	}

	public void assignAdoc(String adoc) {
		setAdoc(adoc);
		setHtml(HtmlEscapers.htmlEscaper().escape(adoc));
		setNormalized(AsciidocUtils.normalize(adoc));