<commit_before>module Voicemail
  class VoicemailController < ApplicationController

    attr_accessor :recording

    def run
      answer if config.when_to_answer == :before_greeting
      if mailbox
        result = play_greeting
        answer if config.when_to_answer == :after_greeting
        if result.status == :match && result.response == config.go_to_menu_digit<commit_msg>Support for adhearsion-asr<commit_after>module Voicemail
  class VoicemailController < ApplicationController

    attr_accessor :recording

    def run
      answer if config.when_to_answer == :before_greeting
      if mailbox
        result = play_greeting
        answer if config.when_to_answer == :after_greeting

        if result.status == :match
          response = if result.respond_to? :utterance
            # Using the adhearsion-asr plugin
            result.utterance
          else
            # Using the built-in Adhearsion #ask
            result.response
          end
        end

        if result.status == :match && response == config.go_to_menu_digit
{'fraction_non_alphanumeric': 0.05954631379962193, 'fraction_numerical': 0.0, 'mean_word_length': 2.53, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4328776', 'n_tokens_mistral': 295, 'n_tokens_neox': 292, 'n_words': 74}