1
// Copyright (c) 2014 Couchbase, Inc.
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
7
// http://www.apache.org/licenses/LICENSE-2.0
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
18
"github.com/blevesearch/bleve/analysis"
19
"github.com/blevesearch/bleve/registry"
21
"github.com/blevesearch/bleve/analysis/token/lowercase"
22
"github.com/blevesearch/bleve/analysis/tokenizer/unicode"
25
const AnalyzerName = "fr"
27
func AnalyzerConstructor(config map[string]interface{}, cache *registry.Cache) (*analysis.Analyzer, error) {
28
tokenizer, err := cache.TokenizerNamed(unicode.Name)
32
elisionFilter, err := cache.TokenFilterNamed(ElisionName)
36
toLowerFilter, err := cache.TokenFilterNamed(lowercase.Name)
40
stopFrFilter, err := cache.TokenFilterNamed(StopName)
44
stemmerFrFilter, err := cache.TokenFilterNamed(LightStemmerName)
48
rv := analysis.Analyzer{
50
TokenFilters: []analysis.TokenFilter{
61
registry.RegisterAnalyzer(AnalyzerName, AnalyzerConstructor)