Commit 4906c607 authored by Pamelpreet Jhinger's avatar Pamelpreet Jhinger
Browse files
parents 8a0d84d0 a0597fe8
Pipeline #65896 failed with stages
in 1 minute and 30 seconds
......@@ -62,6 +62,21 @@ public class QueryProcessor {
"scientific method.",
"https://upload.wikimedia.org/wikipedia/commons/thumb/9/98/Blaise_Pascal_Versailles.JPG/800px-Blaise_Pascal_Versailles.JPG",
"https://en.wikipedia.org/wiki/Blaise_Pascal"));
this.queriesMap.add(new Query(Arrays.asList("william", "wordsworth"),
"William Wordsworth (7 April 1770 – 23 April 1850) was a \n "+
"major English Romantic poet who, with Samuel Taylor Coleridge, \n " +
"helped to launch the Romantic Age in English literature with \n "+
"their joint publication Lyrical Ballads (1798). \n" +
"Wordsworth's magnum opus is generally considered to be \n " +
"The Prelude, a semi-autobiographical poem of his early years \n"+
" that he revised and expanded a number of times. \n" +
" It was posthumously titled and published, before which \n"+
"it was generally known as \"the poem to Coleridge\". \n"+
"Wordsworth was Britain's poet laureate from 1843 \n"+
"until his death from pleurisy on 23 April 1850.",
"https://upload.wikimedia.org/wikipedia/commons/thumb/8/8c/Wordsworth_on_Helvellyn_by_Benjamin_Robert_Haydon.jpg/800px-Wordsworth_on_Helvellyn_by_Benjamin_Robert_Haydon.jpg",
"https://en.wikipedia.org/wiki/William_Wordsworth"));
}
......
......@@ -23,6 +23,7 @@ public class HTMLResultPage implements Page {
// Header
writer.println("<html>");
writer.println("<head><title>" + query + "</title></head>");
writer.println("<body>");
// Content
......@@ -32,12 +33,13 @@ public class HTMLResultPage implements Page {
} else {
writer.println("<h1>" + query + "</h1>");
writer.println("<p>" + answer.getAnswer().replace("\n", "<br>") + "</p>");
writer.println("<p> <img src=\"" + answer.getImgURL() + "\"> </p>");
writer.println("<p><a href=\""+answer.getWikiURL()+"\" target=\"_blank" +
"\">Learn More!</a></p>");
writer.println("<p><a href=\"/\">Back to Search Page</a></p>");
}
writer.println("<p> <img src=\"" + answer.getImgURL() + "\"> </p>");
writer.println("<p><a href=\""+answer.getWikiURL()+"\" target=\"_blank" +
"\">Learn More!</a></p>");
writer.println("<p><a href=\"/\">Back to Search Page</a></p>");
// Footer
writer.println("</body>");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment