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
|
// either express or implied. See the License for the specific language governing permissions
|
||||||
// and limitations under the License.
|
// and limitations under the License.
|
||||||
|
|
||||||
// +build libstemmer full
|
|
||||||
// +build icu full
|
|
||||||
|
|
||||||
package fr
|
package fr
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -17,13 +14,13 @@ import (
|
||||||
"github.com/blevesearch/bleve/registry"
|
"github.com/blevesearch/bleve/registry"
|
||||||
|
|
||||||
"github.com/blevesearch/bleve/analysis/token_filters/lower_case_filter"
|
"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"
|
const AnalyzerName = "fr"
|
||||||
|
|
||||||
func AnalyzerConstructor(config map[string]interface{}, cache *registry.Cache) (*analysis.Analyzer, error) {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -44,7 +41,7 @@ func AnalyzerConstructor(config map[string]interface{}, cache *registry.Cache) (
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
rv := analysis.Analyzer{
|
rv := analysis.Analyzer{
|
||||||
Tokenizer: icuTokenizer,
|
Tokenizer: tokenizer,
|
||||||
TokenFilters: []analysis.TokenFilter{
|
TokenFilters: []analysis.TokenFilter{
|
||||||
elisionFilter,
|
elisionFilter,
|
||||||
toLowerFilter,
|
toLowerFilter,
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
// either express or implied. See the License for the specific language governing permissions
|
// either express or implied. See the License for the specific language governing permissions
|
||||||
// and limitations under the License.
|
// and limitations under the License.
|
||||||
|
|
||||||
// +build libstemmer full
|
|
||||||
// +build icu full
|
|
||||||
|
|
||||||
package fr
|
package fr
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -171,7 +168,7 @@ func TestFrenchAnalyzer(t *testing.T) {
|
||||||
Term: []byte("ïaöuaä"),
|
Term: []byte("ïaöuaä"),
|
||||||
},
|
},
|
||||||
&analysis.Token{
|
&analysis.Token{
|
||||||
Term: []byte("anticonstitutionel'hui"),
|
Term: []byte("anticonstitutionel"),
|
||||||
},
|
},
|
||||||
&analysis.Token{
|
&analysis.Token{
|
||||||
Term: []byte("java"),
|
Term: []byte("java"),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user