ArticleCase缺少巢式省略过滤器? [英] ArticleCase missing from nest elision filter?
问题描述
根据此页上,法语分析器定义为不区分大小写的省略步骤,如下所示:
According to this page, the french analyzer is defined with a case-insensitive elision step like so:
...
"french_elision": {
"type": "elision",
"articles_case": true, // <==== Note this article case property
"articles": [
"l", "m", "t", "qu", "n", "s", "j", "d", "c", "jusqu", "quoiqu", "lorsqu", "puisqu"
]
},
...
在尝试在NEST(v6.6)中重新创建此代码时,我似乎遇到了一个麻烦,因为似乎不存在ArticleCase调用.只是作为错误而缺失吗?还是应该采用另一种方法?
In trying to recreate this in NEST (v6.6), I seem to have hit a snag in that the ArticleCase call doesn't seem to exist. Is is just missing as a bug? Or is there another way this is supposed to be done?
.Elision("french_elision", f => f
// .ArticlesCase(true) <==== Doesn't exist
.Articles("l", "m", "t", "qu", "n", "s", "j", "d", "c", "jusqu", "quoiqu", "lorsqu", "puisqu"))
我还环顾了一下Articles()
上的问题,但找不到.我继续运行代码,默认情况下未设置该值.如何确保省略滤波器设置了该值?谢谢
I also looked around for a bool on Articles()
or something, but I can't find it. I went ahead and ran the code, and the value is not set by default. How do I make sure the elision filter has this value set? Thanks
推荐答案
在这里可以看到: russcam说以下话:
russcam says the following:
这是丢失的.我们将其添加到下一个版本中.
This is missing. We'll add it into the next release.
同时,您可以通过从ElisionTokenFilter
派生来添加它,并添加属性,例如
In the meantime, you can add it by deriving from ElisionTokenFilter
and add the property e.g.
public class MyElisionTokenFilter : ElisionTokenFilter
{
[PropertyName("articles_case")]
public bool? ArticlesCase { get; set; }
}
并在您的设置中使用
.UserDefined("french_elision", new MyElisionTokenFilter
{
ArticlesCase = true,
Articles = new[] { "l", "m", "t", "qu", "n", "s", "j", "d", "c", "jusqu", "quoiqu", "lorsqu", "puisqu" }
})
这篇关于ArticleCase缺少巢式省略过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!