src/org/kocakosm/pitaya/math/Fraction.java
public static Fraction parse(String str)
	{
		String fraction = str.replaceAll("\\s", "");
		int index = fraction.indexOf('/');
		if (index < 0) {
			return valueOf(new BigInteger(fraction));
		}
		BigInteger n = new BigInteger(fraction.substring(0, index));
		BigInteger d = new BigInteger(fraction.substring(index + 1));
		return new Fraction(n, d);
	}
public static Fraction parse(String str)
	{
		String fraction = str.replaceAll("\\s", "");
		int index = fraction.indexOf('/');
		if (index < 0) {
			return valueOf(new BigInteger(fraction));
		}
		BigInteger n = new BigInteger(fraction.substring(0, index));
		BigInteger d = new BigInteger(fraction.substring(index + 1));
		return new Fraction(n, d);
	}
Creates a {@code Fraction} from its {@code String} representation.

@param str the {@code Fraction}'s {@code String} representation.

@return the created {@code Fraction}.

@throws IllegalArgumentException if {@code str} doesn't represent a
{@code Fraction} or if its denominator equals zero.