2017-04-11 09:26:23 +00:00
|
|
|
package slinguist
|
|
|
|
|
2017-04-17 10:08:54 +00:00
|
|
|
type Type int
|
|
|
|
|
2017-04-11 09:26:23 +00:00
|
|
|
const (
|
2017-04-21 08:12:17 +00:00
|
|
|
// Language's type. Either data, programming, markup, prose, or unknown.
|
2017-04-18 06:57:59 +00:00
|
|
|
Unknown Type = iota
|
|
|
|
Data
|
|
|
|
Programming
|
|
|
|
Markup
|
|
|
|
Prose
|
2017-04-11 09:26:23 +00:00
|
|
|
)
|
|
|
|
|
2017-04-21 08:12:17 +00:00
|
|
|
// GetLanguageType returns the given language's type.
|
2017-04-17 10:08:54 +00:00
|
|
|
func GetLanguageType(language string) (langType Type) {
|
2017-05-03 08:42:31 +00:00
|
|
|
langType, ok := languagesType[language]
|
|
|
|
if !ok {
|
|
|
|
langType = Unknown
|
|
|
|
}
|
|
|
|
|
2017-04-11 09:26:23 +00:00
|
|
|
return langType
|
|
|
|
}
|