<commit_before>require 'java'

module SPF
  module Gateway
    class AudioRecognitionProcessingStrategy
      
      @types = ["MPEG","WAV"]
        
      def initialize
      end
      
      def activate
      end
      
      def deactivate
      end
      
      def interested_in?(raw_data)
        identifier = SPF::Gateway::FileTypeIdentifier.new(raw_data)
        type = identifier.identify
        return @types.find { |e| type =~ Regexp.new(e) }.nil? == false 
      end
      
      #Calculate the Hamming distance between audio streams, in percentage 
      def information_diff(audio1, audio2)
        return exec("python Audio.py "+audio1+" "+audio2)
      end
      
      #Call AcoustID web service for audio identification
      def do_process(audio)
        return exec("python Audio.py "+audio)
      end<commit_msg>Fixed Audio processing strategy<commit_after>module SPF
  module Gateway
    class AudioRecognitionProcessingStrategy
      
      
      @types = ["MPEG","WAV"]
        
      def initialize
      end
      
      def activate
      end
      
      def deactivate
      end
      
      def interested_in?(raw_data)
        identifier = SPF::Gateway::FileTypeIdentifier.new(raw_data)
        type = identifier.identify
        return @types.find { |e| type =~ Regexp.new(e) }.nil? == false 
      end
      
      #Calculate the Hamming distance between audio streams, in percentage 
      def information_diff(audio1, audio2)
        return SPF::Gateway::Audio.compare(audio1, audio2)
      end
      
      #Call AcoustID web service for audio identification
      def do_process(audio)
        return SPF::Gateway::Audio.identify(audio)
      end
{'fraction_non_alphanumeric': 0.07646710136336693, 'fraction_numerical': 0.004742145820983995, 'mean_word_length': 2.137546468401487, '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': '1799239', 'n_tokens_mistral': 472, 'n_tokens_neox': 465, 'n_words': 126}