<commit_before>public class Parameters {
    private var sql : String;
    private var values : [String : String] = [String : String]();
    private var needEncdode : [String : Bool] = [String : Bool]();

    public init(sql : String) {
        self.sql = sql;
    }

    public init(sql : String, values : [String?]?) {
        self.sql = sql;

        // ToDo
        if (values != nil) {
            for (key, value) in values!.enumerated() {
                bind(key : String(key), value : value);
            }
        }
    }

    public func bind(key : String, value : Int) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : UInt) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : Int64) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : UInt64) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : Int32) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : UInt32) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : Int16) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : UInt16) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : Int8) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : UInt8) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : Bool) {
        values[key] = (value) ? "1" : "0";
        needEncdode[key] = false;
    }

    public func bind(key : String, value : String?) {
        if (value == nil) {
            values[key] = "null";
            needEncdode[key] = false;
        } else {
            values[key] = value;
            needEncdode[key] = true;
        }
    }

    public func toSql(conn : Connection) -> String {
        var nsql = sql;
        for (key, value) in values {
            let b = needEncdode[key];
            if ((b != nil) && (b!)) {
                nsql = nsql.replace(pattern : "\\{\(key)\\}", template : "\"" + conn.escape(value : value) + "\"");
            } else {
                nsql = nsql.replace(pattern : "\\{\(key)\\}", template : value);
            }
        }

        return nsql;
    }
}
<commit_msg>Swift 3.0<commit_after>public class Parameters {
    private var sql : String;
    private var values : [String : String] = [String : String]();
    private var needEncdode : [String : Bool] = [String : Bool]();

    public init(sql : String) {
        self.sql = sql;
    }

    public init(sql : String, values : [String?]?) {
        self.sql = sql;

        // ToDo
        if (values != nil) {
            for (key, value) in values!.enumerated() {
                bind(key : String(key), value : value);
            }
        }
    }

    public func bind(key : String, value : Int) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : UInt) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : Int64) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : UInt64) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : Int32) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : UInt32) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : Int16) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : UInt16) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : Int8) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : UInt8) {
        values[key] = String(value);
        needEncdode[key] = false;
    }

    public func bind(key : String, value : Bool) {
        values[key] = (value) ? "1" : "0";
        needEncdode[key] = false;
    }

    public func bind(key : String, value : String?) {
        if (value == nil) {
            values[key] = "null";
            needEncdode[key] = false;
        } else {
            values[key] = value;
            needEncdode[key] = true;
        }
    }

    public func toSql(conn : Connection) -> String {
        var nsql = sql;
        for (key, value) in values {
            let b = needEncdode[key];
            if ((b != nil) && (b!)) {
                nsql = nsql.replace(pattern : "\\{\(key)\\}", template : "\"" + conn.escape(value : conn.escape(value : value)) + "\"");
            } else {
                nsql = nsql.replace(pattern : "\\{\(key)\\}", template : value);
            }
        }

        return nsql;
    }
}

{'fraction_non_alphanumeric': 0.14459833795013852, 'fraction_numerical': 0.006278855032317636, 'mean_word_length': 1.8296760710553814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4477514', 'n_tokens_mistral': 1768, 'n_tokens_neox': 1705, 'n_words': 422}