39 lines
685 B
Go
39 lines
685 B
Go
package cjlookup
|
|
|
|
import (
|
|
query "github.com/tgckpg/golifehk/query"
|
|
"log"
|
|
)
|
|
|
|
func getSearchables() (*[]query.ISearchable, error) {
|
|
searchables := []query.ISearchable{}
|
|
|
|
cjRepl, err := ReadCangJieKeys()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
chars := map[string]*CChar{}
|
|
ReadCangJieTable(chars, cjRepl)
|
|
jpMap, err := ReadJyutPingTable(chars)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
for _, x := range jpMap {
|
|
if x.Key == nil {
|
|
log.Fatal("getSearchables CJP: ", x)
|
|
}
|
|
searchables = append(searchables, x)
|
|
}
|
|
|
|
for _, x := range chars {
|
|
if x.Key == nil {
|
|
log.Fatal("getSearchables CChar: ", x)
|
|
}
|
|
searchables = append(searchables, x)
|
|
}
|
|
|
|
return &searchables, nil
|
|
}
|