// 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;
package net.vhati.openuhs.core.markup;





/**
 * A StringDecorator ancestor.
 * <p>
 * Line breaks are initially replaced with "\n" by default,
 * but subclasses overriding getDecoratedString() can change that.
 */
public class Version9xStringDecorator extends StringDecorator {
	public static final String MONOSPACED = "Monospaced";
	public static final String HYPERLINK = "Hyperlink";

// 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;

package net.vhati.openuhs.core.markup;





/**
 * A StringDecorator ancestor.
 * <p>
 * Line breaks are initially replaced with "\n" by default,
 * but subclasses overriding getDecoratedString() can change that.
 */
public class Version9xStringDecorator extends StringDecorator {
	public static final String MONOSPACED = "Monospaced";
	public static final String HYPERLINK = "Hyperlink";

	private static final Decoration[] decorations = new Decoration[] {