<commit_before>######
# Viralheat Sentiment module
######

exports = module.exports = (api_key) ->
	######
	# Module dependencies
	######
	core = require('./core')(api_key)
	
	get = (text) ->
		core.callApi(
			'sentiment',
			'review',
			params,
			null,
			(err, data, status) ->
				if(status=='200')
					callback(null, data, 200)
				else
					callback({code:status, msg: err})
		)
	
	train = (text, mood) ->
		core.callApi(
			'sentiment',
			'train',
			params,
			null,
			(err, data, status) ->
				if(status=='200')
					callback(null, data, 200)
				else
					callback({code:status, msg: err})
		)
	
	quota = () ->
		core.callApi(
			'sentiment',
			'quota',
			params,
			null,
			(err, data, status) ->
				if(status=='200')
					callback(null, data, 200)
				else<commit_msg>Added in callback to get, train, quota, for sentiment<commit_after>######
# Viralheat Sentiment module
######

exports = module.exports = (api_key) ->
	######
	# Module dependencies
	######
	core = require('./core')(api_key)
	
	get = (text, callback) ->
		core.callApi(
			'sentiment',
			'review',
			params,
			null,
			(err, data, status) ->
				if(status=='200')
					callback(null, data, 200)
				else
					callback({code:status, msg: err})
		)
	
	train = (text, mood, callback) ->
		core.callApi(
			'sentiment',
			'train',
			params,
			null,
			(err, data, status) ->
				if(status=='200')
					callback(null, data, 200)
				else
					callback({code:status, msg: err})
		)
	
	quota = (callback) ->
		core.callApi(
			'sentiment',
			'quota',
			params,
			null,
			(err, data, status) ->
				if(status=='200')
					callback(null, data, 200)
				else
{'fraction_non_alphanumeric': 0.19114077669902912, 'fraction_numerical': 0.021844660194174758, 'mean_word_length': 2.7734553775743707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '2184177', 'n_tokens_mistral': 793, 'n_tokens_neox': 585, 'n_words': 134}