我试图弄清楚如何在 XML 文档中搜索某个块(块?字符串?我是新手……)并返回其余的……块?我目前正在使用 XStream 作为我的处理程序,但找不到任何关于做如此具体的事情的 tut。
这是代码示例(500,000 次):
<conversation>
<input>HELLO</input>
<response>
<text>HELLO MATE</text>
<hits>2</hits>
</response>
<response>
<text>HOLA</text>
<hits>1</hits>
</response>
</conversation>
<conversation>
<input>HOW ARE YOU</input>
<response>
<text>I AM GOOD</text>
<hits>4</hits>
</response>
<response>
<text>IM FINE</text>
<hits>5</hits>
</response>
</conversation>
它会搜索输入(例如,你好吗),然后返回命中率最高的响应块。我认为这是一个简单的操作,但我的搜索一无所获。谢谢小伙伴们!