import java.sql.*;
import java.io.*;
import java.util.HashMap;
import java.util.ArrayList;
import uk.ac.ic.doc.automed.ssd.*;
import uk.ac.ic.doc.automed.*;

/**
 * An application to demonstrate how to create patterns for 
 * semistructured data
 */

public class DefinePatterns {

    public static void createPatterns()
	throws SQLException, IOException
    {
	//Create patterns
	Pattern.retract("p1");
	Pattern p1=Pattern.createPattern("p1", "name\\\\s=\\\\s(.*)");
	Pattern.retract("p2");
	Pattern p2=Pattern.createPattern("p2", "course\\\\s=\\\\s(.*)");
	Pattern.retract("p3");
	Pattern p3=Pattern.createPattern("p3", "year\\\\s=\\\\s(\\\\d)");
	Pattern.retract("p4");
	Pattern p4=Pattern.createPattern("p4", "grade\\\\s=\\\\s([A-F])");
    }
 
    public static void main(String[] args) 
    {
	try 
	{
	    System.out.println("Creating Patterns ...");
	    createPatterns();
	}
	catch (SQLException se) { 
	    se.printStackTrace();
	}
	catch (IOException ie) {
	    ie.printStackTrace();
	}
    }

}










