I'm currently coding a chatbot with AIML and I have the following question :
Can I with tags define answers based on the first question asked by the user.
It would be something like this :
User : What is StackOverflow ?
Chatbot : Stack Overflow is a question and answer website for professional and enthusiast programmers.
User : What's its link ?
Chatbot : www.stackoverflow.com/
How can we define an hierarchy like this ?
I'm new to AIML, I've looked and I can't figure it out ! Please help me and thank you !
You can either do this with <that> tags or for more flexibility, set a predicate and then check it to see what action to take.
<category>
<pattern>WHAT IS STACKOVERFLOW</pattern>
<template>
<think><set name="website">StackOverflow</set></think>
Stack Overflow is a question and answer website for professional and enthusiast programmers.
</template>
</category>
<category>
<pattern>WHAT IS GOOGLE</pattern>
<template>
<think><set name="website">Google</set></think>
Google is a search engine.
</template>
</category>
<category>
<pattern>WHAT IS ITS LINK</pattern>
<template>
<condition name="website">
<li value="StackOverflow">www.stackoverflow.com</li>
<li value="Google">www.google.com</li>
<li>The link to where?</li>
</condition>
</template>
</category>
Related
There is this old chat that suggests writing your own fragment wrapper, but I understand that fragment should now be natively supported.
However I couldn't quickly find the correct syntax for it.
Example of what I'm looking for:
<fragment>
<button label="foo"/>
<button label="bar"/>
</fragment>
Here is the official documentation page on reason-react and fragments.
The syntax for using React fragments in reason-react is this:
<>
<button label="foo"/>
<button label="bar"/>
</>
The terse syntax may be easy to miss if you are looking hard for something like <Fragment> (this is what happened to me). I first found the answer in the release notes for version 0.5.0
I am creating an amp for my webpage. It contains lot of description about places. I want to implement ..show more after 4 lines so that user can see other content also in the mobile first fold (Text is dynamic so can be less than 4 lines also. In that case how can i determine that show more will not come) Is this possible with AMP?? Since I cannot use javascript and css solution is not possible for this, please help me in finding alternatives for the same. I have searched a lot about this but no luck so far. Thanks in advance
You can use an amp-accordion for this:
<p>The first four lines...</p>
<amp-accordion disable-session-states>
<section>
<h4>
<span class="show-more">Show more</span>
</h4>
<p>The remaining text... </p>
</section>
</amp-accordion>
Here is a working example.
This question already has answers here:
How can I know the id of a JSF component so I can use in Javascript
(6 answers)
Closed 4 years ago.
I have <h:form prependId="false" id="productDescription"> and when rendered to html:
<form id="j_idt143:0:productDescription" name="j_idt143:0:productDescription" method="post" action="/WatchesStore/product-detail.jsf" enctype="application/x-www-form-urlencoded">
I want clear id:"j_idt143:0:" after rendered to html. Please help me solved this problem.
<h:form prependId="false">
Change
id="j_idt143:0:productDescription"
to
id="productDescription"
itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating"
Though I know the correct syntax is
itemscope itemtype ="http://schema.org/AggregateRating"
But wanted to know can we write
itemscope="" itemtype="http://schema.org/AggregateRating""
Because Google structure validation tool is not showing any erros and even Google webmasters tools is not showing any errors.
I'm starting my iPhone programming adventure, with a simple HTML scraping. I'm using the Hpple library to do the job, and I have a question...
Suppose I have the following html to parse...
<div>
<div> A <!-- Comment 1 --></div>
<div> B </div>
<div> C <!-- Comment 2 --></div>
</div>
How can I retrieve the commented parts? They don't show up on the objects... I was checking the docs but there's nothing pointing to that direction.. (also googling "hpple comment" doesn't produce the best results...).
thanks in advance.
Comments are not considered part of the content and are stripped out by pretty much all parsers except humans.
Similarly, you can't ask the parser to tell you how many spaces and newlines are between the first two <div> elements.