public void processGedcomFile(GedcomReader reader) throws IOException,
			GedcomReaderException, PropertyException {
		for (GedcomRecord record = reader.nextRecord(); record != null; record = reader
				.nextRecord()) {
			if (record.getLevel() != 0)
				throw new GedcomReaderException("Level is not zero in " + record,
						reader.getLineNumber());

			String tag = record.getTag();

			GedcomObjectFactory factory = null;

			if (tag.equalsIgnoreCase("INDI"))
				factory = personFactory;
			else if (tag.equalsIgnoreCase("FAM"))
				factory = familyFactory;
			else if (tag.equalsIgnoreCase("NOTE"))
				factory = noteFactory;
			else if (tag.equalsIgnoreCase("SOUR"))
				factory = sourceFactory;
			else if (tag.equalsIgnoreCase("TRLR")) {
				makeSets();
				return;
			} else
				factory = null;

			if (factory != null)
				factory.processGedcomRecord(record, reader);
			else
				ignoreRecord(record, reader);
		}
	}