Merge pull request #32 from dpaz/dataDir

Subpackage for generated files
This commit is contained in:
Santiago M. Mola 2017-06-27 23:41:19 -07:00 committed by GitHub
commit 47555b6e98
34 changed files with 298234 additions and 297638 deletions

View File

@ -16,7 +16,7 @@ install:
- go get -v -t ./... - go get -v -t ./...
script: script:
- make test - make test-coverage
after_success: after_success:
- bash <(curl -s https://codecov.io/bash) - bash <(curl -s https://codecov.io/bash)

View File

@ -1,3 +1,7 @@
COVERAGE_REPORT := coverage.txt
COVERAGE_PROFILE := profile.out
COVERAGE_MODE := atomic
LINGUIST_PATH = .linguist LINGUIST_PATH = .linguist
$(LINGUIST_PATH): $(LINGUIST_PATH):
@ -6,7 +10,21 @@ $(LINGUIST_PATH):
test: $(LINGUIST_PATH) test: $(LINGUIST_PATH)
go test -v ./... go test -v ./...
test-coverage: $(LINGUIST_PATH)
@echo "mode: $(COVERAGE_MODE)" > $(COVERAGE_REPORT); \
for dir in `find . -name "*.go" | grep -o '.*/' | sort -u | grep -v './fixtures/' | grep -v './.linguist/'`; do \
go test $$dir -coverprofile=$(COVERAGE_PROFILE) -covermode=$(COVERAGE_MODE); \
if [ $$? != 0 ]; then \
exit 2; \
fi; \
if [ -f $(COVERAGE_PROFILE) ]; then \
tail -n +2 $(COVERAGE_PROFILE) >> $(COVERAGE_REPORT); \
rm $(COVERAGE_PROFILE); \
fi; \
done;
code-generate: $(LINGUIST_PATH) code-generate: $(LINGUIST_PATH)
mkdir -p data
go run internal/code-generator/main.go go run internal/code-generator/main.go
clean: clean:

View File

@ -6,6 +6,8 @@ import (
"path/filepath" "path/filepath"
"regexp" "regexp"
"strings" "strings"
"gopkg.in/src-d/enry.v1/data"
) )
// OtherLanguage is used as a zero value when a function can not return a specific language. // OtherLanguage is used as a zero value when a function can not return a specific language.
@ -24,6 +26,12 @@ var DefaultStrategies = []Strategy{
GetLanguagesByClassifier, GetLanguagesByClassifier,
} }
var DefaultClassifier Classifier = &classifier{
languagesLogProbabilities: data.LanguagesLogProbabilities,
tokensLogProbabilities: data.TokensLogProbabilities,
tokensTotal: data.TokensTotal,
}
// GetLanguage applies a sequence of strategies based on the given filename and content // GetLanguage applies a sequence of strategies based on the given filename and content
// to find out the most probably language to return. // to find out the most probably language to return.
func GetLanguage(filename string, content []byte) (language string) { func GetLanguage(filename string, content []byte) (language string) {
@ -249,14 +257,14 @@ func GetLanguagesByVimModeline(filename string, content []byte, candidates []str
// GetLanguagesByFilename returns a slice of possible languages for the given filename, content and candidates // GetLanguagesByFilename returns a slice of possible languages for the given filename, content and candidates
// will be ignored. It complies with the signature to be a Strategy type. // will be ignored. It complies with the signature to be a Strategy type.
func GetLanguagesByFilename(filename string, content []byte, candidates []string) []string { func GetLanguagesByFilename(filename string, content []byte, candidates []string) []string {
return languagesByFilename[filepath.Base(filename)] return data.LanguagesByFilename[filepath.Base(filename)]
} }
// GetLanguagesByShebang returns a slice of possible languages for the given content, filename and candidates // GetLanguagesByShebang returns a slice of possible languages for the given content, filename and candidates
// will be ignored. It complies with the signature to be a Strategy type. // will be ignored. It complies with the signature to be a Strategy type.
func GetLanguagesByShebang(filename string, content []byte, candidates []string) (languages []string) { func GetLanguagesByShebang(filename string, content []byte, candidates []string) (languages []string) {
interpreter := getInterpreter(content) interpreter := getInterpreter(content)
return languagesByInterpreter[interpreter] return data.LanguagesByInterpreter[interpreter]
} }
var ( var (
@ -343,7 +351,7 @@ func GetLanguagesByExtension(filename string, content []byte, candidates []strin
dots := getDotIndexes(filename) dots := getDotIndexes(filename)
for _, dot := range dots { for _, dot := range dots {
ext := filename[dot:] ext := filename[dot:]
languages, ok := languagesByExtension[ext] languages, ok := data.LanguagesByExtension[ext]
if ok { if ok {
return languages return languages
} }
@ -397,7 +405,7 @@ func GetLanguagesBySpecificClassifier(content []byte, candidates []string, class
// GetLanguageExtensions returns the different extensions being used by the language. // GetLanguageExtensions returns the different extensions being used by the language.
func GetLanguageExtensions(language string) []string { func GetLanguageExtensions(language string) []string {
return extensionsByLanguage[language] return data.ExtensionsByLanguage[language]
} }
// Type represent language's type. Either data, programming, markup, prose, or unknown. // Type represent language's type. Either data, programming, markup, prose, or unknown.
@ -414,11 +422,11 @@ const (
// GetLanguageType returns the type of the given language. // GetLanguageType returns the type of the given language.
func GetLanguageType(language string) (langType Type) { func GetLanguageType(language string) (langType Type) {
langType, ok := languagesType[language] intType, ok := data.LanguagesType[language]
langType = Type(intType)
if !ok { if !ok {
langType = Unknown langType = Unknown
} }
return langType return langType
} }
@ -427,7 +435,7 @@ func GetLanguageType(language string) (langType Type) {
func GetLanguageByAlias(alias string) (lang string, ok bool) { func GetLanguageByAlias(alias string) (lang string, ok bool) {
a := strings.Split(alias, `,`)[0] a := strings.Split(alias, `,`)[0]
a = strings.ToLower(a) a = strings.ToLower(a)
lang, ok = languagesByAlias[a] lang, ok = data.LanguagesByAlias[a]
if !ok { if !ok {
lang = OtherLanguage lang = OtherLanguage
} }

View File

@ -1,12 +1,12 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
// languagesByAlias keeps alias for different languages and use the name of the languages as an alias too. // LanguagesByAlias keeps alias for different languages and use the name of the languages as an alias too.
// All the keys (alias or not) are written in lower case and the whitespaces has been replaced by underscores. // All the keys (alias or not) are written in lower case and the whitespaces has been replaced by underscores.
var languagesByAlias = map[string]string{ var LanguagesByAlias = map[string]string{
"1c_enterprise": "1C Enterprise", "1c_enterprise": "1C Enterprise",
"abap": "ABAP", "abap": "ABAP",
"abl": "OpenEdge ABL", "abl": "OpenEdge ABL",

568
data/content.go Normal file
View File

@ -0,0 +1,568 @@
package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
import (
"regexp"
)
type languageMatcher func([]byte) []string
var ContentMatchers = map[string]languageMatcher{
".asc": func(i []byte) []string {
if asc_PublicKey_Matcher_0.Match(i) {
return []string{"Public Key"}
} else if asc_AsciiDoc_Matcher_0.Match(i) {
return []string{"AsciiDoc"}
} else if asc_AGSScript_Matcher_0.Match(i) {
return []string{"AGS Script"}
}
return nil
},
".bb": func(i []byte) []string {
if bb_BlitzBasic_Matcher_0.Match(i) || bb_BlitzBasic_Matcher_1.Match(i) {
return []string{"BlitzBasic"}
} else if bb_BitBake_Matcher_0.Match(i) {
return []string{"BitBake"}
}
return nil
},
".builds": func(i []byte) []string {
if builds_XML_Matcher_0.Match(i) {
return []string{"XML"}
}
return []string{"Text"}
},
".ch": func(i []byte) []string {
if ch_xBase_Matcher_0.Match(i) {
return []string{"xBase"}
}
return nil
},
".cl": func(i []byte) []string {
if cl_CommonLisp_Matcher_0.Match(i) {
return []string{"Common Lisp"}
} else if cl_Cool_Matcher_0.Match(i) {
return []string{"Cool"}
} else if cl_OpenCL_Matcher_0.Match(i) {
return []string{"OpenCL"}
}
return nil
},
".cls": func(i []byte) []string {
if cls_TeX_Matcher_0.Match(i) {
return []string{"TeX"}
}
return nil
},
".cs": func(i []byte) []string {
if cs_Smalltalk_Matcher_0.Match(i) {
return []string{"Smalltalk"}
} else if cs_CSharp_Matcher_0.Match(i) || cs_CSharp_Matcher_1.Match(i) {
return []string{"C#"}
}
return nil
},
".d": func(i []byte) []string {
if d_D_Matcher_0.Match(i) {
return []string{"D"}
} else if d_DTrace_Matcher_0.Match(i) {
return []string{"DTrace"}
} else if d_Makefile_Matcher_0.Match(i) {
return []string{"Makefile"}
}
return nil
},
".ecl": func(i []byte) []string {
if ecl_ECLiPSe_Matcher_0.Match(i) {
return []string{"ECLiPSe"}
} else if ecl_ECL_Matcher_0.Match(i) {
return []string{"ECL"}
}
return nil
},
".es": func(i []byte) []string {
if es_Erlang_Matcher_0.Match(i) {
return []string{"Erlang"}
}
return nil
},
".f": func(i []byte) []string {
if f_Forth_Matcher_0.Match(i) {
return []string{"Forth"}
} else if f_FilebenchWML_Matcher_0.Match(i) {
return []string{"Filebench WML"}
} else if f_Fortran_Matcher_0.Match(i) {
return []string{"Fortran"}
}
return nil
},
".for": func(i []byte) []string {
if for_Forth_Matcher_0.Match(i) {
return []string{"Forth"}
} else if for_Fortran_Matcher_0.Match(i) {
return []string{"Fortran"}
}
return nil
},
".fr": func(i []byte) []string {
if fr_Forth_Matcher_0.Match(i) {
return []string{"Forth"}
} else if fr_Frege_Matcher_0.Match(i) {
return []string{"Frege"}
}
return []string{"Text"}
},
".fs": func(i []byte) []string {
if fs_Forth_Matcher_0.Match(i) {
return []string{"Forth"}
} else if fs_FSharp_Matcher_0.Match(i) {
return []string{"F#"}
} else if fs_GLSL_Matcher_0.Match(i) {
return []string{"GLSL"}
} else if fs_Filterscript_Matcher_0.Match(i) {
return []string{"Filterscript"}
}
return nil
},
".gs": func(i []byte) []string {
if gs_Gosu_Matcher_0.Match(i) {
return []string{"Gosu"}
}
return nil
},
".h": func(i []byte) []string {
if h_ObjectiveDashC_Matcher_0.Match(i) {
return []string{"Objective-C"}
} else if h_CPlusPlus_Matcher_0.Match(i) || h_CPlusPlus_Matcher_1.Match(i) || h_CPlusPlus_Matcher_2.Match(i) || h_CPlusPlus_Matcher_3.Match(i) || h_CPlusPlus_Matcher_4.Match(i) || h_CPlusPlus_Matcher_5.Match(i) || h_CPlusPlus_Matcher_6.Match(i) {
return []string{"C++"}
}
return nil
},
".inc": func(i []byte) []string {
if inc_PHP_Matcher_0.Match(i) {
return []string{"PHP"}
} else if inc_POVDashRaySDL_Matcher_0.Match(i) {
return []string{"POV-Ray SDL"}
}
return nil
},
".l": func(i []byte) []string {
if l_CommonLisp_Matcher_0.Match(i) {
return []string{"Common Lisp"}
} else if l_Lex_Matcher_0.Match(i) {
return []string{"Lex"}
} else if l_Roff_Matcher_0.Match(i) {
return []string{"Roff"}
} else if l_PicoLisp_Matcher_0.Match(i) {
return []string{"PicoLisp"}
}
return nil
},
".ls": func(i []byte) []string {
if ls_LoomScript_Matcher_0.Match(i) {
return []string{"LoomScript"}
}
return []string{"LiveScript"}
},
".lsp": func(i []byte) []string {
if lsp_CommonLisp_Matcher_0.Match(i) {
return []string{"Common Lisp"}
} else if lsp_NewLisp_Matcher_0.Match(i) {
return []string{"NewLisp"}
}
return nil
},
".lisp": func(i []byte) []string {
if lisp_CommonLisp_Matcher_0.Match(i) {
return []string{"Common Lisp"}
} else if lisp_NewLisp_Matcher_0.Match(i) {
return []string{"NewLisp"}
}
return nil
},
".m": func(i []byte) []string {
if m_ObjectiveDashC_Matcher_0.Match(i) {
return []string{"Objective-C"}
} else if m_Mercury_Matcher_0.Match(i) {
return []string{"Mercury"}
} else if m_MUF_Matcher_0.Match(i) {
return []string{"MUF"}
} else if m_M_Matcher_0.Match(i) {
return []string{"M"}
} else if m_Mathematica_Matcher_0.Match(i) {
return []string{"Mathematica"}
} else if m_Matlab_Matcher_0.Match(i) {
return []string{"Matlab"}
} else if m_Limbo_Matcher_0.Match(i) {
return []string{"Limbo"}
}
return nil
},
".md": func(i []byte) []string {
if md_Markdown_Matcher_0.Match(i) || md_Markdown_Matcher_1.Match(i) {
return []string{"Markdown"}
} else if md_GCCMachineDescription_Matcher_0.Match(i) {
return []string{"GCC Machine Description"}
}
return []string{"Markdown"}
},
".ml": func(i []byte) []string {
if ml_OCaml_Matcher_0.Match(i) {
return []string{"OCaml"}
} else if ml_StandardML_Matcher_0.Match(i) {
return []string{"Standard ML"}
}
return nil
},
".mod": func(i []byte) []string {
if mod_XML_Matcher_0.Match(i) {
return []string{"XML"}
} else if mod_ModulaDash2_Matcher_0.Match(i) || mod_ModulaDash2_Matcher_1.Match(i) {
return []string{"Modula-2"}
}
return []string{"Linux Kernel Module", "AMPL"}
},
".ms": func(i []byte) []string {
if ms_Roff_Matcher_0.Match(i) {
return []string{"Roff"}
}
return []string{"MAXScript"}
},
".n": func(i []byte) []string {
if n_Roff_Matcher_0.Match(i) {
return []string{"Roff"}
} else if n_Nemerle_Matcher_0.Match(i) {
return []string{"Nemerle"}
}
return nil
},
".ncl": func(i []byte) []string {
if ncl_Text_Matcher_0.Match(i) {
return []string{"Text"}
}
return nil
},
".nl": func(i []byte) []string {
if nl_NL_Matcher_0.Match(i) {
return []string{"NL"}
}
return []string{"NewLisp"}
},
".php": func(i []byte) []string {
if php_Hack_Matcher_0.Match(i) {
return []string{"Hack"}
} else if php_PHP_Matcher_0.Match(i) {
return []string{"PHP"}
}
return nil
},
".pl": func(i []byte) []string {
if pl_Prolog_Matcher_0.Match(i) {
return []string{"Prolog"}
} else if pl_Perl_Matcher_0.Match(i) {
return []string{"Perl"}
} else if pl_Perl6_Matcher_0.Match(i) {
return []string{"Perl6"}
}
return nil
},
".pm": func(i []byte) []string {
if pm_Perl6_Matcher_0.Match(i) {
return []string{"Perl6"}
} else if pm_Perl_Matcher_0.Match(i) {
return []string{"Perl"}
}
return nil
},
".pod": func(i []byte) []string {
if pod_Pod_Matcher_0.Match(i) {
return []string{"Pod"}
}
return []string{"Perl"}
},
".pro": func(i []byte) []string {
if pro_Prolog_Matcher_0.Match(i) {
return []string{"Prolog"}
} else if pro_INI_Matcher_0.Match(i) {
return []string{"INI"}
} else if pro_QMake_Matcher_0.Match(i) && pro_QMake_Matcher_1.Match(i) {
return []string{"QMake"}
} else if pro_IDL_Matcher_0.Match(i) {
return []string{"IDL"}
}
return nil
},
".props": func(i []byte) []string {
if props_XML_Matcher_0.Match(i) {
return []string{"XML"}
} else if props_INI_Matcher_0.Match(i) {
return []string{"INI"}
}
return nil
},
".r": func(i []byte) []string {
if r_Rebol_Matcher_0.Match(i) {
return []string{"Rebol"}
} else if r_R_Matcher_0.Match(i) {
return []string{"R"}
}
return nil
},
".rno": func(i []byte) []string {
if rno_RUNOFF_Matcher_0.Match(i) {
return []string{"RUNOFF"}
} else if rno_Roff_Matcher_0.Match(i) {
return []string{"Roff"}
}
return nil
},
".rpy": func(i []byte) []string {
if rpy_Python_Matcher_0.Match(i) {
return []string{"Python"}
}
return []string{"Ren'Py"}
},
".rs": func(i []byte) []string {
if rs_Rust_Matcher_0.Match(i) {
return []string{"Rust"}
} else if rs_RenderScript_Matcher_0.Match(i) {
return []string{"RenderScript"}
}
return nil
},
".sc": func(i []byte) []string {
if sc_SuperCollider_Matcher_0.Match(i) || sc_SuperCollider_Matcher_1.Match(i) || sc_SuperCollider_Matcher_2.Match(i) {
return []string{"SuperCollider"}
} else if sc_Scala_Matcher_0.Match(i) || sc_Scala_Matcher_1.Match(i) || sc_Scala_Matcher_2.Match(i) {
return []string{"Scala"}
}
return nil
},
".sql": func(i []byte) []string {
if sql_PLpgSQL_Matcher_0.Match(i) || sql_PLpgSQL_Matcher_1.Match(i) || sql_PLpgSQL_Matcher_2.Match(i) {
return []string{"PLpgSQL"}
} else if sql_SQLPL_Matcher_0.Match(i) || sql_SQLPL_Matcher_1.Match(i) {
return []string{"SQLPL"}
} else if sql_PLSQL_Matcher_0.Match(i) || sql_PLSQL_Matcher_1.Match(i) {
return []string{"PLSQL"}
} else if sql_SQL_Matcher_0.Match(i) {
return []string{"SQL"}
}
return nil
},
".srt": func(i []byte) []string {
if srt_SubRipText_Matcher_0.Match(i) {
return []string{"SubRip Text"}
}
return nil
},
".t": func(i []byte) []string {
if t_Turing_Matcher_0.Match(i) {
return []string{"Turing"}
} else if t_Perl6_Matcher_0.Match(i) {
return []string{"Perl6"}
} else if t_Perl_Matcher_0.Match(i) {
return []string{"Perl"}
}
return nil
},
".toc": func(i []byte) []string {
if toc_WorldofWarcraftAddonData_Matcher_0.Match(i) {
return []string{"World of Warcraft Addon Data"}
} else if toc_TeX_Matcher_0.Match(i) {
return []string{"TeX"}
}
return nil
},
".ts": func(i []byte) []string {
if ts_XML_Matcher_0.Match(i) {
return []string{"XML"}
}
return []string{"TypeScript"}
},
".tst": func(i []byte) []string {
if tst_GAP_Matcher_0.Match(i) {
return []string{"GAP"}
}
return []string{"Scilab"}
},
".tsx": func(i []byte) []string {
if tsx_TypeScript_Matcher_0.Match(i) {
return []string{"TypeScript"}
} else if tsx_XML_Matcher_0.Match(i) {
return []string{"XML"}
}
return nil
},
}
var (
asc_PublicKey_Matcher_0 = regexp.MustCompile(`(?m)^(----[- ]BEGIN|ssh-(rsa|dss)) `)
asc_AsciiDoc_Matcher_0 = regexp.MustCompile(`(?m)^[=-]+(\s|\n)|{{[A-Za-z]`)
asc_AGSScript_Matcher_0 = regexp.MustCompile(`(?m)^(\/\/.+|((import|export)\s+)?(function|int|float|char)\s+((room|repeatedly|on|game)_)?([A-Za-z]+[A-Za-z_0-9]+)\s*[;\(])`)
bb_BlitzBasic_Matcher_0 = regexp.MustCompile(`(?m)^\s*; `)
bb_BlitzBasic_Matcher_1 = regexp.MustCompile(`(?m)End Function`)
bb_BitBake_Matcher_0 = regexp.MustCompile(`(?m)^\s*(# |include|require)\b`)
builds_XML_Matcher_0 = regexp.MustCompile(`(?mi)^(\s*)(<Project|<Import|<Property|<?xml|xmlns)`)
ch_xBase_Matcher_0 = regexp.MustCompile(`(?mi)^\s*#\s*(if|ifdef|ifndef|define|command|xcommand|translate|xtranslate|include|pragma|undef)\b`)
cl_CommonLisp_Matcher_0 = regexp.MustCompile(`(?mi)^\s*\((defun|in-package|defpackage) `)
cl_Cool_Matcher_0 = regexp.MustCompile(`(?m)^class`)
cl_OpenCL_Matcher_0 = regexp.MustCompile(`(?m)\/\* |\/\/ |^\}`)
cls_TeX_Matcher_0 = regexp.MustCompile(`(?m)\\\w+{`)
cs_Smalltalk_Matcher_0 = regexp.MustCompile(`(?m)![\w\s]+methodsFor: `)
cs_CSharp_Matcher_0 = regexp.MustCompile(`(?m)^\s*namespace\s*[\w\.]+\s*{`)
cs_CSharp_Matcher_1 = regexp.MustCompile(`(?m)^\s*\/\/`)
d_D_Matcher_0 = regexp.MustCompile(`(?m)^module\s+[\w.]*\s*;|import\s+[\w\s,.:]*;|\w+\s+\w+\s*\(.*\)(?:\(.*\))?\s*{[^}]*}|unittest\s*(?:\(.*\))?\s*{[^}]*}`)
d_DTrace_Matcher_0 = regexp.MustCompile(`(?m)^(\w+:\w*:\w*:\w*|BEGIN|END|provider\s+|(tick|profile)-\w+\s+{[^}]*}|#pragma\s+D\s+(option|attributes|depends_on)\s|#pragma\s+ident\s)`)
d_Makefile_Matcher_0 = regexp.MustCompile(`(?m)([\/\\].*:\s+.*\s\\$|: \\$|^ : |^[\w\s\/\\.]+\w+\.\w+\s*:\s+[\w\s\/\\.]+\w+\.\w+)`)
ecl_ECLiPSe_Matcher_0 = regexp.MustCompile(`(?m)^[^#]+:-`)
ecl_ECL_Matcher_0 = regexp.MustCompile(`(?m):=`)
es_Erlang_Matcher_0 = regexp.MustCompile(`(?m)^\s*(?:%%|main\s*\(.*?\)\s*->)`)
f_Forth_Matcher_0 = regexp.MustCompile(`(?m)^: `)
f_FilebenchWML_Matcher_0 = regexp.MustCompile(`(?m)flowop`)
f_Fortran_Matcher_0 = regexp.MustCompile(`(?mi)^([c*][^abd-z]| (subroutine|program|end|data)\s|\s*!)`)
for_Forth_Matcher_0 = regexp.MustCompile(`(?m)^: `)
for_Fortran_Matcher_0 = regexp.MustCompile(`(?mi)^([c*][^abd-z]| (subroutine|program|end|data)\s|\s*!)`)
fr_Forth_Matcher_0 = regexp.MustCompile(`(?m)^(: |also |new-device|previous )`)
fr_Frege_Matcher_0 = regexp.MustCompile(`(?m)^\s*(import|module|package|data|type) `)
fs_Forth_Matcher_0 = regexp.MustCompile(`(?m)^(: |new-device)`)
fs_FSharp_Matcher_0 = regexp.MustCompile(`(?m)^\s*(#light|import|let|module|namespace|open|type)`)
fs_GLSL_Matcher_0 = regexp.MustCompile(`(?m)^\s*(#version|precision|uniform|varying|vec[234])`)
fs_Filterscript_Matcher_0 = regexp.MustCompile(`(?m)#include|#pragma\s+(rs|version)|__attribute__`)
gs_Gosu_Matcher_0 = regexp.MustCompile(`(?m)^uses java\.`)
h_ObjectiveDashC_Matcher_0 = regexp.MustCompile(`(?m)^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])`)
h_CPlusPlus_Matcher_0 = regexp.MustCompile(`(?m)^\s*#\s*include <(cstdint|string|vector|map|list|array|bitset|queue|stack|forward_list|unordered_map|unordered_set|(i|o|io)stream)>`)
h_CPlusPlus_Matcher_1 = regexp.MustCompile(`(?m)^\s*template\s*<`)
h_CPlusPlus_Matcher_2 = regexp.MustCompile(`(?m)^[ \t]*try`)
h_CPlusPlus_Matcher_3 = regexp.MustCompile(`(?m)^[ \t]*catch\s*\(`)
h_CPlusPlus_Matcher_4 = regexp.MustCompile(`(?m)^[ \t]*(class|(using[ \t]+)?namespace)\s+\w+`)
h_CPlusPlus_Matcher_5 = regexp.MustCompile(`(?m)^[ \t]*(private|public|protected):$`)
h_CPlusPlus_Matcher_6 = regexp.MustCompile(`(?m)std::\w+`)
inc_PHP_Matcher_0 = regexp.MustCompile(`(?m)^<\?(?:php)?`)
inc_POVDashRaySDL_Matcher_0 = regexp.MustCompile(`(?m)^\s*#(declare|local|macro|while)\s`)
l_CommonLisp_Matcher_0 = regexp.MustCompile(`(?m)\(def(un|macro)\s`)
l_Lex_Matcher_0 = regexp.MustCompile(`(?m)^(%[%{}]xs|<.*>)`)
l_Roff_Matcher_0 = regexp.MustCompile(`(?mi)^\.[a-z][a-z](\s|$)`)
l_PicoLisp_Matcher_0 = regexp.MustCompile(`(?m)^\((de|class|rel|code|data|must)\s`)
ls_LoomScript_Matcher_0 = regexp.MustCompile(`(?m)^\s*package\s*[\w\.\/\*\s]*\s*{`)
lsp_CommonLisp_Matcher_0 = regexp.MustCompile(`(?mi)^\s*\((defun|in-package|defpackage) `)
lsp_NewLisp_Matcher_0 = regexp.MustCompile(`(?m)^\s*\(define `)
lisp_CommonLisp_Matcher_0 = regexp.MustCompile(`(?mi)^\s*\((defun|in-package|defpackage) `)
lisp_NewLisp_Matcher_0 = regexp.MustCompile(`(?m)^\s*\(define `)
m_ObjectiveDashC_Matcher_0 = regexp.MustCompile(`(?m)^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])`)
m_Mercury_Matcher_0 = regexp.MustCompile(`(?m):- module`)
m_MUF_Matcher_0 = regexp.MustCompile(`(?m)^: `)
m_M_Matcher_0 = regexp.MustCompile(`(?m)^\s*;`)
m_Mathematica_Matcher_0 = regexp.MustCompile(`(?m)\*\)$`)
m_Matlab_Matcher_0 = regexp.MustCompile(`(?m)^\s*%`)
m_Limbo_Matcher_0 = regexp.MustCompile(`(?m)^\w+\s*:\s*module\s*{`)
md_Markdown_Matcher_0 = regexp.MustCompile(`(?mi)(^[-a-z0-9=#!\*\[|>])|<\/`)
md_Markdown_Matcher_1 = regexp.MustCompile(`^$`)
md_GCCMachineDescription_Matcher_0 = regexp.MustCompile(`(?m)^(;;|\(define_)`)
ml_OCaml_Matcher_0 = regexp.MustCompile(`(?m)(^\s*module)|let rec |match\s+(\S+\s)+with`)
ml_StandardML_Matcher_0 = regexp.MustCompile(`(?m)=> |case\s+(\S+\s)+of`)
mod_XML_Matcher_0 = regexp.MustCompile(`(?m)<!ENTITY `)
mod_ModulaDash2_Matcher_0 = regexp.MustCompile(`(?mi)^\s*MODULE [\w\.]+;`)
mod_ModulaDash2_Matcher_1 = regexp.MustCompile(`(?mi)^\s*END [\w\.]+;`)
ms_Roff_Matcher_0 = regexp.MustCompile(`(?mi)^[.'][a-z][a-z](\s|$)`)
n_Roff_Matcher_0 = regexp.MustCompile(`(?m)^[.']`)
n_Nemerle_Matcher_0 = regexp.MustCompile(`(?m)^(module|namespace|using)\s`)
ncl_Text_Matcher_0 = regexp.MustCompile(`(?m)THE_TITLE`)
nl_NL_Matcher_0 = regexp.MustCompile(`(?m)^(b|g)[0-9]+ `)
php_Hack_Matcher_0 = regexp.MustCompile(`(?m)<\?hh`)
php_PHP_Matcher_0 = regexp.MustCompile(`(?m)<?[^h]`)
pl_Prolog_Matcher_0 = regexp.MustCompile(`(?m)^[^#]*:-`)
pl_Perl_Matcher_0 = regexp.MustCompile(`(?m)use strict|use\s+v?5\.`)
pl_Perl6_Matcher_0 = regexp.MustCompile(`(?m)^(use v6|(my )?class|module)`)
pm_Perl6_Matcher_0 = regexp.MustCompile(`(?m)^\s*(?:use\s+v6\s*;|(?:\bmy\s+)?class|module)\b`)
pm_Perl_Matcher_0 = regexp.MustCompile(`(?m)\buse\s+(?:strict\b|v?5\.)`)
pod_Pod_Matcher_0 = regexp.MustCompile(`(?m)^=\w+\b`)
pro_Prolog_Matcher_0 = regexp.MustCompile(`(?m)^[^#]+:-`)
pro_INI_Matcher_0 = regexp.MustCompile(`(?m)last_client=`)
pro_QMake_Matcher_0 = regexp.MustCompile(`(?m)HEADERS`)
pro_QMake_Matcher_1 = regexp.MustCompile(`(?m)SOURCES`)
pro_IDL_Matcher_0 = regexp.MustCompile(`(?m)^\s*function[ \w,]+$`)
props_XML_Matcher_0 = regexp.MustCompile(`(?mi)^(\s*)(<Project|<Import|<Property|<?xml|xmlns)`)
props_INI_Matcher_0 = regexp.MustCompile(`(?mi)\w+\s*=\s*`)
r_Rebol_Matcher_0 = regexp.MustCompile(`(?mi)\bRebol\b`)
r_R_Matcher_0 = regexp.MustCompile(`(?m)<-|^\s*#`)
rno_RUNOFF_Matcher_0 = regexp.MustCompile(`(?mi)^\.!|^\.end lit(?:eral)?\b`)
rno_Roff_Matcher_0 = regexp.MustCompile(`(?m)^\.\\" `)
rpy_Python_Matcher_0 = regexp.MustCompile(`(?ms)(^(import|from|class|def)\s)`)
rs_Rust_Matcher_0 = regexp.MustCompile(`(?m)^(use |fn |mod |pub |macro_rules|impl|#!?\[)`)
rs_RenderScript_Matcher_0 = regexp.MustCompile(`(?m)#include|#pragma\s+(rs|version)|__attribute__`)
sc_SuperCollider_Matcher_0 = regexp.MustCompile(`(?m)\^(this|super)\.`)
sc_SuperCollider_Matcher_1 = regexp.MustCompile(`(?m)^\s*(\+|\*)\s*\w+\s*{`)
sc_SuperCollider_Matcher_2 = regexp.MustCompile(`(?m)^\s*~\w+\s*=\.`)
sc_Scala_Matcher_0 = regexp.MustCompile(`(?m)^\s*import (scala|java)\.`)
sc_Scala_Matcher_1 = regexp.MustCompile(`(?m)^\s*val\s+\w+\s*=`)
sc_Scala_Matcher_2 = regexp.MustCompile(`(?m)^\s*class\b`)
sql_PLpgSQL_Matcher_0 = regexp.MustCompile(`(?mi)^\\i\b|AS \$\$|LANGUAGE '?plpgsql'?`)
sql_PLpgSQL_Matcher_1 = regexp.MustCompile(`(?mi)SECURITY (DEFINER|INVOKER)`)
sql_PLpgSQL_Matcher_2 = regexp.MustCompile(`(?mi)BEGIN( WORK| TRANSACTION)?;`)
sql_SQLPL_Matcher_0 = regexp.MustCompile(`(?mi)(alter module)|(language sql)|(begin( NOT)+ atomic)`)
sql_SQLPL_Matcher_1 = regexp.MustCompile(`(?mi)signal SQLSTATE '[0-9]+'`)
sql_PLSQL_Matcher_0 = regexp.MustCompile(`(?mi)\$\$PLSQL_|XMLTYPE|sysdate|systimestamp|\.nextval|connect by|AUTHID (DEFINER|CURRENT_USER)`)
sql_PLSQL_Matcher_1 = regexp.MustCompile(`(?mi)constructor\W+function`)
sql_SQL_Matcher_0 = regexp.MustCompile(`(?mi)! /begin|boolean|package|exception`)
srt_SubRipText_Matcher_0 = regexp.MustCompile(`(?m)^(\d{2}:\d{2}:\d{2},\d{3})\s*(-->)\s*(\d{2}:\d{2}:\d{2},\d{3})$`)
t_Turing_Matcher_0 = regexp.MustCompile(`(?m)^\s*%[ \t]+|^\s*var\s+\w+\s*:=\s*\w+`)
t_Perl6_Matcher_0 = regexp.MustCompile(`(?m)^\s*(?:use\s+v6\s*;|\bmodule\b|\b(?:my\s+)?class\b)`)
t_Perl_Matcher_0 = regexp.MustCompile(`(?m)\buse\s+(?:strict\b|v?5\.)`)
toc_WorldofWarcraftAddonData_Matcher_0 = regexp.MustCompile(`(?m)^## |@no-lib-strip@`)
toc_TeX_Matcher_0 = regexp.MustCompile(`(?m)^\\(contentsline|defcounter|beamer|boolfalse)`)
ts_XML_Matcher_0 = regexp.MustCompile(`(?m)<TS`)
tst_GAP_Matcher_0 = regexp.MustCompile(`(?m)gap> `)
tsx_TypeScript_Matcher_0 = regexp.MustCompile(`(?m)^\s*(import.+(from\s+|require\()['"]react|\/\/\/\s*<reference\s)`)
tsx_XML_Matcher_0 = regexp.MustCompile(`(?mi)^\s*<\?xml\s+version`)
)

View File

@ -1,4 +1,4 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
@ -6,7 +6,7 @@ package enry
import "gopkg.in/toqueteos/substring.v1" import "gopkg.in/toqueteos/substring.v1"
var documentationMatchers = substring.Or( var DocumentationMatchers = substring.Or(
substring.Regexp(`^[Dd]ocs?/`), substring.Regexp(`^[Dd]ocs?/`),
substring.Regexp(`(^|/)[Dd]ocumentation/`), substring.Regexp(`(^|/)[Dd]ocumentation/`),
substring.Regexp(`(^|/)[Jj]avadoc/`), substring.Regexp(`(^|/)[Jj]avadoc/`),

View File

@ -1,10 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var languagesByExtension = map[string][]string{ var LanguagesByExtension = map[string][]string{
".1": {"Roff"}, ".1": {"Roff"},
".1in": {"Roff"}, ".1in": {"Roff"},
".1m": {"Roff"}, ".1m": {"Roff"},
@ -1003,7 +1003,7 @@ var languagesByExtension = map[string][]string{
".zsh": {"Shell"}, ".zsh": {"Shell"},
} }
var extensionsByLanguage = map[string][]string{ var ExtensionsByLanguage = map[string][]string{
"1C Enterprise": {".bsl", ".os"}, "1C Enterprise": {".bsl", ".os"},
"ABAP": {".abap"}, "ABAP": {".abap"},
"ABNF": {".abnf"}, "ABNF": {".abnf"},

View File

@ -1,10 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var languagesByFilename = map[string][]string{ var LanguagesByFilename = map[string][]string{
".Rprofile": {"R"}, ".Rprofile": {"R"},
".XCompose": {"XCompose"}, ".XCompose": {"XCompose"},
".abbrev_defs": {"Emacs Lisp"}, ".abbrev_defs": {"Emacs Lisp"},

View File

@ -1,11 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var DefaultClassifier Classifier = &classifier{ var LanguagesLogProbabilities = map[string]float64{
languagesLogProbabilities: map[string]float64{
"1C Enterprise": -5.720858, "1C Enterprise": -5.720858,
"ABAP": -7.512618, "ABAP": -7.512618,
"ABNF": -7.512618, "ABNF": -7.512618,
@ -383,8 +382,9 @@ var DefaultClassifier Classifier = &classifier{
"reStructuredText": -7.512618, "reStructuredText": -7.512618,
"wisp": -7.512618, "wisp": -7.512618,
"xBase": -6.414005, "xBase": -6.414005,
}, }
tokensLogProbabilities: map[string]map[string]float64{
var TokensLogProbabilities = map[string]map[string]float64{
"1C Enterprise": map[string]float64{ "1C Enterprise": map[string]float64{
"#": -8.978471, "#": -8.978471,
"&": -6.675886, "&": -6.675886,
@ -148319,6 +148319,6 @@ var DefaultClassifier Classifier = &classifier{
"|": -5.355406, "|": -5.355406,
"}": -3.797262, "}": -3.797262,
}, },
},
tokensTotal: 1684174.000000,
} }
var TokensTotal = 1684174.000000

View File

@ -1,10 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var languagesByInterpreter = map[string][]string{ var LanguagesByInterpreter = map[string][]string{
"Rscript": {"R"}, "Rscript": {"R"},
"apl": {"APL"}, "apl": {"APL"},
"aplx": {"APL"}, "aplx": {"APL"},

459
data/type.go Normal file
View File

@ -0,0 +1,459 @@
package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var LanguagesType = map[string]int{
"1C Enterprise": 2,
"ABAP": 2,
"ABNF": 1,
"AGS Script": 2,
"AMPL": 2,
"ANTLR": 2,
"API Blueprint": 3,
"APL": 2,
"ASN.1": 1,
"ASP": 2,
"ATS": 2,
"ActionScript": 2,
"Ada": 2,
"Agda": 2,
"Alloy": 2,
"Alpine Abuild": 2,
"Ant Build System": 1,
"ApacheConf": 3,
"Apex": 2,
"Apollo Guidance Computer": 2,
"AppleScript": 2,
"Arc": 2,
"Arduino": 2,
"AsciiDoc": 4,
"AspectJ": 2,
"Assembly": 2,
"Augeas": 2,
"AutoHotkey": 2,
"AutoIt": 2,
"Awk": 2,
"Batchfile": 2,
"Befunge": 2,
"Bison": 2,
"BitBake": 2,
"Blade": 3,
"BlitzBasic": 2,
"BlitzMax": 2,
"Bluespec": 2,
"Boo": 2,
"Brainfuck": 2,
"Brightscript": 2,
"Bro": 2,
"C": 2,
"C#": 2,
"C++": 2,
"C-ObjDump": 1,
"C2hs Haskell": 2,
"CLIPS": 2,
"CMake": 2,
"COBOL": 2,
"COLLADA": 1,
"CSON": 1,
"CSS": 3,
"CSV": 1,
"CWeb": 2,
"Cap'n Proto": 2,
"CartoCSS": 2,
"Ceylon": 2,
"Chapel": 2,
"Charity": 2,
"ChucK": 2,
"Cirru": 2,
"Clarion": 2,
"Clean": 2,
"Click": 2,
"Clojure": 2,
"Closure Templates": 3,
"CoffeeScript": 2,
"ColdFusion": 2,
"ColdFusion CFC": 2,
"Common Lisp": 2,
"Component Pascal": 2,
"Cool": 2,
"Coq": 2,
"Cpp-ObjDump": 1,
"Creole": 4,
"Crystal": 2,
"Csound": 2,
"Csound Document": 2,
"Csound Score": 2,
"Cuda": 2,
"Cycript": 2,
"Cython": 2,
"D": 2,
"D-ObjDump": 1,
"DIGITAL Command Language": 2,
"DM": 2,
"DNS Zone": 1,
"DTrace": 2,
"Darcs Patch": 1,
"Dart": 2,
"Diff": 1,
"Dockerfile": 1,
"Dogescript": 2,
"Dylan": 2,
"E": 2,
"EBNF": 1,
"ECL": 2,
"ECLiPSe": 2,
"EJS": 3,
"EQ": 2,
"Eagle": 3,
"Ecere Projects": 1,
"Eiffel": 2,
"Elixir": 2,
"Elm": 2,
"Emacs Lisp": 2,
"EmberScript": 2,
"Erlang": 2,
"F#": 2,
"FLUX": 2,
"Factor": 2,
"Fancy": 2,
"Fantom": 2,
"Filebench WML": 2,
"Filterscript": 2,
"Formatted": 1,
"Forth": 2,
"Fortran": 2,
"FreeMarker": 2,
"Frege": 2,
"G-code": 1,
"GAMS": 2,
"GAP": 2,
"GCC Machine Description": 2,
"GDB": 2,
"GDScript": 2,
"GLSL": 2,
"GN": 1,
"Game Maker Language": 2,
"Genie": 2,
"Genshi": 2,
"Gentoo Ebuild": 2,
"Gentoo Eclass": 2,
"Gettext Catalog": 4,
"Gherkin": 2,
"Glyph": 2,
"Gnuplot": 2,
"Go": 2,
"Golo": 2,
"Gosu": 2,
"Grace": 2,
"Gradle": 1,
"Grammatical Framework": 2,
"Graph Modeling Language": 1,
"GraphQL": 1,
"Graphviz (DOT)": 1,
"Groovy": 2,
"Groovy Server Pages": 2,
"HCL": 2,
"HLSL": 2,
"HTML": 3,
"HTML+Django": 3,
"HTML+ECR": 3,
"HTML+EEX": 3,
"HTML+ERB": 3,
"HTML+PHP": 3,
"HTTP": 1,
"Hack": 2,
"Haml": 3,
"Handlebars": 3,
"Harbour": 2,
"Haskell": 2,
"Haxe": 2,
"Hy": 2,
"HyPhy": 2,
"IDL": 2,
"IGOR Pro": 2,
"INI": 1,
"IRC log": 1,
"Idris": 2,
"Inform 7": 2,
"Inno Setup": 2,
"Io": 2,
"Ioke": 2,
"Isabelle": 2,
"Isabelle ROOT": 2,
"J": 2,
"JFlex": 2,
"JSON": 1,
"JSON5": 1,
"JSONLD": 1,
"JSONiq": 2,
"JSX": 2,
"Jasmin": 2,
"Java": 2,
"Java Server Pages": 2,
"JavaScript": 2,
"Jison": 2,
"Jison Lex": 2,
"Jolie": 2,
"Julia": 2,
"Jupyter Notebook": 3,
"KRL": 2,
"KiCad": 2,
"Kit": 3,
"Kotlin": 2,
"LFE": 2,
"LLVM": 2,
"LOLCODE": 2,
"LSL": 2,
"LabVIEW": 2,
"Lasso": 2,
"Latte": 3,
"Lean": 2,
"Less": 3,
"Lex": 2,
"LilyPond": 2,
"Limbo": 2,
"Linker Script": 1,
"Linux Kernel Module": 1,
"Liquid": 3,
"Literate Agda": 2,
"Literate CoffeeScript": 2,
"Literate Haskell": 2,
"LiveScript": 2,
"Logos": 2,
"Logtalk": 2,
"LookML": 2,
"LoomScript": 2,
"Lua": 2,
"M": 2,
"M4": 2,
"M4Sugar": 2,
"MAXScript": 2,
"MQL4": 2,
"MQL5": 2,
"MTML": 3,
"MUF": 2,
"Makefile": 2,
"Mako": 2,
"Markdown": 4,
"Marko": 3,
"Mask": 3,
"Mathematica": 2,
"Matlab": 2,
"Maven POM": 1,
"Max": 2,
"MediaWiki": 4,
"Mercury": 2,
"Meson": 2,
"Metal": 2,
"MiniD": 2,
"Mirah": 2,
"Modelica": 2,
"Modula-2": 2,
"Module Management System": 2,
"Monkey": 2,
"Moocode": 2,
"MoonScript": 2,
"Myghty": 2,
"NCL": 2,
"NL": 1,
"NSIS": 2,
"Nemerle": 2,
"NetLinx": 2,
"NetLinx+ERB": 2,
"NetLogo": 2,
"NewLisp": 2,
"Nginx": 3,
"Nim": 2,
"Ninja": 1,
"Nit": 2,
"Nix": 2,
"Nu": 2,
"NumPy": 2,
"OCaml": 2,
"ObjDump": 1,
"Objective-C": 2,
"Objective-C++": 2,
"Objective-J": 2,
"Omgrofl": 2,
"Opa": 2,
"Opal": 2,
"OpenCL": 2,
"OpenEdge ABL": 2,
"OpenRC runscript": 2,
"OpenSCAD": 2,
"OpenType Feature File": 1,
"Org": 4,
"Ox": 2,
"Oxygene": 2,
"Oz": 2,
"P4": 2,
"PAWN": 2,
"PHP": 2,
"PLSQL": 2,
"PLpgSQL": 2,
"POV-Ray SDL": 2,
"Pan": 2,
"Papyrus": 2,
"Parrot": 2,
"Parrot Assembly": 2,
"Parrot Internal Representation": 2,
"Pascal": 2,
"Pep8": 2,
"Perl": 2,
"Perl6": 2,
"Pic": 3,
"Pickle": 1,
"PicoLisp": 2,
"PigLatin": 2,
"Pike": 2,
"Pod": 4,
"PogoScript": 2,
"Pony": 2,
"PostScript": 3,
"PowerBuilder": 2,
"PowerShell": 2,
"Processing": 2,
"Prolog": 2,
"Propeller Spin": 2,
"Protocol Buffer": 3,
"Public Key": 1,
"Pug": 3,
"Puppet": 2,
"Pure Data": 2,
"PureBasic": 2,
"PureScript": 2,
"Python": 2,
"Python console": 2,
"Python traceback": 1,
"QML": 2,
"QMake": 2,
"R": 2,
"RAML": 3,
"RDoc": 4,
"REALbasic": 2,
"REXX": 2,
"RHTML": 3,
"RMarkdown": 4,
"RPM Spec": 1,
"RUNOFF": 3,
"Racket": 2,
"Ragel": 2,
"Rascal": 2,
"Raw token data": 1,
"Reason": 2,
"Rebol": 2,
"Red": 2,
"Redcode": 2,
"Regular Expression": 1,
"Ren'Py": 2,
"RenderScript": 2,
"RobotFramework": 2,
"Roff": 3,
"Rouge": 2,
"Ruby": 2,
"Rust": 2,
"SAS": 2,
"SCSS": 3,
"SMT": 2,
"SPARQL": 1,
"SQF": 2,
"SQL": 1,
"SQLPL": 2,
"SRecode Template": 3,
"STON": 1,
"SVG": 1,
"Sage": 2,
"SaltStack": 2,
"Sass": 3,
"Scala": 2,
"Scaml": 3,
"Scheme": 2,
"Scilab": 2,
"Self": 2,
"ShaderLab": 2,
"Shell": 2,
"ShellSession": 2,
"Shen": 2,
"Slash": 2,
"Slim": 3,
"Smali": 2,
"Smalltalk": 2,
"Smarty": 2,
"SourcePawn": 2,
"Spline Font Database": 1,
"Squirrel": 2,
"Stan": 2,
"Standard ML": 2,
"Stata": 2,
"Stylus": 3,
"SubRip Text": 1,
"Sublime Text Config": 1,
"SuperCollider": 2,
"Swift": 2,
"SystemVerilog": 2,
"TI Program": 2,
"TLA": 2,
"TOML": 1,
"TXL": 2,
"Tcl": 2,
"Tcsh": 2,
"TeX": 3,
"Tea": 3,
"Terra": 2,
"Text": 4,
"Textile": 4,
"Thrift": 2,
"Turing": 2,
"Turtle": 1,
"Twig": 3,
"Type Language": 1,
"TypeScript": 2,
"Unified Parallel C": 2,
"Unity3D Asset": 1,
"Unix Assembly": 2,
"Uno": 2,
"UnrealScript": 2,
"UrWeb": 2,
"VCL": 2,
"VHDL": 2,
"Vala": 2,
"Verilog": 2,
"Vim script": 2,
"Visual Basic": 2,
"Volt": 2,
"Vue": 3,
"Wavefront Material": 1,
"Wavefront Object": 1,
"Web Ontology Language": 3,
"WebAssembly": 2,
"WebIDL": 2,
"World of Warcraft Addon Data": 1,
"X10": 2,
"XC": 2,
"XCompose": 1,
"XML": 1,
"XPages": 2,
"XProc": 2,
"XQuery": 2,
"XS": 2,
"XSLT": 2,
"Xojo": 2,
"Xtend": 2,
"YAML": 1,
"YANG": 1,
"Yacc": 2,
"Zephir": 2,
"Zimpl": 2,
"desktop": 1,
"eC": 2,
"edn": 1,
"fish": 2,
"mupad": 2,
"nesC": 2,
"ooc": 2,
"reStructuredText": 4,
"wisp": 2,
"xBase": 2,
}

View File

@ -1,4 +1,4 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
@ -6,7 +6,7 @@ package enry
import "gopkg.in/toqueteos/substring.v1" import "gopkg.in/toqueteos/substring.v1"
var vendorMatchers = substring.Or( var VendorMatchers = substring.Or(
substring.Regexp(`(^|/)cache/`), substring.Regexp(`(^|/)cache/`),
substring.Regexp(`^[Dd]ependencies/`), substring.Regexp(`^[Dd]ependencies/`),
substring.Regexp(`(^|/)dist/`), substring.Regexp(`(^|/)dist/`),

View File

@ -1,12 +1,12 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }} // Extracted from github/linguist commit: {{ getCommit }}
// languagesByAlias keeps alias for different languages and use the name of the languages as an alias too. // LanguagesByAlias keeps alias for different languages and use the name of the languages as an alias too.
// All the keys (alias or not) are written in lower case and the whitespaces has been replaced by underscores. // All the keys (alias or not) are written in lower case and the whitespaces has been replaced by underscores.
var languagesByAlias = map[string]string{ var LanguagesByAlias = map[string]string{
{{range $alias, $language := . -}} {{range $alias, $language := . -}}
"{{ $alias }}": {{ printf "%q" $language -}}, "{{ $alias }}": {{ printf "%q" $language -}},
{{end -}} {{end -}}

View File

@ -1,4 +1,4 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
@ -10,7 +10,7 @@ import (
type languageMatcher func ([]byte) []string type languageMatcher func ([]byte) []string
var contentMatchers = map[string]languageMatcher{ var ContentMatchers = map[string]languageMatcher{
{{ range $index, $disambiguator := . -}} {{ range $index, $disambiguator := . -}}
{{ printf "%q" $disambiguator.Extension }}: func(i []byte) []string { {{ printf "%q" $disambiguator.Extension }}: func(i []byte) []string {
{{ range $i, $language := $disambiguator.Languages -}} {{ range $i, $language := $disambiguator.Languages -}}

View File

@ -1,4 +1,4 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
@ -6,7 +6,7 @@ package enry
import "gopkg.in/toqueteos/substring.v1" import "gopkg.in/toqueteos/substring.v1"
var documentationMatchers = substring.Or( var DocumentationMatchers = substring.Or(
{{range $regexp := . -}} {{range $regexp := . -}}
substring.Regexp(`{{ $regexp }}`), substring.Regexp(`{{ $regexp }}`),
{{end -}} {{end -}}

View File

@ -1,16 +1,16 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }} // Extracted from github/linguist commit: {{ getCommit }}
var languagesByExtension = map[string][]string{ var LanguagesByExtension = map[string][]string{
{{range $extension, $languages := .LanguagesByExtension -}} {{range $extension, $languages := .LanguagesByExtension -}}
"{{ $extension }}": { {{- $languages | formatStringSlice -}} }, "{{ $extension }}": { {{- $languages | formatStringSlice -}} },
{{end -}} {{end -}}
} }
var extensionsByLanguage = map[string][]string{ var ExtensionsByLanguage = map[string][]string{
{{range $language, $extensions := .ExtensionsByLanguage -}} {{range $language, $extensions := .ExtensionsByLanguage -}}
"{{ $language }}": { {{- $extensions | formatStringSlice -}} }, "{{ $language }}": { {{- $extensions | formatStringSlice -}} },
{{end -}} {{end -}}

View File

@ -1,10 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }} // Extracted from github/linguist commit: {{ getCommit }}
var languagesByFilename = map[string][]string{ var LanguagesByFilename = map[string][]string{
{{range $filename, $languages := . -}} {{range $filename, $languages := . -}}
"{{ $filename }}": { {{- formatStringSlice $languages -}} }, "{{ $filename }}": { {{- formatStringSlice $languages -}} },
{{end -}} {{end -}}

View File

@ -1,17 +1,17 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }} // Extracted from github/linguist commit: {{ getCommit }}
var DefaultClassifier Classifier = &classifier{ var LanguagesLogProbabilities = map[string]float64{
languagesLogProbabilities: map[string]float64{
{{ $freqs := . -}} {{ $freqs := . -}}
{{range $index, $language := orderKeys .Languages -}} {{range $index, $language := orderKeys .Languages -}}
"{{ $language }}": {{ languageLogProbability $language -}}, "{{ $language }}": {{ languageLogProbability $language -}},
{{end -}} {{end -}}
}, }
tokensLogProbabilities: map[string]map[string]float64{
var TokensLogProbabilities = map[string]map[string]float64{
{{range $index, $language := orderMapMapKeys .Tokens -}} {{range $index, $language := orderMapMapKeys .Tokens -}}
"{{ $language }}": map[string]float64{ "{{ $language }}": map[string]float64{
{{range $i, $token := index $freqs.Tokens $language | orderKeys -}} {{range $i, $token := index $freqs.Tokens $language | orderKeys -}}
@ -19,6 +19,6 @@ var DefaultClassifier Classifier = &classifier{
{{end -}} {{end -}}
}, },
{{end -}} {{end -}}
},
tokensTotal: {{ toFloat64 .TokensTotal -}},
} }
var TokensTotal = {{ toFloat64 .TokensTotal -}}

View File

@ -1,10 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }} // Extracted from github/linguist commit: {{ getCommit }}
var languagesByInterpreter = map[string][]string{ var LanguagesByInterpreter = map[string][]string{
{{range $interpreter, $languages := . -}} {{range $interpreter, $languages := . -}}
"{{ $interpreter }}": { {{- $languages | formatStringSlice -}} }, "{{ $interpreter }}": { {{- $languages | formatStringSlice -}} },
{{end -}} {{end -}}

View File

@ -1,10 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }} // Extracted from github/linguist commit: {{ getCommit }}
var languagesType = map[string]Type{ var LanguagesType = map[string]int{
{{range $language, $type := . -}} {{range $language, $type := . -}}
"{{ $language }}": {{ $type -}}, "{{ $language }}": {{ $type -}},
{{end -}} {{end -}}

View File

@ -1,4 +1,4 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
@ -6,7 +6,7 @@ package enry
import "gopkg.in/toqueteos/substring.v1" import "gopkg.in/toqueteos/substring.v1"
var vendorMatchers = substring.Or( var VendorMatchers = substring.Or(
{{range $regexp := . -}} {{range $regexp := . -}}
substring.Regexp(`{{ $regexp }}`), substring.Regexp(`{{ $regexp }}`),
{{end -}} {{end -}}

View File

@ -1,12 +1,12 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
// languagesByAlias keeps alias for different languages and use the name of the languages as an alias too. // LanguagesByAlias keeps alias for different languages and use the name of the languages as an alias too.
// All the keys (alias or not) are written in lower case and the whitespaces has been replaced by underscores. // All the keys (alias or not) are written in lower case and the whitespaces has been replaced by underscores.
var languagesByAlias = map[string]string{ var LanguagesByAlias = map[string]string{
"1c_enterprise": "1C Enterprise", "1c_enterprise": "1C Enterprise",
"abap": "ABAP", "abap": "ABAP",
"abl": "OpenEdge ABL", "abl": "OpenEdge ABL",

View File

@ -1,4 +1,4 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
@ -10,7 +10,7 @@ import (
type languageMatcher func([]byte) []string type languageMatcher func([]byte) []string
var contentMatchers = map[string]languageMatcher{ var ContentMatchers = map[string]languageMatcher{
".asc": func(i []byte) []string { ".asc": func(i []byte) []string {
if asc_PublicKey_Matcher_0.Match(i) { if asc_PublicKey_Matcher_0.Match(i) {
return []string{"Public Key"} return []string{"Public Key"}

View File

@ -1,4 +1,4 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
@ -6,7 +6,7 @@ package enry
import "gopkg.in/toqueteos/substring.v1" import "gopkg.in/toqueteos/substring.v1"
var documentationMatchers = substring.Or( var DocumentationMatchers = substring.Or(
substring.Regexp(`^[Dd]ocs?/`), substring.Regexp(`^[Dd]ocs?/`),
substring.Regexp(`(^|/)[Dd]ocumentation/`), substring.Regexp(`(^|/)[Dd]ocumentation/`),
substring.Regexp(`(^|/)[Jj]avadoc/`), substring.Regexp(`(^|/)[Jj]avadoc/`),

View File

@ -1,10 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var languagesByExtension = map[string][]string{ var LanguagesByExtension = map[string][]string{
".1": {"Roff"}, ".1": {"Roff"},
".1in": {"Roff"}, ".1in": {"Roff"},
".1m": {"Roff"}, ".1m": {"Roff"},
@ -1003,7 +1003,7 @@ var languagesByExtension = map[string][]string{
".zsh": {"Shell"}, ".zsh": {"Shell"},
} }
var extensionsByLanguage = map[string][]string{ var ExtensionsByLanguage = map[string][]string{
"1C Enterprise": {".bsl", ".os"}, "1C Enterprise": {".bsl", ".os"},
"ABAP": {".abap"}, "ABAP": {".abap"},
"ABNF": {".abnf"}, "ABNF": {".abnf"},

View File

@ -1,10 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var languagesByFilename = map[string][]string{ var LanguagesByFilename = map[string][]string{
".Rprofile": {"R"}, ".Rprofile": {"R"},
".XCompose": {"XCompose"}, ".XCompose": {"XCompose"},
".abbrev_defs": {"Emacs Lisp"}, ".abbrev_defs": {"Emacs Lisp"},

View File

@ -1,11 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var DefaultClassifier Classifier = &classifier{ var LanguagesLogProbabilities = map[string]float64{
languagesLogProbabilities: map[string]float64{
"1C Enterprise": -5.720858, "1C Enterprise": -5.720858,
"ABAP": -7.512618, "ABAP": -7.512618,
"ABNF": -7.512618, "ABNF": -7.512618,
@ -383,8 +382,9 @@ var DefaultClassifier Classifier = &classifier{
"reStructuredText": -7.512618, "reStructuredText": -7.512618,
"wisp": -7.512618, "wisp": -7.512618,
"xBase": -6.414005, "xBase": -6.414005,
}, }
tokensLogProbabilities: map[string]map[string]float64{
var TokensLogProbabilities = map[string]map[string]float64{
"1C Enterprise": map[string]float64{ "1C Enterprise": map[string]float64{
"#": -8.978471, "#": -8.978471,
"&": -6.675886, "&": -6.675886,
@ -148319,6 +148319,6 @@ var DefaultClassifier Classifier = &classifier{
"|": -5.355406, "|": -5.355406,
"}": -3.797262, "}": -3.797262,
}, },
},
tokensTotal: 1684174.000000,
} }
var TokensTotal = 1684174.000000

View File

@ -1,10 +1,10 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var languagesByInterpreter = map[string][]string{ var LanguagesByInterpreter = map[string][]string{
"Rscript": {"R"}, "Rscript": {"R"},
"apl": {"APL"}, "apl": {"APL"},
"aplx": {"APL"}, "aplx": {"APL"},

View File

@ -1,459 +1,459 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892 // Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var languagesType = map[string]Type{ var LanguagesType = map[string]int{
"1C Enterprise": Programming, "1C Enterprise": 2,
"ABAP": Programming, "ABAP": 2,
"ABNF": Data, "ABNF": 1,
"AGS Script": Programming, "AGS Script": 2,
"AMPL": Programming, "AMPL": 2,
"ANTLR": Programming, "ANTLR": 2,
"API Blueprint": Markup, "API Blueprint": 3,
"APL": Programming, "APL": 2,
"ASN.1": Data, "ASN.1": 1,
"ASP": Programming, "ASP": 2,
"ATS": Programming, "ATS": 2,
"ActionScript": Programming, "ActionScript": 2,
"Ada": Programming, "Ada": 2,
"Agda": Programming, "Agda": 2,
"Alloy": Programming, "Alloy": 2,
"Alpine Abuild": Programming, "Alpine Abuild": 2,
"Ant Build System": Data, "Ant Build System": 1,
"ApacheConf": Markup, "ApacheConf": 3,
"Apex": Programming, "Apex": 2,
"Apollo Guidance Computer": Programming, "Apollo Guidance Computer": 2,
"AppleScript": Programming, "AppleScript": 2,
"Arc": Programming, "Arc": 2,
"Arduino": Programming, "Arduino": 2,
"AsciiDoc": Prose, "AsciiDoc": 4,
"AspectJ": Programming, "AspectJ": 2,
"Assembly": Programming, "Assembly": 2,
"Augeas": Programming, "Augeas": 2,
"AutoHotkey": Programming, "AutoHotkey": 2,
"AutoIt": Programming, "AutoIt": 2,
"Awk": Programming, "Awk": 2,
"Batchfile": Programming, "Batchfile": 2,
"Befunge": Programming, "Befunge": 2,
"Bison": Programming, "Bison": 2,
"BitBake": Programming, "BitBake": 2,
"Blade": Markup, "Blade": 3,
"BlitzBasic": Programming, "BlitzBasic": 2,
"BlitzMax": Programming, "BlitzMax": 2,
"Bluespec": Programming, "Bluespec": 2,
"Boo": Programming, "Boo": 2,
"Brainfuck": Programming, "Brainfuck": 2,
"Brightscript": Programming, "Brightscript": 2,
"Bro": Programming, "Bro": 2,
"C": Programming, "C": 2,
"C#": Programming, "C#": 2,
"C++": Programming, "C++": 2,
"C-ObjDump": Data, "C-ObjDump": 1,
"C2hs Haskell": Programming, "C2hs Haskell": 2,
"CLIPS": Programming, "CLIPS": 2,
"CMake": Programming, "CMake": 2,
"COBOL": Programming, "COBOL": 2,
"COLLADA": Data, "COLLADA": 1,
"CSON": Data, "CSON": 1,
"CSS": Markup, "CSS": 3,
"CSV": Data, "CSV": 1,
"CWeb": Programming, "CWeb": 2,
"Cap'n Proto": Programming, "Cap'n Proto": 2,
"CartoCSS": Programming, "CartoCSS": 2,
"Ceylon": Programming, "Ceylon": 2,
"Chapel": Programming, "Chapel": 2,
"Charity": Programming, "Charity": 2,
"ChucK": Programming, "ChucK": 2,
"Cirru": Programming, "Cirru": 2,
"Clarion": Programming, "Clarion": 2,
"Clean": Programming, "Clean": 2,
"Click": Programming, "Click": 2,
"Clojure": Programming, "Clojure": 2,
"Closure Templates": Markup, "Closure Templates": 3,
"CoffeeScript": Programming, "CoffeeScript": 2,
"ColdFusion": Programming, "ColdFusion": 2,
"ColdFusion CFC": Programming, "ColdFusion CFC": 2,
"Common Lisp": Programming, "Common Lisp": 2,
"Component Pascal": Programming, "Component Pascal": 2,
"Cool": Programming, "Cool": 2,
"Coq": Programming, "Coq": 2,
"Cpp-ObjDump": Data, "Cpp-ObjDump": 1,
"Creole": Prose, "Creole": 4,
"Crystal": Programming, "Crystal": 2,
"Csound": Programming, "Csound": 2,
"Csound Document": Programming, "Csound Document": 2,
"Csound Score": Programming, "Csound Score": 2,
"Cuda": Programming, "Cuda": 2,
"Cycript": Programming, "Cycript": 2,
"Cython": Programming, "Cython": 2,
"D": Programming, "D": 2,
"D-ObjDump": Data, "D-ObjDump": 1,
"DIGITAL Command Language": Programming, "DIGITAL Command Language": 2,
"DM": Programming, "DM": 2,
"DNS Zone": Data, "DNS Zone": 1,
"DTrace": Programming, "DTrace": 2,
"Darcs Patch": Data, "Darcs Patch": 1,
"Dart": Programming, "Dart": 2,
"Diff": Data, "Diff": 1,
"Dockerfile": Data, "Dockerfile": 1,
"Dogescript": Programming, "Dogescript": 2,
"Dylan": Programming, "Dylan": 2,
"E": Programming, "E": 2,
"EBNF": Data, "EBNF": 1,
"ECL": Programming, "ECL": 2,
"ECLiPSe": Programming, "ECLiPSe": 2,
"EJS": Markup, "EJS": 3,
"EQ": Programming, "EQ": 2,
"Eagle": Markup, "Eagle": 3,
"Ecere Projects": Data, "Ecere Projects": 1,
"Eiffel": Programming, "Eiffel": 2,
"Elixir": Programming, "Elixir": 2,
"Elm": Programming, "Elm": 2,
"Emacs Lisp": Programming, "Emacs Lisp": 2,
"EmberScript": Programming, "EmberScript": 2,
"Erlang": Programming, "Erlang": 2,
"F#": Programming, "F#": 2,
"FLUX": Programming, "FLUX": 2,
"Factor": Programming, "Factor": 2,
"Fancy": Programming, "Fancy": 2,
"Fantom": Programming, "Fantom": 2,
"Filebench WML": Programming, "Filebench WML": 2,
"Filterscript": Programming, "Filterscript": 2,
"Formatted": Data, "Formatted": 1,
"Forth": Programming, "Forth": 2,
"Fortran": Programming, "Fortran": 2,
"FreeMarker": Programming, "FreeMarker": 2,
"Frege": Programming, "Frege": 2,
"G-code": Data, "G-code": 1,
"GAMS": Programming, "GAMS": 2,
"GAP": Programming, "GAP": 2,
"GCC Machine Description": Programming, "GCC Machine Description": 2,
"GDB": Programming, "GDB": 2,
"GDScript": Programming, "GDScript": 2,
"GLSL": Programming, "GLSL": 2,
"GN": Data, "GN": 1,
"Game Maker Language": Programming, "Game Maker Language": 2,
"Genie": Programming, "Genie": 2,
"Genshi": Programming, "Genshi": 2,
"Gentoo Ebuild": Programming, "Gentoo Ebuild": 2,
"Gentoo Eclass": Programming, "Gentoo Eclass": 2,
"Gettext Catalog": Prose, "Gettext Catalog": 4,
"Gherkin": Programming, "Gherkin": 2,
"Glyph": Programming, "Glyph": 2,
"Gnuplot": Programming, "Gnuplot": 2,
"Go": Programming, "Go": 2,
"Golo": Programming, "Golo": 2,
"Gosu": Programming, "Gosu": 2,
"Grace": Programming, "Grace": 2,
"Gradle": Data, "Gradle": 1,
"Grammatical Framework": Programming, "Grammatical Framework": 2,
"Graph Modeling Language": Data, "Graph Modeling Language": 1,
"GraphQL": Data, "GraphQL": 1,
"Graphviz (DOT)": Data, "Graphviz (DOT)": 1,
"Groovy": Programming, "Groovy": 2,
"Groovy Server Pages": Programming, "Groovy Server Pages": 2,
"HCL": Programming, "HCL": 2,
"HLSL": Programming, "HLSL": 2,
"HTML": Markup, "HTML": 3,
"HTML+Django": Markup, "HTML+Django": 3,
"HTML+ECR": Markup, "HTML+ECR": 3,
"HTML+EEX": Markup, "HTML+EEX": 3,
"HTML+ERB": Markup, "HTML+ERB": 3,
"HTML+PHP": Markup, "HTML+PHP": 3,
"HTTP": Data, "HTTP": 1,
"Hack": Programming, "Hack": 2,
"Haml": Markup, "Haml": 3,
"Handlebars": Markup, "Handlebars": 3,
"Harbour": Programming, "Harbour": 2,
"Haskell": Programming, "Haskell": 2,
"Haxe": Programming, "Haxe": 2,
"Hy": Programming, "Hy": 2,
"HyPhy": Programming, "HyPhy": 2,
"IDL": Programming, "IDL": 2,
"IGOR Pro": Programming, "IGOR Pro": 2,
"INI": Data, "INI": 1,
"IRC log": Data, "IRC log": 1,
"Idris": Programming, "Idris": 2,
"Inform 7": Programming, "Inform 7": 2,
"Inno Setup": Programming, "Inno Setup": 2,
"Io": Programming, "Io": 2,
"Ioke": Programming, "Ioke": 2,
"Isabelle": Programming, "Isabelle": 2,
"Isabelle ROOT": Programming, "Isabelle ROOT": 2,
"J": Programming, "J": 2,
"JFlex": Programming, "JFlex": 2,
"JSON": Data, "JSON": 1,
"JSON5": Data, "JSON5": 1,
"JSONLD": Data, "JSONLD": 1,
"JSONiq": Programming, "JSONiq": 2,
"JSX": Programming, "JSX": 2,
"Jasmin": Programming, "Jasmin": 2,
"Java": Programming, "Java": 2,
"Java Server Pages": Programming, "Java Server Pages": 2,
"JavaScript": Programming, "JavaScript": 2,
"Jison": Programming, "Jison": 2,
"Jison Lex": Programming, "Jison Lex": 2,
"Jolie": Programming, "Jolie": 2,
"Julia": Programming, "Julia": 2,
"Jupyter Notebook": Markup, "Jupyter Notebook": 3,
"KRL": Programming, "KRL": 2,
"KiCad": Programming, "KiCad": 2,
"Kit": Markup, "Kit": 3,
"Kotlin": Programming, "Kotlin": 2,
"LFE": Programming, "LFE": 2,
"LLVM": Programming, "LLVM": 2,
"LOLCODE": Programming, "LOLCODE": 2,
"LSL": Programming, "LSL": 2,
"LabVIEW": Programming, "LabVIEW": 2,
"Lasso": Programming, "Lasso": 2,
"Latte": Markup, "Latte": 3,
"Lean": Programming, "Lean": 2,
"Less": Markup, "Less": 3,
"Lex": Programming, "Lex": 2,
"LilyPond": Programming, "LilyPond": 2,
"Limbo": Programming, "Limbo": 2,
"Linker Script": Data, "Linker Script": 1,
"Linux Kernel Module": Data, "Linux Kernel Module": 1,
"Liquid": Markup, "Liquid": 3,
"Literate Agda": Programming, "Literate Agda": 2,
"Literate CoffeeScript": Programming, "Literate CoffeeScript": 2,
"Literate Haskell": Programming, "Literate Haskell": 2,
"LiveScript": Programming, "LiveScript": 2,
"Logos": Programming, "Logos": 2,
"Logtalk": Programming, "Logtalk": 2,
"LookML": Programming, "LookML": 2,
"LoomScript": Programming, "LoomScript": 2,
"Lua": Programming, "Lua": 2,
"M": Programming, "M": 2,
"M4": Programming, "M4": 2,
"M4Sugar": Programming, "M4Sugar": 2,
"MAXScript": Programming, "MAXScript": 2,
"MQL4": Programming, "MQL4": 2,
"MQL5": Programming, "MQL5": 2,
"MTML": Markup, "MTML": 3,
"MUF": Programming, "MUF": 2,
"Makefile": Programming, "Makefile": 2,
"Mako": Programming, "Mako": 2,
"Markdown": Prose, "Markdown": 4,
"Marko": Markup, "Marko": 3,
"Mask": Markup, "Mask": 3,
"Mathematica": Programming, "Mathematica": 2,
"Matlab": Programming, "Matlab": 2,
"Maven POM": Data, "Maven POM": 1,
"Max": Programming, "Max": 2,
"MediaWiki": Prose, "MediaWiki": 4,
"Mercury": Programming, "Mercury": 2,
"Meson": Programming, "Meson": 2,
"Metal": Programming, "Metal": 2,
"MiniD": Programming, "MiniD": 2,
"Mirah": Programming, "Mirah": 2,
"Modelica": Programming, "Modelica": 2,
"Modula-2": Programming, "Modula-2": 2,
"Module Management System": Programming, "Module Management System": 2,
"Monkey": Programming, "Monkey": 2,
"Moocode": Programming, "Moocode": 2,
"MoonScript": Programming, "MoonScript": 2,
"Myghty": Programming, "Myghty": 2,
"NCL": Programming, "NCL": 2,
"NL": Data, "NL": 1,
"NSIS": Programming, "NSIS": 2,
"Nemerle": Programming, "Nemerle": 2,
"NetLinx": Programming, "NetLinx": 2,
"NetLinx+ERB": Programming, "NetLinx+ERB": 2,
"NetLogo": Programming, "NetLogo": 2,
"NewLisp": Programming, "NewLisp": 2,
"Nginx": Markup, "Nginx": 3,
"Nim": Programming, "Nim": 2,
"Ninja": Data, "Ninja": 1,
"Nit": Programming, "Nit": 2,
"Nix": Programming, "Nix": 2,
"Nu": Programming, "Nu": 2,
"NumPy": Programming, "NumPy": 2,
"OCaml": Programming, "OCaml": 2,
"ObjDump": Data, "ObjDump": 1,
"Objective-C": Programming, "Objective-C": 2,
"Objective-C++": Programming, "Objective-C++": 2,
"Objective-J": Programming, "Objective-J": 2,
"Omgrofl": Programming, "Omgrofl": 2,
"Opa": Programming, "Opa": 2,
"Opal": Programming, "Opal": 2,
"OpenCL": Programming, "OpenCL": 2,
"OpenEdge ABL": Programming, "OpenEdge ABL": 2,
"OpenRC runscript": Programming, "OpenRC runscript": 2,
"OpenSCAD": Programming, "OpenSCAD": 2,
"OpenType Feature File": Data, "OpenType Feature File": 1,
"Org": Prose, "Org": 4,
"Ox": Programming, "Ox": 2,
"Oxygene": Programming, "Oxygene": 2,
"Oz": Programming, "Oz": 2,
"P4": Programming, "P4": 2,
"PAWN": Programming, "PAWN": 2,
"PHP": Programming, "PHP": 2,
"PLSQL": Programming, "PLSQL": 2,
"PLpgSQL": Programming, "PLpgSQL": 2,
"POV-Ray SDL": Programming, "POV-Ray SDL": 2,
"Pan": Programming, "Pan": 2,
"Papyrus": Programming, "Papyrus": 2,
"Parrot": Programming, "Parrot": 2,
"Parrot Assembly": Programming, "Parrot Assembly": 2,
"Parrot Internal Representation": Programming, "Parrot Internal Representation": 2,
"Pascal": Programming, "Pascal": 2,
"Pep8": Programming, "Pep8": 2,
"Perl": Programming, "Perl": 2,
"Perl6": Programming, "Perl6": 2,
"Pic": Markup, "Pic": 3,
"Pickle": Data, "Pickle": 1,
"PicoLisp": Programming, "PicoLisp": 2,
"PigLatin": Programming, "PigLatin": 2,
"Pike": Programming, "Pike": 2,
"Pod": Prose, "Pod": 4,
"PogoScript": Programming, "PogoScript": 2,
"Pony": Programming, "Pony": 2,
"PostScript": Markup, "PostScript": 3,
"PowerBuilder": Programming, "PowerBuilder": 2,
"PowerShell": Programming, "PowerShell": 2,
"Processing": Programming, "Processing": 2,
"Prolog": Programming, "Prolog": 2,
"Propeller Spin": Programming, "Propeller Spin": 2,
"Protocol Buffer": Markup, "Protocol Buffer": 3,
"Public Key": Data, "Public Key": 1,
"Pug": Markup, "Pug": 3,
"Puppet": Programming, "Puppet": 2,
"Pure Data": Programming, "Pure Data": 2,
"PureBasic": Programming, "PureBasic": 2,
"PureScript": Programming, "PureScript": 2,
"Python": Programming, "Python": 2,
"Python console": Programming, "Python console": 2,
"Python traceback": Data, "Python traceback": 1,
"QML": Programming, "QML": 2,
"QMake": Programming, "QMake": 2,
"R": Programming, "R": 2,
"RAML": Markup, "RAML": 3,
"RDoc": Prose, "RDoc": 4,
"REALbasic": Programming, "REALbasic": 2,
"REXX": Programming, "REXX": 2,
"RHTML": Markup, "RHTML": 3,
"RMarkdown": Prose, "RMarkdown": 4,
"RPM Spec": Data, "RPM Spec": 1,
"RUNOFF": Markup, "RUNOFF": 3,
"Racket": Programming, "Racket": 2,
"Ragel": Programming, "Ragel": 2,
"Rascal": Programming, "Rascal": 2,
"Raw token data": Data, "Raw token data": 1,
"Reason": Programming, "Reason": 2,
"Rebol": Programming, "Rebol": 2,
"Red": Programming, "Red": 2,
"Redcode": Programming, "Redcode": 2,
"Regular Expression": Data, "Regular Expression": 1,
"Ren'Py": Programming, "Ren'Py": 2,
"RenderScript": Programming, "RenderScript": 2,
"RobotFramework": Programming, "RobotFramework": 2,
"Roff": Markup, "Roff": 3,
"Rouge": Programming, "Rouge": 2,
"Ruby": Programming, "Ruby": 2,
"Rust": Programming, "Rust": 2,
"SAS": Programming, "SAS": 2,
"SCSS": Markup, "SCSS": 3,
"SMT": Programming, "SMT": 2,
"SPARQL": Data, "SPARQL": 1,
"SQF": Programming, "SQF": 2,
"SQL": Data, "SQL": 1,
"SQLPL": Programming, "SQLPL": 2,
"SRecode Template": Markup, "SRecode Template": 3,
"STON": Data, "STON": 1,
"SVG": Data, "SVG": 1,
"Sage": Programming, "Sage": 2,
"SaltStack": Programming, "SaltStack": 2,
"Sass": Markup, "Sass": 3,
"Scala": Programming, "Scala": 2,
"Scaml": Markup, "Scaml": 3,
"Scheme": Programming, "Scheme": 2,
"Scilab": Programming, "Scilab": 2,
"Self": Programming, "Self": 2,
"ShaderLab": Programming, "ShaderLab": 2,
"Shell": Programming, "Shell": 2,
"ShellSession": Programming, "ShellSession": 2,
"Shen": Programming, "Shen": 2,
"Slash": Programming, "Slash": 2,
"Slim": Markup, "Slim": 3,
"Smali": Programming, "Smali": 2,
"Smalltalk": Programming, "Smalltalk": 2,
"Smarty": Programming, "Smarty": 2,
"SourcePawn": Programming, "SourcePawn": 2,
"Spline Font Database": Data, "Spline Font Database": 1,
"Squirrel": Programming, "Squirrel": 2,
"Stan": Programming, "Stan": 2,
"Standard ML": Programming, "Standard ML": 2,
"Stata": Programming, "Stata": 2,
"Stylus": Markup, "Stylus": 3,
"SubRip Text": Data, "SubRip Text": 1,
"Sublime Text Config": Data, "Sublime Text Config": 1,
"SuperCollider": Programming, "SuperCollider": 2,
"Swift": Programming, "Swift": 2,
"SystemVerilog": Programming, "SystemVerilog": 2,
"TI Program": Programming, "TI Program": 2,
"TLA": Programming, "TLA": 2,
"TOML": Data, "TOML": 1,
"TXL": Programming, "TXL": 2,
"Tcl": Programming, "Tcl": 2,
"Tcsh": Programming, "Tcsh": 2,
"TeX": Markup, "TeX": 3,
"Tea": Markup, "Tea": 3,
"Terra": Programming, "Terra": 2,
"Text": Prose, "Text": 4,
"Textile": Prose, "Textile": 4,
"Thrift": Programming, "Thrift": 2,
"Turing": Programming, "Turing": 2,
"Turtle": Data, "Turtle": 1,
"Twig": Markup, "Twig": 3,
"Type Language": Data, "Type Language": 1,
"TypeScript": Programming, "TypeScript": 2,
"Unified Parallel C": Programming, "Unified Parallel C": 2,
"Unity3D Asset": Data, "Unity3D Asset": 1,
"Unix Assembly": Programming, "Unix Assembly": 2,
"Uno": Programming, "Uno": 2,
"UnrealScript": Programming, "UnrealScript": 2,
"UrWeb": Programming, "UrWeb": 2,
"VCL": Programming, "VCL": 2,
"VHDL": Programming, "VHDL": 2,
"Vala": Programming, "Vala": 2,
"Verilog": Programming, "Verilog": 2,
"Vim script": Programming, "Vim script": 2,
"Visual Basic": Programming, "Visual Basic": 2,
"Volt": Programming, "Volt": 2,
"Vue": Markup, "Vue": 3,
"Wavefront Material": Data, "Wavefront Material": 1,
"Wavefront Object": Data, "Wavefront Object": 1,
"Web Ontology Language": Markup, "Web Ontology Language": 3,
"WebAssembly": Programming, "WebAssembly": 2,
"WebIDL": Programming, "WebIDL": 2,
"World of Warcraft Addon Data": Data, "World of Warcraft Addon Data": 1,
"X10": Programming, "X10": 2,
"XC": Programming, "XC": 2,
"XCompose": Data, "XCompose": 1,
"XML": Data, "XML": 1,
"XPages": Programming, "XPages": 2,
"XProc": Programming, "XProc": 2,
"XQuery": Programming, "XQuery": 2,
"XS": Programming, "XS": 2,
"XSLT": Programming, "XSLT": 2,
"Xojo": Programming, "Xojo": 2,
"Xtend": Programming, "Xtend": 2,
"YAML": Data, "YAML": 1,
"YANG": Data, "YANG": 1,
"Yacc": Programming, "Yacc": 2,
"Zephir": Programming, "Zephir": 2,
"Zimpl": Programming, "Zimpl": 2,
"desktop": Data, "desktop": 1,
"eC": Programming, "eC": 2,
"edn": Data, "edn": 1,
"fish": Programming, "fish": 2,
"mupad": Programming, "mupad": 2,
"nesC": Programming, "nesC": 2,
"ooc": Programming, "ooc": 2,
"reStructuredText": Prose, "reStructuredText": 4,
"wisp": Programming, "wisp": 2,
"xBase": Programming, "xBase": 2,
} }

View File

@ -1,4 +1,4 @@
package enry package data
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator // CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
@ -6,7 +6,7 @@ package enry
import "gopkg.in/toqueteos/substring.v1" import "gopkg.in/toqueteos/substring.v1"
var vendorMatchers = substring.Or( var VendorMatchers = substring.Or(
substring.Regexp(`(^|/)cache/`), substring.Regexp(`(^|/)cache/`),
substring.Regexp(`^[Dd]ependencies/`), substring.Regexp(`^[Dd]ependencies/`),
substring.Regexp(`(^|/)dist/`), substring.Regexp(`(^|/)dist/`),

View File

@ -9,11 +9,11 @@ import (
yaml "gopkg.in/yaml.v2" yaml "gopkg.in/yaml.v2"
) )
var typeToTypeConst = map[string]string{ var typeToTypeConst = map[string]int{
"data": "Data", "data": 1,
"programming": "Programming", "programming": 2,
"markup": "Markup", "markup": 3,
"prose": "Prose", "prose": 4,
} }
// Types reads from fileToParse and builds source file from tmplPath. It complies with type File signature. // Types reads from fileToParse and builds source file from tmplPath. It complies with type File signature.
@ -38,8 +38,8 @@ func Types(fileToParse, samplesDir, outPath, tmplPath, tmplName, commit string)
return formatedWrite(outPath, buf.Bytes()) return formatedWrite(outPath, buf.Bytes())
} }
func buildLanguageTypeMap(languages map[string]*languageInfo) map[string]string { func buildLanguageTypeMap(languages map[string]*languageInfo) map[string]int {
langTypeMap := make(map[string]string) langTypeMap := make(map[string]int)
for lang, info := range languages { for lang, info := range languages {
langTypeMap[lang] = typeToTypeConst[info.Type] langTypeMap[lang] = typeToTypeConst[info.Type]
} }
@ -47,7 +47,7 @@ func buildLanguageTypeMap(languages map[string]*languageInfo) map[string]string
return langTypeMap return langTypeMap
} }
func executeTypesTemplate(out io.Writer, langTypeMap map[string]string, tmplPath, tmplName, commit string) error { func executeTypesTemplate(out io.Writer, langTypeMap map[string]int, tmplPath, tmplName, commit string) error {
fmap := template.FuncMap{ fmap := template.FuncMap{
"getCommit": func() string { return commit }, "getCommit": func() string { return commit },
} }

View File

@ -15,50 +15,50 @@ const (
samplesDir = ".linguist/samples" samplesDir = ".linguist/samples"
// extension.go generation // extension.go generation
extensionsFile = "extension.go" extensionsFile = "data/extension.go"
extensionsTmplPath = "internal/code-generator/assets/extension.go.tmpl" extensionsTmplPath = "internal/code-generator/assets/extension.go.tmpl"
extensionsTmpl = "extension.go.tmpl" extensionsTmpl = "extension.go.tmpl"
// content.go generation // content.go generation
heuristicsRuby = ".linguist/lib/linguist/heuristics.rb" heuristicsRuby = ".linguist/lib/linguist/heuristics.rb"
contentFile = "content.go" contentFile = "data/content.go"
contentTmplPath = "internal/code-generator/assets/content.go.tmpl" contentTmplPath = "internal/code-generator/assets/content.go.tmpl"
contentTmpl = "content.go.tmpl" contentTmpl = "content.go.tmpl"
// vendor.go generation // vendor.go generation
vendorYAML = ".linguist/lib/linguist/vendor.yml" vendorYAML = ".linguist/lib/linguist/vendor.yml"
vendorFile = "vendor.go" vendorFile = "data/vendor.go"
vendorTmplPath = "internal/code-generator/assets/vendor.go.tmpl" vendorTmplPath = "internal/code-generator/assets/vendor.go.tmpl"
vendorTmpl = "vendor.go.tmpl" vendorTmpl = "vendor.go.tmpl"
// documentation.go generation // documentation.go generation
documentationYAML = ".linguist/lib/linguist/documentation.yml" documentationYAML = ".linguist/lib/linguist/documentation.yml"
documentationFile = "documentation.go" documentationFile = "data/documentation.go"
documentationTmplPath = "internal/code-generator/assets/documentation.go.tmpl" documentationTmplPath = "internal/code-generator/assets/documentation.go.tmpl"
documentationTmpl = "documentation.go.tmpl" documentationTmpl = "documentation.go.tmpl"
// type.go generation // type.go generation
typeFile = "type.go" typeFile = "data/type.go"
typeTmplPath = "internal/code-generator/assets/type.go.tmpl" typeTmplPath = "internal/code-generator/assets/type.go.tmpl"
typeTmpl = "type.go.tmpl" typeTmpl = "type.go.tmpl"
// interpreter.go generation // interpreter.go generation
interpretersFile = "interpreter.go" interpretersFile = "data/interpreter.go"
interpretersTmplPath = "internal/code-generator/assets/interpreter.go.tmpl" interpretersTmplPath = "internal/code-generator/assets/interpreter.go.tmpl"
interpretersTmpl = "interpreter.go.tmpl" interpretersTmpl = "interpreter.go.tmpl"
// filename.go generation // filename.go generation
filenamesFile = "filename.go" filenamesFile = "data/filename.go"
filenamesTmplPath = "internal/code-generator/assets/filename.go.tmpl" filenamesTmplPath = "internal/code-generator/assets/filename.go.tmpl"
filenamesTmpl = "filename.go.tmpl" filenamesTmpl = "filename.go.tmpl"
// alias.go generation // alias.go generation
aliasesFile = "alias.go" aliasesFile = "data/alias.go"
aliasesTmplPath = "internal/code-generator/assets/alias.go.tmpl" aliasesTmplPath = "internal/code-generator/assets/alias.go.tmpl"
aliasesTmpl = "alias.go.tmpl" aliasesTmpl = "alias.go.tmpl"
// frequencies.go generation // frequencies.go generation
frequenciesFile = "frequencies.go" frequenciesFile = "data/frequencies.go"
frequenciesTmplPath = "internal/code-generator/assets/frequencies.go.tmpl" frequenciesTmplPath = "internal/code-generator/assets/frequencies.go.tmpl"
frequenciesTmpl = "frequencies.go.tmpl" frequenciesTmpl = "frequencies.go.tmpl"

459
type.go
View File

@ -1,459 +0,0 @@
package enry
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: b6460f8ed6b249281ada099ca28bd8f1230b8892
var languagesType = map[string]Type{
"1C Enterprise": Programming,
"ABAP": Programming,
"ABNF": Data,
"AGS Script": Programming,
"AMPL": Programming,
"ANTLR": Programming,
"API Blueprint": Markup,
"APL": Programming,
"ASN.1": Data,
"ASP": Programming,
"ATS": Programming,
"ActionScript": Programming,
"Ada": Programming,
"Agda": Programming,
"Alloy": Programming,
"Alpine Abuild": Programming,
"Ant Build System": Data,
"ApacheConf": Markup,
"Apex": Programming,
"Apollo Guidance Computer": Programming,
"AppleScript": Programming,
"Arc": Programming,
"Arduino": Programming,
"AsciiDoc": Prose,
"AspectJ": Programming,
"Assembly": Programming,
"Augeas": Programming,
"AutoHotkey": Programming,
"AutoIt": Programming,
"Awk": Programming,
"Batchfile": Programming,
"Befunge": Programming,
"Bison": Programming,
"BitBake": Programming,
"Blade": Markup,
"BlitzBasic": Programming,
"BlitzMax": Programming,
"Bluespec": Programming,
"Boo": Programming,
"Brainfuck": Programming,
"Brightscript": Programming,
"Bro": Programming,
"C": Programming,
"C#": Programming,
"C++": Programming,
"C-ObjDump": Data,
"C2hs Haskell": Programming,
"CLIPS": Programming,
"CMake": Programming,
"COBOL": Programming,
"COLLADA": Data,
"CSON": Data,
"CSS": Markup,
"CSV": Data,
"CWeb": Programming,
"Cap'n Proto": Programming,
"CartoCSS": Programming,
"Ceylon": Programming,
"Chapel": Programming,
"Charity": Programming,
"ChucK": Programming,
"Cirru": Programming,
"Clarion": Programming,
"Clean": Programming,
"Click": Programming,
"Clojure": Programming,
"Closure Templates": Markup,
"CoffeeScript": Programming,
"ColdFusion": Programming,
"ColdFusion CFC": Programming,
"Common Lisp": Programming,
"Component Pascal": Programming,
"Cool": Programming,
"Coq": Programming,
"Cpp-ObjDump": Data,
"Creole": Prose,
"Crystal": Programming,
"Csound": Programming,
"Csound Document": Programming,
"Csound Score": Programming,
"Cuda": Programming,
"Cycript": Programming,
"Cython": Programming,
"D": Programming,
"D-ObjDump": Data,
"DIGITAL Command Language": Programming,
"DM": Programming,
"DNS Zone": Data,
"DTrace": Programming,
"Darcs Patch": Data,
"Dart": Programming,
"Diff": Data,
"Dockerfile": Data,
"Dogescript": Programming,
"Dylan": Programming,
"E": Programming,
"EBNF": Data,
"ECL": Programming,
"ECLiPSe": Programming,
"EJS": Markup,
"EQ": Programming,
"Eagle": Markup,
"Ecere Projects": Data,
"Eiffel": Programming,
"Elixir": Programming,
"Elm": Programming,
"Emacs Lisp": Programming,
"EmberScript": Programming,
"Erlang": Programming,
"F#": Programming,
"FLUX": Programming,
"Factor": Programming,
"Fancy": Programming,
"Fantom": Programming,
"Filebench WML": Programming,
"Filterscript": Programming,
"Formatted": Data,
"Forth": Programming,
"Fortran": Programming,
"FreeMarker": Programming,
"Frege": Programming,
"G-code": Data,
"GAMS": Programming,
"GAP": Programming,
"GCC Machine Description": Programming,
"GDB": Programming,
"GDScript": Programming,
"GLSL": Programming,
"GN": Data,
"Game Maker Language": Programming,
"Genie": Programming,
"Genshi": Programming,
"Gentoo Ebuild": Programming,
"Gentoo Eclass": Programming,
"Gettext Catalog": Prose,
"Gherkin": Programming,
"Glyph": Programming,
"Gnuplot": Programming,
"Go": Programming,
"Golo": Programming,
"Gosu": Programming,
"Grace": Programming,
"Gradle": Data,
"Grammatical Framework": Programming,
"Graph Modeling Language": Data,
"GraphQL": Data,
"Graphviz (DOT)": Data,
"Groovy": Programming,
"Groovy Server Pages": Programming,
"HCL": Programming,
"HLSL": Programming,
"HTML": Markup,
"HTML+Django": Markup,
"HTML+ECR": Markup,
"HTML+EEX": Markup,
"HTML+ERB": Markup,
"HTML+PHP": Markup,
"HTTP": Data,
"Hack": Programming,
"Haml": Markup,
"Handlebars": Markup,
"Harbour": Programming,
"Haskell": Programming,
"Haxe": Programming,
"Hy": Programming,
"HyPhy": Programming,
"IDL": Programming,
"IGOR Pro": Programming,
"INI": Data,
"IRC log": Data,
"Idris": Programming,
"Inform 7": Programming,
"Inno Setup": Programming,
"Io": Programming,
"Ioke": Programming,
"Isabelle": Programming,
"Isabelle ROOT": Programming,
"J": Programming,
"JFlex": Programming,
"JSON": Data,
"JSON5": Data,
"JSONLD": Data,
"JSONiq": Programming,
"JSX": Programming,
"Jasmin": Programming,
"Java": Programming,
"Java Server Pages": Programming,
"JavaScript": Programming,
"Jison": Programming,
"Jison Lex": Programming,
"Jolie": Programming,
"Julia": Programming,
"Jupyter Notebook": Markup,
"KRL": Programming,
"KiCad": Programming,
"Kit": Markup,
"Kotlin": Programming,
"LFE": Programming,
"LLVM": Programming,
"LOLCODE": Programming,
"LSL": Programming,
"LabVIEW": Programming,
"Lasso": Programming,
"Latte": Markup,
"Lean": Programming,
"Less": Markup,
"Lex": Programming,
"LilyPond": Programming,
"Limbo": Programming,
"Linker Script": Data,
"Linux Kernel Module": Data,
"Liquid": Markup,
"Literate Agda": Programming,
"Literate CoffeeScript": Programming,
"Literate Haskell": Programming,
"LiveScript": Programming,
"Logos": Programming,
"Logtalk": Programming,
"LookML": Programming,
"LoomScript": Programming,
"Lua": Programming,
"M": Programming,
"M4": Programming,
"M4Sugar": Programming,
"MAXScript": Programming,
"MQL4": Programming,
"MQL5": Programming,
"MTML": Markup,
"MUF": Programming,
"Makefile": Programming,
"Mako": Programming,
"Markdown": Prose,
"Marko": Markup,
"Mask": Markup,
"Mathematica": Programming,
"Matlab": Programming,
"Maven POM": Data,
"Max": Programming,
"MediaWiki": Prose,
"Mercury": Programming,
"Meson": Programming,
"Metal": Programming,
"MiniD": Programming,
"Mirah": Programming,
"Modelica": Programming,
"Modula-2": Programming,
"Module Management System": Programming,
"Monkey": Programming,
"Moocode": Programming,
"MoonScript": Programming,
"Myghty": Programming,
"NCL": Programming,
"NL": Data,
"NSIS": Programming,
"Nemerle": Programming,
"NetLinx": Programming,
"NetLinx+ERB": Programming,
"NetLogo": Programming,
"NewLisp": Programming,
"Nginx": Markup,
"Nim": Programming,
"Ninja": Data,
"Nit": Programming,
"Nix": Programming,
"Nu": Programming,
"NumPy": Programming,
"OCaml": Programming,
"ObjDump": Data,
"Objective-C": Programming,
"Objective-C++": Programming,
"Objective-J": Programming,
"Omgrofl": Programming,
"Opa": Programming,
"Opal": Programming,
"OpenCL": Programming,
"OpenEdge ABL": Programming,
"OpenRC runscript": Programming,
"OpenSCAD": Programming,
"OpenType Feature File": Data,
"Org": Prose,
"Ox": Programming,
"Oxygene": Programming,
"Oz": Programming,
"P4": Programming,
"PAWN": Programming,
"PHP": Programming,
"PLSQL": Programming,
"PLpgSQL": Programming,
"POV-Ray SDL": Programming,
"Pan": Programming,
"Papyrus": Programming,
"Parrot": Programming,
"Parrot Assembly": Programming,
"Parrot Internal Representation": Programming,
"Pascal": Programming,
"Pep8": Programming,
"Perl": Programming,
"Perl6": Programming,
"Pic": Markup,
"Pickle": Data,
"PicoLisp": Programming,
"PigLatin": Programming,
"Pike": Programming,
"Pod": Prose,
"PogoScript": Programming,
"Pony": Programming,
"PostScript": Markup,
"PowerBuilder": Programming,
"PowerShell": Programming,
"Processing": Programming,
"Prolog": Programming,
"Propeller Spin": Programming,
"Protocol Buffer": Markup,
"Public Key": Data,
"Pug": Markup,
"Puppet": Programming,
"Pure Data": Programming,
"PureBasic": Programming,
"PureScript": Programming,
"Python": Programming,
"Python console": Programming,
"Python traceback": Data,
"QML": Programming,
"QMake": Programming,
"R": Programming,
"RAML": Markup,
"RDoc": Prose,
"REALbasic": Programming,
"REXX": Programming,
"RHTML": Markup,
"RMarkdown": Prose,
"RPM Spec": Data,
"RUNOFF": Markup,
"Racket": Programming,
"Ragel": Programming,
"Rascal": Programming,
"Raw token data": Data,
"Reason": Programming,
"Rebol": Programming,
"Red": Programming,
"Redcode": Programming,
"Regular Expression": Data,
"Ren'Py": Programming,
"RenderScript": Programming,
"RobotFramework": Programming,
"Roff": Markup,
"Rouge": Programming,
"Ruby": Programming,
"Rust": Programming,
"SAS": Programming,
"SCSS": Markup,
"SMT": Programming,
"SPARQL": Data,
"SQF": Programming,
"SQL": Data,
"SQLPL": Programming,
"SRecode Template": Markup,
"STON": Data,
"SVG": Data,
"Sage": Programming,
"SaltStack": Programming,
"Sass": Markup,
"Scala": Programming,
"Scaml": Markup,
"Scheme": Programming,
"Scilab": Programming,
"Self": Programming,
"ShaderLab": Programming,
"Shell": Programming,
"ShellSession": Programming,
"Shen": Programming,
"Slash": Programming,
"Slim": Markup,
"Smali": Programming,
"Smalltalk": Programming,
"Smarty": Programming,
"SourcePawn": Programming,
"Spline Font Database": Data,
"Squirrel": Programming,
"Stan": Programming,
"Standard ML": Programming,
"Stata": Programming,
"Stylus": Markup,
"SubRip Text": Data,
"Sublime Text Config": Data,
"SuperCollider": Programming,
"Swift": Programming,
"SystemVerilog": Programming,
"TI Program": Programming,
"TLA": Programming,
"TOML": Data,
"TXL": Programming,
"Tcl": Programming,
"Tcsh": Programming,
"TeX": Markup,
"Tea": Markup,
"Terra": Programming,
"Text": Prose,
"Textile": Prose,
"Thrift": Programming,
"Turing": Programming,
"Turtle": Data,
"Twig": Markup,
"Type Language": Data,
"TypeScript": Programming,
"Unified Parallel C": Programming,
"Unity3D Asset": Data,
"Unix Assembly": Programming,
"Uno": Programming,
"UnrealScript": Programming,
"UrWeb": Programming,
"VCL": Programming,
"VHDL": Programming,
"Vala": Programming,
"Verilog": Programming,
"Vim script": Programming,
"Visual Basic": Programming,
"Volt": Programming,
"Vue": Markup,
"Wavefront Material": Data,
"Wavefront Object": Data,
"Web Ontology Language": Markup,
"WebAssembly": Programming,
"WebIDL": Programming,
"World of Warcraft Addon Data": Data,
"X10": Programming,
"XC": Programming,
"XCompose": Data,
"XML": Data,
"XPages": Programming,
"XProc": Programming,
"XQuery": Programming,
"XS": Programming,
"XSLT": Programming,
"Xojo": Programming,
"Xtend": Programming,
"YAML": Data,
"YANG": Data,
"Yacc": Programming,
"Zephir": Programming,
"Zimpl": Programming,
"desktop": Data,
"eC": Programming,
"edn": Data,
"fish": Programming,
"mupad": Programming,
"nesC": Programming,
"ooc": Programming,
"reStructuredText": Prose,
"wisp": Programming,
"xBase": Programming,
}

View File

@ -4,6 +4,8 @@ import (
"bytes" "bytes"
"path/filepath" "path/filepath"
"strings" "strings"
"gopkg.in/src-d/enry.v1/data"
) )
var ( var (
@ -43,12 +45,12 @@ func IsDotFile(path string) bool {
// IsVendor returns whether or not path is a vendor path. // IsVendor returns whether or not path is a vendor path.
func IsVendor(path string) bool { func IsVendor(path string) bool {
return vendorMatchers.Match(path) return data.VendorMatchers.Match(path)
} }
// IsDocumentation returns whether or not path is a documentation path. // IsDocumentation returns whether or not path is a documentation path.
func IsDocumentation(path string) bool { func IsDocumentation(path string) bool {
return documentationMatchers.Match(path) return data.DocumentationMatchers.Match(path)
} }
const sniffLen = 8000 const sniffLen = 8000