mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-19 14:43:05 -03:00
moved generated data to data subpackage
This commit is contained in:
committed by
Santiago M. Mola
parent
5a8c748dbe
commit
7e827e47ef
@ -1,4 +1,4 @@
|
||||
package enry
|
||||
package data
|
||||
|
||||
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/enry.v1/internal/code-generator
|
||||
// THIS FILE SHOULD NOT BE EDITED BY HAND
|
||||
@ -10,23 +10,23 @@ import (
|
||||
|
||||
type languageMatcher func ([]byte) []string
|
||||
|
||||
var contentMatchers = map[string]languageMatcher{
|
||||
var ContentMatchers = map[string]languageMatcher{
|
||||
{{ range $index, $disambiguator := . -}}
|
||||
{{ printf "%q" $disambiguator.Extension }}: func(i []byte) []string {
|
||||
{{ range $i, $language := $disambiguator.Languages -}}
|
||||
|
||||
{{- if not (avoidLanguage $language) }}
|
||||
{{- if gt (len $language.Heuristics) 0 }}
|
||||
{{- if gt $i 0 }} else {{ end -}}
|
||||
if {{- range $j, $heuristic := $language.Heuristics }} {{ $heuristic.Name }}.Match(i)
|
||||
{{- if gt $i 0 }} else {{ end -}}
|
||||
if {{- range $j, $heuristic := $language.Heuristics }} {{ $heuristic.Name }}.Match(i)
|
||||
{{- if lt $j (len $language.LogicRelations) }} {{index $language.LogicRelations $j}} {{- end -}} {{ end }} {
|
||||
return []string{ {{- printf "%q" $language.Language -}} }
|
||||
}
|
||||
|
||||
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end}}
|
||||
|
||||
|
||||
return {{ returnLanguages $disambiguator.Languages | returnStringSlice }}
|
||||
},
|
||||
{{ end -}}
|
||||
@ -36,4 +36,4 @@ var (
|
||||
{{ range $index, $heuristic := getAllHeuristics . -}}
|
||||
{{ $heuristic.Name }} = regexp.MustCompile(`{{ $heuristic.Regexp }}`)
|
||||
{{ end -}}
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user