在我的项目中,我遇到了相同的问题,但由于上下文的不同,需要不同的答案。下面的代码不起作用,我无法理解为什么。我认为这是因为它引用了我的另一个问题,因为它们有相同的模式,然而我以为这个标签会首先查看下面的两个模式。
<category> <pattern>WHAT IS *</pattern> <template> <think> <set name = "topic"> state<star /> </set> </think> <condition name = "topic" value = "beauty">A subjective judgment evoked by an emotional response</condition> <condition name = "topic" value = "Bristol">Bristol is a city.</condition> <condition name = "topic" value = "London">London is a city.</condition> <condition name = "topic" value = "UWE">I do not have an answer for that</condition> </template></category><topic name = "state"> <category> <pattern># WHERE IS IT #</pattern> <that>Bristol is a city.</that> <template>In the South-West of England</template> </category> <category> <pattern># WHERE IS IT #</pattern> <that>London is a city.</that> <template>Somewhere east of Bristol</template> </category></topic>
回答:
删除句号。在<that>标签中不应使用标点符号。你不需要使用主题来处理这个问题。
<that>Bristol is a city</that>
实际上,你可以不使用主题标签,这样做会更简洁,如下所示:
<category> <pattern>WHAT IS *</pattern> <template> <think><set name="it"><star/></set></think> <condition name="it"> <li value="beauty">A subjective judgment evoked by an emotional response.</li> <li value="Bristol">Bristol is a city.</li> <li value="London">London is a city.</li> <li value="UWE">I do not have an answer for that</li> <li>I have no idea.</li> </condition> </template></category><category> <pattern># WHERE IS IT #</pattern> <template> <condition name="it"> <li value="beauty">In someone attractive.</li> <li value="Bristol">In the South-West of England.</li> <li value="London">Somewhere east of Bristol.</li> <li value="UWE">I do not have an answer for that</li> <li>Where is what?</li> </condition> </template></category>