class BooleanGrammarCreator extends AbstractGrammarCreator implements GrammarCreator {

    @Override
    public byte[] createGrammar(final URI uri)
        throws BadFetchError, IOException {
        final Map<String, String> parameters = getParameters(uri);
        final ModeType mode = getMode(uri);

        if (mode == ModeType.VOICE) {
            // TODO retrieve the value from a resource bundle
            parameters.put(YES_PARAMETER_NAME, "yes");
        } else {
            if (!parameters.containsKey(YES_PARAMETER_NAME)) {
                parameters.put(YES_PARAMETER_NAME, "1");
            }
        }
        if (mode == ModeType.VOICE) {
            // TODO retrieve the value from a resource bundle
            parameters.put(NO_PARAMETER_NAME, "no");
        } else {
            if (!parameters.containsKey(NO_PARAMETER_NAME)) {
                parameters.put(NO_PARAMETER_NAME, "2");
            }
        }
        final SrgsXmlDocument document = createGrammar(parameters, mode);
        return getBytes(document);
    }

}