<commit_before>import Vapor
import Foundation

// MARK: -- Properties
let maxList: Int = 100 //Maximum amount of names which can be reqested in one shot
//let defaultHead: String = "<head><meta charset='utf-8'></head>"

// MARK: -- Configuration
let nameBuilder = NameBuilder() // create NameBuilder object


// MARK: --Routes
public func routes(_ router: Router) throws {
	
	//default route -> standard name generation
	router.get { req in return "\(nameBuilder.next())\n" }
	
	//get many names all at once
	router.get("list", Int.parameter) { req -> String in
		let amount = try req.parameters.next(Int.self)
		guard amount <= maxList else { return "ERROR: Parameter 'amount' must be a natural number between 0 and \(maxList).\nYou can't request more than \(maxList) names all at once.\n\nNon è possibile richiedere più di \(maxList) nomi in un colpo solo.\n" } //check we aren't requesting too many names
		var names: String = ""
	    for _ in 0 ..< amount {
    		names += "\(nameBuilder.next())\n"
  		}
  		return names
	}
	
	router.get("alexa") { req in
		let uuid = UUID().uuidString
		let date = Date()<commit_msg>Fix alexa ruote output<commit_after>import Vapor
import Foundation

// MARK: -- Properties
let maxList: Int = 100 //Maximum amount of names which can be reqested in one shot
//let defaultHead: String = "<head><meta charset='utf-8'></head>"

// MARK: -- Configuration
let nameBuilder = NameBuilder() // create NameBuilder object


// MARK: --Routes
public func routes(_ router: Router) throws {
	
	//default route -> standard name generation
	router.get { req in return "\(nameBuilder.next())\n" }
	
	//get many names all at once
	router.get("list", Int.parameter) { req -> String in
		let amount = try req.parameters.next(Int.self)
		guard amount <= maxList else { return "ERROR: Parameter 'amount' must be a natural number between 0 and \(maxList).\nYou can't request more than \(maxList) names all at once.\n\nNon è possibile richiedere più di \(maxList) nomi in un colpo solo.\n" } //check we aren't requesting too many names
		var names: String = ""
	    for _ in 0 ..< amount {
    		names += "\(nameBuilder.next())\n"
  		}
  		return names
	}
	
	router.get("alexa") { req -> JSON in
		let uuid = UUID().uuidString
		let date = Date()
{'fraction_non_alphanumeric': 0.12903225806451613, 'fraction_numerical': 0.005302695536897923, 'mean_word_length': 3.3123809523809524, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, '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': '1324787', 'n_tokens_mistral': 729, 'n_tokens_neox': 674, 'n_words': 265}