private static Configuration loadConfiguration(String configurationFilename) {

		Configuration configuration = new Configuration();

		String dictionaryVersion = "";

		try {

			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
			DocumentBuilder builder = factory.newDocumentBuilder();

			File configurationFile = new File(configurationFilename);
			String parentDirectory = configurationFile.getParent();
			if (parentDirectory == null) {
				parentDirectory = ".";
			}
			String separator = System.getProperty("file.separator");

			configuration.connectionCostFilename = parentDirectory + separator + CONNECTION_COST_DATA_FILENAME;
			configuration.partOfSpeechDataFilename = parentDirectory + separator + PART_OF_SPEECH_DATA_FILENAME;
			configuration.tokenFilename = parentDirectory + separator + TOKEN_DATA_FILENAME;
			configuration.trieFilename = parentDirectory + separator + TRIE_DATA_FILENAME;
			
			Document document = builder.parse(new InputSource(configurationFile.toURI().toURL().toString()));
			NodeList nodeList = document.getFirstChild().getChildNodes();

			for (int i = 0; i < nodeList.getLength(); i++) {
				org.w3c.dom.Node node = nodeList.item(i);
				if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) {
					String nodeName = node.getNodeName();
					String nodeValue = node.getFirstChild().getNodeValue();

					if (nodeName.equals("dictionary-version")) {
						dictionaryVersion = nodeValue;
					} else if (nodeName.equals("unknown-pos")) {
						configuration.unknownPartOfSpeechDescription = nodeValue;
					} else if (nodeName.equals("tokenizer")) {
						configuration.tokenizerClassName = nodeValue;
					}

				}
			}


		} catch (Exception e) {

			throw new IllegalArgumentException(e);

		}

		if (!dictionaryVersion.equals("1.0")) {

			throw new IllegalArgumentException("Invalid dictionary version \"" + dictionaryVersion + "\"");
		}

		return configuration;

	}