switch fr to not require icu/libstemmer
also corrected copy/paste bug in test
This commit is contained in:
parent
8ae30fb6f0
commit
eeaf514848
|
@ -7,9 +7,6 @@
|
|||
// either express or implied. See the License for the specific language governing permissions
|
||||
// and limitations under the License.
|
||||
|
||||
// +build libstemmer full
|
||||
// +build icu full
|
||||
|
||||
package fr
|
||||
|
||||
import (
|
||||
|
@ -17,13 +14,13 @@ import (
|
|||
"github.com/blevesearch/bleve/registry"
|
||||
|
||||
"github.com/blevesearch/bleve/analysis/token_filters/lower_case_filter"
|
||||
"github.com/blevesearch/bleve/analysis/tokenizers/icu"
|
||||
"github.com/blevesearch/bleve/analysis/tokenizers/unicode"
|
||||
)
|
||||
|
||||
const AnalyzerName = "fr"
|
||||
|
||||
func AnalyzerConstructor(config map[string]interface{}, cache *registry.Cache) (*analysis.Analyzer, error) {
|
||||
icuTokenizer, err := cache.TokenizerNamed(icu.Name)
|
||||
tokenizer, err := cache.TokenizerNamed(unicode.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -44,7 +41,7 @@ func AnalyzerConstructor(config map[string]interface{}, cache *registry.Cache) (
|
|||
return nil, err
|
||||
}
|
||||
rv := analysis.Analyzer{
|
||||
Tokenizer: icuTokenizer,
|
||||
Tokenizer: tokenizer,
|
||||
TokenFilters: []analysis.TokenFilter{
|
||||
elisionFilter,
|
||||
toLowerFilter,
|
||||
|
|
|
@ -7,9 +7,6 @@
|
|||
// either express or implied. See the License for the specific language governing permissions
|
||||
// and limitations under the License.
|
||||
|
||||
// +build libstemmer full
|
||||
// +build icu full
|
||||
|
||||
package fr
|
||||
|
||||
import (
|
||||
|
@ -171,7 +168,7 @@ func TestFrenchAnalyzer(t *testing.T) {
|
|||
Term: []byte("ïaöuaä"),
|
||||
},
|
||||
&analysis.Token{
|
||||
Term: []byte("anticonstitutionel'hui"),
|
||||
Term: []byte("anticonstitutionel"),
|
||||
},
|
||||
&analysis.Token{
|
||||
Term: []byte("java"),
|
||||
|
|
Loading…
Reference in New Issue
Block a user