26 lines
382 B
Go
26 lines
382 B
Go
|
package ascii_reduce
|
||
|
|
||
|
import (
|
||
|
_ "embed"
|
||
|
"encoding/json"
|
||
|
"strconv"
|
||
|
)
|
||
|
|
||
|
//go:embed mappings.json
|
||
|
var mappingsData string
|
||
|
|
||
|
var Mappings map[rune]string
|
||
|
|
||
|
func init() {
|
||
|
var mappings map[string]string
|
||
|
|
||
|
json.Unmarshal([]byte(mappingsData), &mappings)
|
||
|
|
||
|
Mappings = make(map[rune]string)
|
||
|
|
||
|
for key, value := range mappings {
|
||
|
r, _ := strconv.Atoi(key)
|
||
|
Mappings[rune(r)] = value
|
||
|
}
|
||
|
}
|