
public class SampleGenerator {
	private static String titles[] = {"This is an example title",
										"A title, an example",
										"Examples: Are they titles?",
										"Titles and examples",
										"This title is an example",
										"Examples make good titles",
										"This title makes a good example",
										"When will examples become titles?",
										"Are there example titles or are all titles examples?",
										"The age old question of titles with examples",
										"Can an example be a title?",
										"Is life a title or an example?",
										"To live and die a title",
										"A tale of two examples",
										"Gone with the example title wind",
										"Improve your diet: eat more example titles",
										"A title a day keeps the example away"};
	private static String fNames[] = {"Aaron", "Abigail", "Abraham", "Adrian",
										"Albert", "Alan", "Alex", "Alfred",
										"Alice", "Alvin", "Amy", "Anne",
										"Erin", "Ashley", "Dorthy", "Dominic",
										"Donald", "Dwanye", "Earl", "Edward",
										"Irene", "Helen", "Eliot", "Emily",
										"Kathy", "Kelly", "Kenneth", "Kevin",
										"Laura", "Perry", "Peter", "Philip",
										"Leo", "Joseph", "Rachel", "Ralph",
										"Miranda", "Randall", "Ray", "Rebecca",
										"Renee", "Maria", "Rita", "Robert", "Robin",
										"Roger", "Rosa", "Audrey", "Austin",
										"Ava", "Barbara", "Bailey", "Berry",
										"Ben", "Bill", "Bob", "Bret", "Roy",
										"Russell", "Sabrina", "Scot", "Seth"};
	private static String topics[] = {"Politics", "Science", "Chemistry",
										"Essay", "Religion", "Psychology",
										"Sociology", "Engineering", "History",
										"Anthropology", "Biology"};
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		for (int i = 0; i < 50; i++) {
			String author[] = getName();
			String editor[] = getName();
			long id = System.currentTimeMillis();
			
			try { Thread.sleep(10); } catch (InterruptedException e) { }
			
			System.out.println("<citation>");
			System.out.println("<primary-source-ref>" + i + "</primary-source-ref>");
			System.out.println("<secondary-source-ref>" + id + "</secondary-source-ref>");
			System.out.println("<page>" + getNum() + "</page>");
			System.out.println("<edition>false</edition>");
			System.out.println("<noMention>false</noMention>");
			System.out.println("<category>Uncategorized</category>");
			System.out.println("<note>");
			System.out.println("	Place comments here.");
			System.out.println("</note>");
			System.out.println("<recordIdentifier>" + System.currentTimeMillis() + "</recordIdentifier>");
			System.out.println("</citation>");
			
			System.out.println("<secondary-source>");
			System.out.println("<titleInfo>");
			System.out.println("	<title>" + getTitle() + "</title>");
			System.out.println("	<subTitle>" + getTitle() + "</subTitle>");
			System.out.println("	<shortTitle>" + author[0] + " " + getYear() + "</shortTitle>");
			System.out.println("	<journal></journal>");
			System.out.println("</titleInfo>");
			System.out.println("<name type=\"personal\">");
			System.out.println("	<namePart>" + author[0] + ", " + author[1] + "</namePart>");
			System.out.println("	<role>creator</role>");
			System.out.println("</name>");
			System.out.println("<name type=\"personal\">");
			System.out.println("	<namePart>" + editor[0] + ", " + editor[1] + "</namePart>");
			System.out.println("	<role>editor</role>");
			System.out.println("</name>");
			System.out.println("<name type=\"personal\">");
			System.out.println("	<namePart>Mr. Advisor</namePart>");
			System.out.println("	<role>advisor</role>");
			System.out.println("</name>");
			System.out.println("<typeOfResource>text</typeOfResource>");
			System.out.println("<identifier type=\"volume\">" + getNum() + "</identifier>");
			System.out.println("<identifier type=\"series\">Untitled Series</identifier>");
			System.out.println("<identifier type=\"issue\">" + getNum() + "</identifier>");
			System.out.println("<identifier type=\"section\">" + getNum() + "</identifier>");
			System.out.println();
			System.out.println("<note type=\"note\">");
			System.out.println("	Put notes here.");
			System.out.println("</note>");
			System.out.println();
			System.out.println("<note type=\"research\">");
			System.out.println("	Put research notes here.");
			System.out.println("</note>");
			System.out.println();
			System.out.println("<note type=\"abstract\">");
			System.out.println("	Put abstract here.");
			System.out.println("</note>");
			System.out.println();
			System.out.println("<subject>");
			System.out.println("	<topic>" + getTopic() + "</topic>");
			System.out.println("	<topic>" + getTopic() + "</topic>");
			System.out.println("</subject>");
			System.out.println();
			System.out.println("<location type=\"url\" displayLabel=\"pdf\">http://stanford.edu/example.pdf</location>");
			System.out.println("<location type=\"url\" displayLabel=\"url\">http://example.com/</location>");
			System.out.println();
			System.out.println("<originInfo>");
			System.out.println("	<place><placeTerm authority=\"marccountry\" type=\"code\">nyu</placeTerm></place>");
			System.out.println("	<place><placeTerm type=\"text\">Ithaca, N.Y</placeTerm></place>");
			System.out.println("	<place><placeTerm type=\"department\">" + getTopic() + "</placeTerm></place>");
			System.out.println("	<place><placeTerm type=\"degree\">Masters</placeTerm></place>");
			System.out.println("	<place><placeTerm type=\"university\">Cornell</placeTerm></place>");
			System.out.println("	<publisher>Cornell University Press</publisher>");
			System.out.println("	<dateIssued>c" + getYear() + "</dateIssued>");
			System.out.println("	<dateIssued encoding=\"marc\">" + getYear() + "</dateIssued>");
			System.out.println("	<extent>");
			System.out.println("		<volumeCount>" + getNum() + "</volumeCount>");
			System.out.println("		<pageCount>" + (10 * getNum()) + "</pageCount>");
			System.out.println("	</extent>");
			System.out.println("	<issuance>monographic</issuance>");
			System.out.println("</originInfo>");
			System.out.println("<language><languageTerm authority=\"iso639-2b\" type=\"code\">eng</languageTerm></language>");
			System.out.println("<recordInfo>");
			System.out.println("	<recordContentSource>DLC</recordContentSource>");
			System.out.println("	<recordCreationDate encoding=\"marc\">990730</recordCreationDate>");
			System.out.println("	<recordChangeDate encoding=\"iso8601\">20000406144503.0</recordChangeDate>");
			System.out.println("	<recordIdentifier>" + id + "</recordIdentifier>");
			System.out.println("</recordInfo>");
			System.out.println("</secondary-source>");
		}
	}
	
	public static String getTitle() {
		return titles[(int) (Math.random() * titles.length)];
	}
	
	public static String[] getName() {
		String first = fNames[(int) (Math.random() * fNames.length)];
		String last = fNames[(int) (Math.random() * fNames.length)] + "man";
		
		return new String[] { last, first };
	}
	
	public static int getYear() { return (int) (1700 + Math.random() * 300); }
	public static String getTopic() { return topics[(int) (Math.random() * topics.length)]; }
	public static int getNum() { return (int) (100 * Math.random()); }
}
