public static Value parse(String value) {
        if (value.equals("true"))
            return new BooleanValue(true);
        else if (value.equals("false"))
            return new BooleanValue(false);
        else if (value.startsWith("\"") || value.startsWith("'"))
            return new StringValue(value);
        else if (value.startsWith("{"))
            return new TensorValue(Tensor.from(value));
        else if ((value.indexOf('.') == -1) && (value.indexOf('e') == -1) && (value.indexOf('E') == -1))
            return new LongValue(Long.parseLong(value));
        else
            return new DoubleValue(Double.parseDouble(value));
    }
Parses the given string to a value and returns it.
Different subtypes of Value will be returned depending on the string.

@return a mutable Value
@throws IllegalArgumentException if the given string is not parseable as a value
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/Value.java