articles_ga.go 581 B

123456789101112131415161718192021222324252627
  1. package ga
  2. import (
  3. "github.com/couchbaselabs/bleve/analysis"
  4. "github.com/couchbaselabs/bleve/registry"
  5. )
  6. const ArticlesName = "articles_ga"
  7. // this content was obtained from:
  8. // lucene-4.7.2/analysis/common/src/resources/org/apache/lucene/analysis
  9. var IrishArticles = []byte(`
  10. d
  11. m
  12. b
  13. `)
  14. func ArticlesTokenMapConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.TokenMap, error) {
  15. rv := analysis.NewTokenMap()
  16. err := rv.LoadBytes(IrishArticles)
  17. return rv, err
  18. }
  19. func init() {
  20. registry.RegisterTokenMap(ArticlesName, ArticlesTokenMapConstructor)
  21. }