<commit_before>/**
 * Created with IntelliJ IDEA.
 * User: gpotts
 * Date: 2/8/13
 * Time: 7:19 AM
 * To change this template use File | Settings | File Templates.
 */
OMAR.models.Selection = Backbone.Model.extend({
    idAttribute:"id",
    defaults:{
        id:""
        ,description:""
    },
    initialize:function(params){

    }
});

OMAR.models.SelectedCollection = Backbone.Collection.extend({
    url:"",
    model:OMAR.models.Selection,
    initialize:function(){
    },
    toArrayOfIds:function(maxCount){
        var selectedItem = [];
        if(!maxCount) maxCount = this.length;
        else if(maxCount > this.length) maxCount = this.length;
        for(var idx=0; idx < maxCount; idx++){
            var item = this.at(idx);
            selectedItem.push(item.id);
        }
        return selectedItem;
    },
    toStringOfIds:function(seperator, maxCount){
        if(!seperator) {
            seperator = ",";
        }

        return this.toArrayOfIds(maxCount).join(seperator);
    }
});<commit_msg>Needed to add a reverse id support for the list of inputs that chipper takes is reverse to the layers being shown on the openlayers WMS chipping<commit_after>/**
 * Created with IntelliJ IDEA.
 * User: gpotts
 * Date: 2/8/13
 * Time: 7:19 AM
 * To change this template use File | Settings | File Templates.
 */
OMAR.models.Selection = Backbone.Model.extend({
    idAttribute:"id",
    defaults:{
        id:""
        ,description:""
    },
    initialize:function(params){

    }
});

OMAR.models.SelectedCollection = Backbone.Collection.extend({
    url:"",
    model:OMAR.models.Selection,
    initialize:function(){
    },
    toArrayOfIds:function(maxCount){
        var selectedItem = [];
        if(!maxCount) maxCount = this.length;
        else if(maxCount > this.length) maxCount = this.length;
        for(var idx=0; idx < maxCount; idx++){
            var item = this.at(idx);
            selectedItem.push(item.id);
        }
        return selectedItem;
    },
    toStringOfIds:function(seperator, maxCount){
        if(!seperator) {
            seperator = ",";
        }

        return this.toArrayOfIds(maxCount).join(seperator);
    },
    toArrayOfIdsReverse:function(maxCount){
        var selectedItem = [];
        if(!maxCount) maxCount = this.length;
        else if(maxCount > this.length) maxCount = this.length;
        for(var idx=0; idx < maxCount; idx++){
            var item = this.at(idx);
            selectedItem.unshift(item.id);
        }
        return selectedItem;
    },
    toStringOfIdsReverse:function(seperator, maxCount){
        if(!seperator) {
            seperator = ",";
        }

        return this.toArrayOfIdsReverse(maxCount).join(seperator);
    },
});
{'fraction_non_alphanumeric': 0.1303395399780942, 'fraction_numerical': 0.006206644760861628, 'mean_word_length': 2.4335839598997495, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '4503557', 'n_tokens_mistral': 848, 'n_tokens_neox': 827, 'n_words': 176}