<commit_before>class StationsController < ApplicationController
	
  before_filter :authenticate

  def index
    tsid = params[:tsid]
    callsign = params[:callsign]
    if tsid
      @stations = Station.where(:tsid => tsid)
    elsif callsign
      @stations = Station.where(:callsign => callsign)
    else
      @stations = Station.all
    end
    
    respond_to do |format|
      format.html
      format.json { render :json => @stations }
    end<commit_msg>Add querying of stations<commit_after>class StationsController < ApplicationController
	
  before_filter :authenticate

  def index
    query = {}
    if params[:tsid]
      query[:tsid] = params[:tsid]
    end
    
    if params[:callsign]
      query[:callsign] = params[:callsign]
    end
    
    if params[:display]
      query[:display] = params[:display]
    end
    
    if params[:rf]
      query[:rf] = params[:rf]
    end
    
    if query.size == 0
      @stations = Station.all
    else
      @stations = Station.where(query)
    end
    
    respond_to do |format|
      format.html
      format.json { render :json => @stations }
    end
{'fraction_non_alphanumeric': 0.09946236559139784, 'fraction_numerical': 0.0008960573476702509, 'mean_word_length': 2.4263803680981595, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '806951', 'n_tokens_mistral': 350, 'n_tokens_neox': 340, 'n_words': 82}