public void parse(String string) {
        try {
            this.s=new PositionedString(string);

            s.consumeSpaces();
            s.consume('{');
            while ( ! s.peek('}')) {
                s.consumeSpaces();
                String key=consumeKey();
                s.consume(':');
                s.consumeSpaces();
                consumeValue(key);
                s.consumeOptional(',');
                s.consumeSpaces();
            }
            s.consume('}');
        }
        catch (IllegalArgumentException e) {
            throw new IllegalArgumentException("'" + s + "' is not a legal sparse vector string",e);
        }
    }
Parses a map on the form <code>{key1:value1,key2:value2 ...}</code>

@param string the textual representation of the map
vespajlib/src/main/java/com/yahoo/text/SimpleMapParser.java