<commit_before>package main

import (
	"fmt"
	"path/filepath"
	"strings"
)

type Language struct {
	Image   string
	Command string
}

// TODO: This should be extracted
var Extensions = map[string]Language{
	".rb":     Language{"ruby:2.2", "ruby %s"},
	".py":     Language{"python:2.7", "python %s"},
	".js":     Language{"node:0.12", "node %s"},
	".go":     Language{"golang:1.5", "go run %s"},
	".php":    Language{"php:5.6", "php %s"},
	".coffee": Language{"coffescript:0.12", "coffee %s"},
}

func ValidLanguage(ext string) bool {
	for k, _ := range Extensions {
		if k == ext {
			return true
		}
	}

	return false
}

func GetLanguageConfig(filename string) (*Language, error) {
	ext := filepath.Ext(strings.ToLower(filename))

	if !ValidLanguage(ext) {
		return nil, fmt.Errorf("Extension is not supported:", filename)
	}

	lang := Extensions[ext]
	return &lang, nil
}<commit_msg>Fix error message for unsupported extension<commit_after>package main

import (
	"fmt"
	"path/filepath"
	"strings"
)

type Language struct {
	Image   string
	Command string
}

// TODO: This should be extracted
var Extensions = map[string]Language{
	".rb":     Language{"ruby:2.2", "ruby %s"},
	".py":     Language{"python:2.7", "python %s"},
	".js":     Language{"node:0.12", "node %s"},
	".go":     Language{"golang:1.5", "go run %s"},
	".php":    Language{"php:5.6", "php %s"},
	".coffee": Language{"coffescript:0.12", "coffee %s"},
}

func ValidLanguage(ext string) bool {
	for k, _ := range Extensions {
		if k == ext {
			return true
		}
	}

	return false
}

func GetLanguageConfig(filename string) (*Language, error) {
	ext := filepath.Ext(strings.ToLower(filename))

	if !ValidLanguage(ext) {
		return nil, fmt.Errorf("Extension is not supported: %s", ext)
	}

	lang := Extensions[ext]
	return &lang, nil
}
{'fraction_non_alphanumeric': 0.17853170189099, 'fraction_numerical': 0.01557285873192436, 'mean_word_length': 3.955922865013774, 'pattern_counts': {'":': 12, '<': 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': '7256781', 'n_tokens_mistral': 674, 'n_tokens_neox': 639, 'n_words': 170}