<commit_before>require 'bundler'
Bundler.require

require 'sinatra/base'

class Movies < Sinatra::Base

    def movie_data(name, release_year, description)
    {:name => name, :release_year => release_year, :description => description}.to_json
    end 

    get '/api/:name' do 
        @name = params[:name]
        get_movie(@name)
    end 

    def get_movie(movie)
        case movie
        when 'kill-bill'
          movie_data('Kill Bill Vol. 1', '2003', 
            'A former assassin, known simply as The Bride (<NAME>), wakes from a coma four years after her jealous ex-lover Bill (<NAME>) attempts to murder her on her wedding day.')
        when '<NAME>'
          movie_data('<NAME>', '1990',
           "A scientist (<NAME>) builds an animated human being -- the gentle Edward (<NAME>). The scientist dies before he can finish assembling Edward, though, leaving the young man with a freakish appearance accentuated by the scissor blades he has instead of hands. Loving suburban saleswoman Peg (<NAME>) discovers Edward and takes him home, where he falls for Peg's teen daughter (<NAME>). However, despite his kindness and artistic talent, Edward's hands make him an outcast.") 
        when 'the colour of pomegranates'
            movie_data('the colour of pomegranates', '1968',
           "This avant-garde film by Russian director <NAME> depicts the life of revered the 18th-century Armenian poet and musician Sayat-Nova (Vilen Galstyan). Portraying events in the life of the artist from childhood up to his death, the movie addresses in particular his relationships with women, including his muse (<NAME>). The production tells Sayat-Nova's dramatic story by using both his poems and largely still camerawork, creating an impressionistic work." 
        else 
          'movie not found'
        end 
    end 
<commit_msg>add index<commit_after>require 'bundler'
Bundler.require

require 'sinatra/base'

class Movies < Sinatra::Base

    def movie_data(name, release_year, description)
    {:name => name.to_s, :release_year => release_year.to_s, :description => description.to_s}.to_json
    end 

     get '/' do 
      'Welcome to the movie API! To find a movie type: /api/song-name' 
    end 

    get '/api/:name' do 
        cross_origin 
        @name = params[:name]
        get_movie(@name)
    end 

    def get_movie(movie)
        case movie
        when 'kill-bill'
          movie_data('Kill Bill Vol. 1', '2003', 
            'A former assassin, known simply as <NAME> (<NAME>), wakes from a coma four years after her jealous ex-lover Bill (<NAME>) attempts to murder her on her wedding day.')
        when 'edward-scissorhands'
          movie_data('<NAME>', '1990',
           "A scientist (<NAME>) builds an animated human being -- the gentle Edward (<NAME>). The scientist dies before he can finish assembling Edward, though, leaving the young man with a freakish appearance accentuated by the scissor blades he has instead of hands. Loving suburban saleswoman Peg (D<NAME>) discovers Edward and takes him home, where he falls for Peg's teen daughter (<NAME>). However, despite his kindness and artistic talent, Edward's hands make him an outcast.") 
        when 'the-colour-of-pomegranates'
            movie_data('the colour of pomegranates', '1968',
           "This avant-garde film by Russian director <NAME> depicts the life of revered the 18th-century Armenian poet and musician Sayat-Nova (<NAME>yan). Portraying events in the life of the artist from childhood up to his death, the movie addresses in particular his relationships with women, including his muse (<NAME>). The production tells Sayat-Nova's dramatic story by using both his poems and largely still camerawork, creating an impressionistic work.") 
        else 
          'movie not found'
        end 
    end 

{'fraction_non_alphanumeric': 0.08265759874444153, 'fraction_numerical': 0.007847240387130526, 'mean_word_length': 3.1475054229934925, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '24862', 'n_tokens_mistral': 1096, 'n_tokens_neox': 983, 'n_words': 461}