<commit_before>#!
# kamuran
# Random suggestion helper.
# Unnecessary at all.
# @license MIT
# @author <NAME>
#

request = require 'request'

places = require '../places.json'

request.get 'https://raw.githubusercontent.com/egemsoft/kamuran/master/places.json', (error, response, body) ->
	if !error and response.statusCode is 200
  	places = JSON.parse body 

  places.lunch = places.common.concat places.lunch
	places.dinner = places.common.concat places.dinner

	# unchain kamuran
	do understand

suggestParams = [
	'suggest'
	'nereye gidelim'
	'nereye gidelim?'
	'nereye gideyim'
	'nereye gideyim?'
	'ne dersin'
	'ne dersin?'
]

# return random responses
suggestResponse = (place) ->
	responses =[
		"#{ place } hiç fena olmaz."
		"#{ place } nasıl fikir?"
		"Ne dersin, #{ place } uyar mı?"
		"#{ place } iyidir #{ do place.toLowerCase }"
		"Neden #{ place } olmasın?"
	]
	responses[Math.floor Math.random()*responses.length]

unknownResponse = ->
	console.log 'Her şeyi bilmiyorum maalesef.'

# suggest a random place
suggest = ->
	date = new Date()
	type = if date.getHours() < 14 then 'lunch' else 'dinner'
	console.log suggestResponse places[type][Math.floor Math.random() * (places[type].length)]

# understand the parameters
understand = ->
	return console.log 'Efendim?' if process.argv.length is 2
	return do suggest if process.argv.length is 3 and suggestParams.indexOf(process.argv[2]) isnt -1
	return do suggest if process.argv.length is 4 and suggestParams.indexOf(process.argv[2] + ' ' + process.argv[3]) isnt -1
	  	
	return do unknownResponse<commit_msg>tabs replaced with spaces as indentation<commit_after>#!
# kamuran
# Random suggestion helper.
# Unnecessary at all.
# @license MIT
# @author <NAME>
#

request = require 'request'

places = require '../places.json'

request.get 'https://raw.githubusercontent.com/egemsoft/kamuran/master/places.json', (error, response, body) ->
  if !error and response.statusCode is 200
    places = JSON.parse body 

  places.lunch = places.common.concat places.lunch
  places.dinner = places.common.concat places.dinner

  # unchain kamuran
  do understand

suggestParams = [
  'suggest'
  'nereye gidelim'
  'nereye gidelim?'
  'nereye gideyim'
  'nereye gideyim?'
  'ne dersin'
  'ne dersin?'
]

# return random responses
suggestResponse = (place) ->
  responses =[
    "#{ place } hiç fena olmaz."
    "#{ place } nasıl fikir?"
    "Ne dersin, #{ place } uyar mı?"
    "#{ place } iyidir #{ do place.toLowerCase }"
    "Neden #{ place } olmasın?"
  ]
  responses[Math.floor Math.random()*responses.length]

unknownResponse = ->
  console.log 'Her şeyi bilmiyorum maalesef.'

# suggest a random place
suggest = ->
  date = new Date()
  type = if date.getHours() < 14 then 'lunch' else 'dinner'
  console.log suggestResponse places[type][Math.floor Math.random() * (places[type].length)]

# understand the parameters
understand = ->
  return console.log 'Efendim?' if process.argv.length is 2
  return do suggest if process.argv.length is 3 and suggestParams.indexOf(process.argv[2]) isnt -1
  return do suggest if process.argv.length is 4 and suggestParams.indexOf(process.argv[2] + ' ' + process.argv[3]) isnt -1
      
  return do unknownResponse
{'fraction_non_alphanumeric': 0.12834890965732088, 'fraction_numerical': 0.00809968847352025, 'mean_word_length': 3.932411674347158, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '2440512', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1108, 'n_words': 298}