使用Solr 3.5.0并在我的schema.xml中,我使用以下内容标记句子的结尾,并用符号标记替换结束标点符号:
<charFilter class="solr.PatternReplaceCharFilterFactory"
pattern="(?<=[^.!?\\s][^.!?]*(?:[.!?](?![']?\s|$)[^.!?]*)*)[.!?]+(?=\\s|$)"
replacement=" monkeysentence"/>
Run Code Online (Sandbox Code Playgroud)
我不确定这是否适用于我想要的东西,但首先我需要解决在第一个'?<='lookbehind中转义'<'字符的问题.
我收到以下错误:
org.xml.sax.SAXParseException: The value of attribute "pattern"
associated with an element type "null" must not contain the '<' character.
Run Code Online (Sandbox Code Playgroud)
我尝试使用'\',如下所示:
pattern="(?\<=[^.!?\\s][^.!?]*(?:[.!?](?![']?\s|$)[^.!?]*)*)[.!?]+(?=\\s|$)"
Run Code Online (Sandbox Code Playgroud)
但我得到了同样的错误.
归档时间: |
|
查看次数: |
6108 次 |
最近记录: |