c526a38369
ultimately this is make it more convenient for us to wire up different elements of the analysis pipeline, without having to preload everything into memory before we need it separately the index layer now has a mechanism for storing internal key/value pairs. this is expected to be used to store the mapping, and possibly other pieces of data by the top layer, but not exposed to the user at the top.
71 lines
939 B
Go
71 lines
939 B
Go
package hy
|
|
|
|
import (
|
|
"github.com/couchbaselabs/bleve/analysis"
|
|
"github.com/couchbaselabs/bleve/registry"
|
|
)
|
|
|
|
const StopName = "stop_hy"
|
|
|
|
// this content was obtained from:
|
|
// lucene-4.7.2/analysis/common/src/resources/org/apache/lucene/analysis/
|
|
// ` was changed to ' to allow for literal string
|
|
|
|
var ArmenianStopWords = []byte(`# example set of Armenian stopwords.
|
|
այդ
|
|
այլ
|
|
այն
|
|
այս
|
|
դու
|
|
դուք
|
|
եմ
|
|
են
|
|
ենք
|
|
ես
|
|
եք
|
|
է
|
|
էի
|
|
էին
|
|
էինք
|
|
էիր
|
|
էիք
|
|
էր
|
|
ըստ
|
|
թ
|
|
ի
|
|
ին
|
|
իսկ
|
|
իր
|
|
կամ
|
|
համար
|
|
հետ
|
|
հետո
|
|
մենք
|
|
մեջ
|
|
մի
|
|
ն
|
|
նա
|
|
նաև
|
|
նրա
|
|
նրանք
|
|
որ
|
|
որը
|
|
որոնք
|
|
որպես
|
|
ու
|
|
ում
|
|
պիտի
|
|
վրա
|
|
և
|
|
`)
|
|
|
|
func TokenMapConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.TokenMap, error) {
|
|
rv := analysis.NewTokenMap()
|
|
err := rv.LoadBytes(ArmenianStopWords)
|
|
return rv, err
|
|
}
|
|
|
|
func init() {
|
|
registry.RegisterTokenMap(StopName, TokenMapConstructor)
|
|
}
|