0
0

switch fr to not require icu/libstemmer

also corrected copy/paste bug in test
This commit is contained in:
Marty Schoch 2015-03-11 11:46:33 -04:00
parent 8ae30fb6f0
commit eeaf514848
2 changed files with 4 additions and 10 deletions

View File

@ -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,

View File

@ -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"),