<commit_before>package com.fingy.robocall.web.controller;

import com.fingy.robocall.service.NuanceTextToSpeechService;
import com.fingy.robocall.web.controller.dto.ConversionRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URISyntaxException;

@Controller
public class NuanceController {

    private @Value("application.key") String key;
    private @Autowired NuanceTextToSpeechService textToSpeechService;

    @RequestMapping(value = "/text-to-speech/convert")
    public void convert(ConversionRequest conversionRequest, HttpServletResponse response) {
        try {
            doConvert(conversionRequest, response);
        } catch (IOException | URISyntaxException e) {
            response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        }
    }

    private void doConvert(ConversionRequest conversionRequest, HttpServletResponse response) throws IOException, URISyntaxException {
        if (key.equals(conversionRequest.getKey())) {
            textToSpeechService.convertToSpeech(conversionRequest.getText(), conversionRequest.getLanguage(), response.getOutputStream());
            response.flushBuffer();
            response.setStatus(HttpServletResponse.SC_OK);
        }
    }
}
<commit_msg>App engine commit<commit_after>package com.fingy.robocall.web.controller;

import com.fingy.robocall.service.NuanceTextToSpeechService;
import com.fingy.robocall.web.controller.dto.ConversionRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URISyntaxException;

@Controller
@RequestMapping("/text-to-speech")
public class NuanceController {

    private @Value("application.key") String key;
    private @Autowired NuanceTextToSpeechService textToSpeechService;

    @RequestMapping(value = "/convert", method = RequestMethod.GET)
    public void convert(ConversionRequest conversionRequest, HttpServletResponse response) {
        try {
            doConvert(conversionRequest, response);
        } catch (IOException | URISyntaxException e) {
            response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        }
    }

    private void doConvert(ConversionRequest conversionRequest, HttpServletResponse response) throws IOException, URISyntaxException {
        if (key.equals(conversionRequest.getKey())) {
            textToSpeechService.convertToSpeech(conversionRequest.getText(), conversionRequest.getLanguage(), response.getOutputStream());
            response.flushBuffer();
            response.setStatus(HttpServletResponse.SC_OK);
        }
    }
}

{'fraction_non_alphanumeric': 0.08983890954151177, 'fraction_numerical': 0.0, 'mean_word_length': 4.797127468581688, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3634411', 'n_tokens_mistral': 842, 'n_tokens_neox': 831, 'n_words': 139}