Guest User

Untitled

a guest
Jul 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. \documentclass[11pt,a4paper]{article}
  2. \usepackage[hmargin=3cm,vmargin=2cm]{geometry}
  3. \begin{document}
  4. {\huge \title{A5 Search Engine}}
  5. \author{Gregory Bird}
  6. \begin{flushleft}
  7. {\LARGE \bf \maketitle{Introduction:}}
  8.  
  9. To create 10 functions based around a search engine. Each function will manipulate strings and scores for the input and output of the prompt.
  10.  
  11. \section{Function I}
  12.  
  13. For function I a URL with some content is put into the function, the function is then expected to separate the URL from the content and return the URL to the main.
  14. \section{Function II}
  15.  
  16. Function II does a similar operation to its predecessor but returns the content instead of the URL.
  17. \section{Function III}
  18.  
  19. Function III looks into the requested page of the array to find a specific string. If the string is found it alerts “-string-“ found; otherwise it emits “-string-“ not found.
  20. \section{Function IV}
  21.  
  22. Function 4 is another search function like find1C but it converts both the search criteria and the input into lowercase so that “Lboro” is converted to lboro and can be easily found by function find1C.
  23. \section{Function V}
  24.  
  25. Function 5 finds out if string input is in any of the pages of the array then lists the pages of the array. It does this by adding to array (number) each time it searches a page in the array.
  26. \section{Function VI}
  27.  
  28. Function 6 looks at each page in the array for an input string and then returns a score for each page in the array. This function returns an array of scores because it searches the whole pages array.
  29. \section{Function VII}
  30.  
  31. Function 7 is a reasonably simple bubble sort, which sorts the array into a ascending order. Basically each variable is compared to the preceding one and is switched if its bigger.
  32.  
  33. \section{Function VIII}
  34.  
  35. Function 8 first finds the scores of the input string by using the function findScoresC. It then finds the content in each page in the pages array and finds the total amount of words. To get the percentage you need to need to divide the score of each line in the pages array with the amount of words in the pages array. The percentage is then stored into an array and then returned to the main.
  36. \section{Function IX}
  37.  
  38. Function 9 combines 3 functions together to get an output of Url and percentage of input found in the pages array. The 3 functions are first findscoreC2- which finds the scores and puts them into a percentage, sortScores – which sorts the score array and finally URL adds the url to the final output.
  39. \section{Function X}
  40.  
  41. The final function searches the array for a multiple amount of words, and alerts found if any of the three words are found.
  42.  
  43. \end{flushleft}
  44. \end{document}
Add Comment
Please, Sign In to add comment