<commit_before>class VoiceTranscriptionsController < ApplicationController
  before_action :set_voice_transcription, only: [:show, :edit, :update, :destroy]

  # GET /voice_transcriptions
  # GET /voice_transcriptions.json
  def index
    @voice_transcriptions = VoiceTranscription.all
  end

  def ask_for_response
    twilio_response = Twilio::TwiML::Response.new do |r|
      r.Say "Say something and I'll transcribe it, yo", :voice => 'man'
      r.Record :transcribeCallback => '/voice_transcriptions/create'
    end
    render :inline => twilio_response.text
  end

  # GET /voice_transcriptions/1
  # GET /voice_transcriptions/1.json
  def show
  end

  # GET /voice_transcriptions/new
  def new
    @voice_transcription = VoiceTranscription.new
  end

  # GET /voice_transcriptions/1/edit
  def edit
  end

  # POST /voice_transcriptions
  # POST /voice_transcriptions.json
  def create
    VoiceTranscription.create!(:content => params["TranscriptionText"])
=begin
    @voice_transcription = VoiceTranscription.new(voice_transcription_params)

    respond_to do |format|<commit_msg>Actually use the restful route<commit_after>class VoiceTranscriptionsController < ApplicationController
  before_action :set_voice_transcription, only: [:show, :edit, :update, :destroy]

  # GET /voice_transcriptions
  # GET /voice_transcriptions.json
  def index
    @voice_transcriptions = VoiceTranscription.all
  end

  def ask_for_response
    twilio_response = Twilio::TwiML::Response.new do |r|
      r.Say "Say something and I'll transcribe it, yo", :voice => 'man'
      r.Record :transcribeCallback => '/voice_transcriptions'
    end
    render :inline => twilio_response.text
  end

  # GET /voice_transcriptions/1
  # GET /voice_transcriptions/1.json
  def show
  end

  # GET /voice_transcriptions/new
  def new
    @voice_transcription = VoiceTranscription.new
  end

  # GET /voice_transcriptions/1/edit
  def edit
  end

  # POST /voice_transcriptions
  # POST /voice_transcriptions.json
  def create
    VoiceTranscription.create!(:content => params["TranscriptionText"])
=begin
    @voice_transcription = VoiceTranscription.new(voice_transcription_params)

    respond_to do |format|
{'fraction_non_alphanumeric': 0.08713503649635036, 'fraction_numerical': 0.002737226277372263, 'mean_word_length': 4.196682464454977, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2488853', 'n_tokens_mistral': 687, 'n_tokens_neox': 658, 'n_words': 155}