// Path: core/src/main/java/net/vhati/openuhs/core/markup/DecoratedFragment.java
// public class DecoratedFragment {
// 	public String fragment = null;
// 	public String[] attributes = null;
// 	public Map[] argMaps = null;
// 
// 
// 	public DecoratedFragment( String fragment, String[] attributes, Map[] argMaps ) {
// 		this.fragment = fragment;
// 		this.attributes = attributes;
// 		this.argMaps = argMaps;
// 	}
// }
// 
// Path: core/src/main/java/net/vhati/openuhs/core/markup/Decoration.java
// public class Decoration {
// 	public String name = null;
// 	public char[] prefix = null;
// 	public char[] suffix = null;
// 
// 
// 	public Decoration( String name, char[] prefix, char[] suffix ) {
// 		this.name = name;
// 		this.prefix = prefix;
// 		this.suffix = suffix;
// 	}
// 
// 	public boolean prefixMatches( char[] s, int index ) {
// 		if ( prefix == null || prefix.length == 0 ) return false;
// 		if ( index + prefix.length > s.length ) return false;
// 		for ( int i=0; i < prefix.length; i++ ) {
// 			if ( prefix[i] != s[index+i] ) return false;
// 		}
// 		return true;
// 	}
// 
// 	public boolean suffixMatches( char[] s, int index ) {
// 		if ( suffix == null || suffix.length == 0 ) return false;
// 		if ( index + suffix.length > s.length ) return false;
// 		for ( int i=0; i < suffix.length; i++ ) {
// 			if ( suffix[i] != s[index+i] ) return false;
// 		}
// 		return true;
// 	}
// }
// 
// Path: core/src/main/java/net/vhati/openuhs/core/markup/StringDecorator.java
// public abstract class StringDecorator {
// 	/** The sequence representing line breaks, as expected from the parser. */
// 	public static final char[] linebreak = new char[] {'^','b','r','e','a','k','^'};
// 
// 
// 	public abstract DecoratedFragment[] getDecoratedString( String rawContent );
// }


import java.util.Arrays;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.vhati.openuhs.core.markup.DecoratedFragment;
import net.vhati.openuhs.core.markup.Decoration;
import net.vhati.openuhs.core.markup.StringDecorator;
	private static final char[] diaeresisAccent = new char[] {'Ä','Ë','Ï','Ö','Ü','ä','ë','ï','ö','ü'};
	private static final char[] diaeresisNormal = new char[] {'A','E','I','O','U','a','e','i','o','u'};
	private static final char[] acuteMarkup = new char[] {'\''};
	private static final char[] acuteAccent = new char[] {'Á','É','Í','Ó','Ú','á','é','í','ó','ú'};
	private static final char[] acuteNormal = new char[] {'A','E','I','O','U','a','e','i','o','u'};
	private static final char[] graveMarkup = new char[] {'`'};
	private static final char[] graveAccent = new char[] {'À','È','Ì','Ò','Ù','à','è','ì','ò','ù'};
	private static final char[] graveNormal = new char[] {'A','E','I','O','U','a','e','i','o','u'};
	private static final char[] circumflexMarkup = new char[] {'^'};
	private static final char[] circumflexAccent = new char[] {'Â','Ê','Î','Ô','Û','â','ê','î','ô','û'};
	private static final char[] circumflexNormal = new char[] {'A','E','I','O','U','a','e','i','o','u'};
	private static final char[] tildeMarkup = new char[] {'~'};
	private static final char[] tildeAccent = new char[] {'Ñ','ñ'};
	private static final char[] tildeNormal = new char[] {'N','n'};

	private static final char[][][] accents = new char[][][] {
		{diaeresisMarkup, diaeresisAccent, diaeresisNormal},
		{acuteMarkup, acuteAccent, acuteNormal},
		{graveMarkup, graveAccent, graveNormal},
		{circumflexMarkup, circumflexAccent, circumflexNormal},
		{tildeMarkup, tildeAccent, tildeNormal}
	};


	public Version9xStringDecorator() {
		super();
	}


	@Override
// Path: core/src/main/java/net/vhati/openuhs/core/markup/DecoratedFragment.java
// public class DecoratedFragment {
// 	public String fragment = null;
// 	public String[] attributes = null;
// 	public Map[] argMaps = null;
// 
// 
// 	public DecoratedFragment( String fragment, String[] attributes, Map[] argMaps ) {
// 		this.fragment = fragment;
// 		this.attributes = attributes;
// 		this.argMaps = argMaps;
// 	}
// }
// 
// Path: core/src/main/java/net/vhati/openuhs/core/markup/Decoration.java
// public class Decoration {
// 	public String name = null;
// 	public char[] prefix = null;
// 	public char[] suffix = null;
// 
// 
// 	public Decoration( String name, char[] prefix, char[] suffix ) {
// 		this.name = name;
// 		this.prefix = prefix;
// 		this.suffix = suffix;
// 	}
// 
// 	public boolean prefixMatches( char[] s, int index ) {
// 		if ( prefix == null || prefix.length == 0 ) return false;
// 		if ( index + prefix.length > s.length ) return false;
// 		for ( int i=0; i < prefix.length; i++ ) {
// 			if ( prefix[i] != s[index+i] ) return false;
// 		}
// 		return true;
// 	}
// 
// 	public boolean suffixMatches( char[] s, int index ) {
// 		if ( suffix == null || suffix.length == 0 ) return false;
// 		if ( index + suffix.length > s.length ) return false;
// 		for ( int i=0; i < suffix.length; i++ ) {
// 			if ( suffix[i] != s[index+i] ) return false;
// 		}
// 		return true;
// 	}
// }
// 
// Path: core/src/main/java/net/vhati/openuhs/core/markup/StringDecorator.java
// public abstract class StringDecorator {
// 	/** The sequence representing line breaks, as expected from the parser. */
// 	public static final char[] linebreak = new char[] {'^','b','r','e','a','k','^'};
// 
// 
// 	public abstract DecoratedFragment[] getDecoratedString( String rawContent );
// }


// Path: core/src/main/java/net/vhati/openuhs/core/markup/Version9xStringDecorator.java
import java.util.Arrays;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.vhati.openuhs.core.markup.DecoratedFragment;
import net.vhati.openuhs.core.markup.Decoration;
import net.vhati.openuhs.core.markup.StringDecorator;

	private static final char[] diaeresisAccent = new char[] {'Ä','Ë','Ï','Ö','Ü','ä','ë','ï','ö','ü'};
	private static final char[] diaeresisNormal = new char[] {'A','E','I','O','U','a','e','i','o','u'};
	private static final char[] acuteMarkup = new char[] {'\''};
	private static final char[] acuteAccent = new char[] {'Á','É','Í','Ó','Ú','á','é','í','ó','ú'};
	private static final char[] acuteNormal = new char[] {'A','E','I','O','U','a','e','i','o','u'};
	private static final char[] graveMarkup = new char[] {'`'};
	private static final char[] graveAccent = new char[] {'À','È','Ì','Ò','Ù','à','è','ì','ò','ù'};
	private static final char[] graveNormal = new char[] {'A','E','I','O','U','a','e','i','o','u'};
	private static final char[] circumflexMarkup = new char[] {'^'};
	private static final char[] circumflexAccent = new char[] {'Â','Ê','Î','Ô','Û','â','ê','î','ô','û'};
	private static final char[] circumflexNormal = new char[] {'A','E','I','O','U','a','e','i','o','u'};
	private static final char[] tildeMarkup = new char[] {'~'};
	private static final char[] tildeAccent = new char[] {'Ñ','ñ'};
	private static final char[] tildeNormal = new char[] {'N','n'};

	private static final char[][][] accents = new char[][][] {
		{diaeresisMarkup, diaeresisAccent, diaeresisNormal},
		{acuteMarkup, acuteAccent, acuteNormal},
		{graveMarkup, graveAccent, graveNormal},
		{circumflexMarkup, circumflexAccent, circumflexNormal},
		{tildeMarkup, tildeAccent, tildeNormal}
	};


	public Version9xStringDecorator() {
		super();
	}


	@Override
	public DecoratedFragment[] getDecoratedString( String rawContent ) {