3

For a project I have the same question asked but requires different answers due to the context. The code below does not work and I am having issues understanding why. I think it is referring to my other question because is has the same pattern, however I thought that the tag would look at the two patterns below first.

<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>
zx485
  • 28,498
  • 28
  • 50
  • 59

1 Answers1

1

Remove the full stops. No punctuation should be used in <that> tags. You don't need to use topics for this.

<that>Bristol is a city</that>

You can actually do this a lot cleaner without using the topic tag like this:

<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>
Steve Worswick
  • 880
  • 2
  • 5
  • 11
  • I have removed the punctuation, but it still doesn't work. Should I post the full code? It is 80 lines long edit: nevermind I got it working, turns out it was the punctuation. I accidentally left the topic name. Thanks – somerandomukguy Nov 30 '19 at 21:08