<commit_before>var SFDATA_API_URL = 'http://data.sfgov.org/resource/yitu-d5am.json';

var Backbone = require('backbone');
var _ = require('underscore');

module.exports = Backbone.Collection.extend({
	url: function(){
		// only do 8 at a time due to geocoding API restrictions
		return SFDATA_API_URL +'?$q='+ this.query +'&$limit=8';
	},
	initialize: function(){
		_.bindAll( this, 'fetchQuery' );
		this.fetchQuery('');
	},
	fetchQuery: function( query ){
		this.query = query;
		this.fetch({
			dataType: 'jsonp',
			jsonp: '$jsonp',
			reset: true
		});
	}
});<commit_msg>"paginate" through location results rather than limiting them<commit_after>var SFDATA_API_URL = 'http://data.sfgov.org/resource/yitu-d5am.json';

var Backbone = require('backbone');
var _ = require('underscore');

module.exports = Backbone.Collection.extend({
	url: function(){
		return SFDATA_API_URL +'?$q='+ this.query;
	},
	initialize: function(){
		this.query;
		this.start = 0;
		_.bindAll( this, 'fetchQuery', 'next', 'prev' );
		this.fetchQuery('');
	},
	fetchQuery: function( query ){
		this.query = query;
		this.start = 0;
		this.fetch({
			dataType: 'jsonp',
			jsonp: '$jsonp',
			reset: true
		});
	},
	// set the next 5 locations as the current selection
	next: function(){
		if( this.length > this.start + 5 ){
			this.start += 5;
			this.trigger( 'start', this.start );
		}
	},
	// set the previous 5 locations as the current selection
	prev: function(){
		if( this.start - 5 >= 0 ){
			this.start -=5;
			this.trigger( 'start', this.start );
		}
	}
});
{'fraction_non_alphanumeric': 0.17464424320827943, 'fraction_numerical': 0.008408796895213453, 'mean_word_length': 3.8193146417445485, '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': '1441183', 'n_tokens_mistral': 596, 'n_tokens_neox': 545, 'n_words': 134}