public static IFuzzyCommand parse(String line) throws FuzzyParserException {
		if(line == null) {
			throw new FuzzyParserException("The command string must not be null!");
		}
		
		IFuzzyCommand command = null;
		
		line = line.replaceAll(",\\s+", ",");
		line = line.replaceAll("write", "w write");
		line = line.replaceAll("test", "t test ");
		line = line.replaceAll("(\\s+)?\\+(\\s+)?", "+");
		line = line.replaceAll("(\\s+)?\\*(\\s+)?", "*");
		line = line.replaceAll("(\\s+)?->(\\s+)?", ">");		
		line = line.replaceAll("(\\s+)?!(\\s+)?", "!");		
		
		if(line.startsWith("set operator")) {
			line = line.substring(0, 12) + " " + line.charAt(12) + " " + line.substring(13);
		}
		
		String[] parts = line.split("\\s+");
		
		try {
		switch(parts[1]) {
			case "domain":
				IDomain domain = parseDomain(parts);
				command = new PersistDomainCommand(domain);
				break;
				
			case "fuzzyset":
				command = parseSet(parts);
				break;
				
			case "operator":
				command = parseOperator(parts);
				break;
				
			case "write":
				command = new WriteCommand(parts[2]);
				break;
				
			case "test":
				command = parseTest(parts);
				break;
	
			default:
				throw new FuzzyParserException("Unknown fuzzy command!");
			}
		} catch(FuzzyParserException ex) {
			throw ex;
		} catch(Exception ex) {
			throw new FuzzyParserException(ex.getMessage());
		}
		
		return command;
	}