initial commit
All checks were successful
Build and publish the docker image / build (push) Successful in 58s
All checks were successful
Build and publish the docker image / build (push) Successful in 58s
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
31
extract/dictionary.go
Normal file
31
extract/dictionary.go
Normal file
@ -0,0 +1,31 @@
|
||||
package extract
|
||||
|
||||
import "net/url"
|
||||
|
||||
type dictionary struct {
|
||||
ShortName string
|
||||
Name string
|
||||
Url string
|
||||
}
|
||||
|
||||
var Dicts []dictionary = []dictionary{
|
||||
{ShortName: "EN-TR", Name: "Turkish - English", Url: "/turkish-english"},
|
||||
{ShortName: "EN-DE", Name: "German - English", Url: "/german-english"},
|
||||
{ShortName: "EN-ES", Name: "Spanish - English", Url: "/spanish-english"},
|
||||
{ShortName: "EN-FR", Name: "French - English", Url: "/french-english"},
|
||||
}
|
||||
|
||||
func find_dict(sn string) (*dictionary) {
|
||||
for i := range Dicts {
|
||||
if Dicts[i].ShortName == sn {
|
||||
return &Dicts[i]
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *dictionary) Path(term string) string{
|
||||
term_escaped := url.PathEscape(term)
|
||||
return d.Url + "/" + term_escaped
|
||||
}
|
Reference in New Issue
Block a user