SlideShare a Scribd company logo
1 of 1
import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import java.io.*; import
java.util.ArrayList; import java.util.Scanner; public class SearchEngine { private int mode;
private Tree nodeTree; // List -> Tree // build everything bahahah // TODO: mode 3 = BST mode
4 = AVL public SearchEngine(int mode) throws IOException { this.mode = mode; } public Tree
getNodeTree(){ return this.nodeTree; } // assumes that the file exists already // TODO: tweak
logic so that it builds the proper tree public void buildList() throws IOException {
System.out.println("reading"); BufferedReader reader = new BufferedReader(new
FileReader("dataset.txt")); String url; while((url = reader.readLine()) != null){ Document doc =
Jsoup.connect(url).get(); String text = doc.body().text().toLowerCase(); String[] words =
text.split("s+"); // splits by whitespace for (String word : words) { // HERE } } reader.close();
System.out.println("Finished reading through all URLs"); } // return a List ew ._. // TODO:
Return the reference list of URLs public ArrayList search(String term) {
System.out.println("Searching for " + term + " using data structure mode " + mode + "..."); //
Search logic goes here return new ArrayList<>(); } public static void main(String[] args) throws
IOException{ Scanner input = new Scanner(System.in); System.out.println("Enter mode as in
what data structure to use:"); System.out.println(" 1. Array List "); System.out.println(" 2. Sorted
Array List"); int mode = input.nextInt(); System.out.println("Building Search Engine...");
SearchEngine engine = new SearchEngine(mode); String answer = "y"; while
(answer.equals("y")) { input.nextLine(); // consume the remaining newline character
System.out.print("Search (enter a term to query): "); String term = input.nextLine();
engine.search(term); System.out.print("Would you like to search another term (y/n)? "); answer
= input.nextLine(); } input.close(); } }

More Related Content

Similar to import org-jsoup-Jsoup- import org-jsoup-nodes-Document- import java-.docx

Application-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageApplication-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageESUG
 
Session 23 - JDBC
Session 23 - JDBCSession 23 - JDBC
Session 23 - JDBCPawanMM
 
Create a text file named lnfo.txt. Enter the following informatio.pdf
Create a text file named lnfo.txt. Enter the following informatio.pdfCreate a text file named lnfo.txt. Enter the following informatio.pdf
Create a text file named lnfo.txt. Enter the following informatio.pdfshahidqamar17
 
Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Martijn Verburg
 
09.Local Database Files and Storage on WP
09.Local Database Files and Storage on WP09.Local Database Files and Storage on WP
09.Local Database Files and Storage on WPNguyen Tuan
 
Devoxx08 - Nuxeo Core, JCR 2, CMIS
Devoxx08 - Nuxeo Core, JCR 2, CMIS Devoxx08 - Nuxeo Core, JCR 2, CMIS
Devoxx08 - Nuxeo Core, JCR 2, CMIS Nuxeo
 
Writing Swift code with great testability
Writing Swift code with great testabilityWriting Swift code with great testability
Writing Swift code with great testabilityJohn Sundell
 
Refactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartRefactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartGabriele Lana
 
Create an implementation of a binary tree using the recursive appr.pdf
Create an implementation of a binary tree using the recursive appr.pdfCreate an implementation of a binary tree using the recursive appr.pdf
Create an implementation of a binary tree using the recursive appr.pdffederaleyecare
 
C# Application program UNIT III
C# Application program UNIT IIIC# Application program UNIT III
C# Application program UNIT IIIMinu Rajasekaran
 
import required package file import java.io.File; The Filed.pdf
 import required package file import java.io.File; The Filed.pdf import required package file import java.io.File; The Filed.pdf
import required package file import java.io.File; The Filed.pdfanandinternational01
 
10 sharing files and data in windows phone 8
10   sharing files and data in windows phone 810   sharing files and data in windows phone 8
10 sharing files and data in windows phone 8WindowsPhoneRocks
 
First java-server-faces-tutorial-en
First java-server-faces-tutorial-enFirst java-server-faces-tutorial-en
First java-server-faces-tutorial-entechbed
 

Similar to import org-jsoup-Jsoup- import org-jsoup-nodes-Document- import java-.docx (20)

JDBC
JDBCJDBC
JDBC
 
Application-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageApplication-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta Language
 
Session 23 - JDBC
Session 23 - JDBCSession 23 - JDBC
Session 23 - JDBC
 
Create a text file named lnfo.txt. Enter the following informatio.pdf
Create a text file named lnfo.txt. Enter the following informatio.pdfCreate a text file named lnfo.txt. Enter the following informatio.pdf
Create a text file named lnfo.txt. Enter the following informatio.pdf
 
Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2
 
09.Local Database Files and Storage on WP
09.Local Database Files and Storage on WP09.Local Database Files and Storage on WP
09.Local Database Files and Storage on WP
 
Devoxx08 - Nuxeo Core, JCR 2, CMIS
Devoxx08 - Nuxeo Core, JCR 2, CMIS Devoxx08 - Nuxeo Core, JCR 2, CMIS
Devoxx08 - Nuxeo Core, JCR 2, CMIS
 
Ejb3 Dan Hinojosa
Ejb3 Dan HinojosaEjb3 Dan Hinojosa
Ejb3 Dan Hinojosa
 
Android Data Storagefinal
Android Data StoragefinalAndroid Data Storagefinal
Android Data Storagefinal
 
Writing Swift code with great testability
Writing Swift code with great testabilityWriting Swift code with great testability
Writing Swift code with great testability
 
Refactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartRefactoring In Tdd The Missing Part
Refactoring In Tdd The Missing Part
 
Create an implementation of a binary tree using the recursive appr.pdf
Create an implementation of a binary tree using the recursive appr.pdfCreate an implementation of a binary tree using the recursive appr.pdf
Create an implementation of a binary tree using the recursive appr.pdf
 
Apache Beam de A à Z
 Apache Beam de A à Z Apache Beam de A à Z
Apache Beam de A à Z
 
C# Application program UNIT III
C# Application program UNIT IIIC# Application program UNIT III
C# Application program UNIT III
 
import required package file import java.io.File; The Filed.pdf
 import required package file import java.io.File; The Filed.pdf import required package file import java.io.File; The Filed.pdf
import required package file import java.io.File; The Filed.pdf
 
JavaExamples
JavaExamplesJavaExamples
JavaExamples
 
10 sharing files and data in windows phone 8
10   sharing files and data in windows phone 810   sharing files and data in windows phone 8
10 sharing files and data in windows phone 8
 
Code red SUM
Code red SUMCode red SUM
Code red SUM
 
Bhaloo
BhalooBhaloo
Bhaloo
 
First java-server-faces-tutorial-en
First java-server-faces-tutorial-enFirst java-server-faces-tutorial-en
First java-server-faces-tutorial-en
 

More from RyanEAcTuckern

In 2019- Facebook announced its plan to roll out a new stablecoin call.docx
In 2019- Facebook announced its plan to roll out a new stablecoin call.docxIn 2019- Facebook announced its plan to roll out a new stablecoin call.docx
In 2019- Facebook announced its plan to roll out a new stablecoin call.docxRyanEAcTuckern
 
In 2018- Adele- who is single- acquired section 1244 stock in the init.docx
In 2018- Adele- who is single- acquired section 1244 stock in the init.docxIn 2018- Adele- who is single- acquired section 1244 stock in the init.docx
In 2018- Adele- who is single- acquired section 1244 stock in the init.docxRyanEAcTuckern
 
In 2014- Oracle sued SAP for copyright infringement- Assume that both (1).docx
In 2014- Oracle sued SAP for copyright infringement- Assume that both (1).docxIn 2014- Oracle sued SAP for copyright infringement- Assume that both (1).docx
In 2014- Oracle sued SAP for copyright infringement- Assume that both (1).docxRyanEAcTuckern
 
import java-util-Scanner- public class MathFunctions { public static v.docx
import java-util-Scanner- public class MathFunctions { public static v.docximport java-util-Scanner- public class MathFunctions { public static v.docx
import java-util-Scanner- public class MathFunctions { public static v.docxRyanEAcTuckern
 
Implementation File- -------------------------------------------------.docx
Implementation File- -------------------------------------------------.docxImplementation File- -------------------------------------------------.docx
Implementation File- -------------------------------------------------.docxRyanEAcTuckern
 
implement in C++ language 2- employeeId 3- basicsalary 4- displayInfo.docx
implement in C++ language 2- employeeId 3- basicsalary 4- displayInfo.docximplement in C++ language 2- employeeId 3- basicsalary 4- displayInfo.docx
implement in C++ language 2- employeeId 3- basicsalary 4- displayInfo.docxRyanEAcTuckern
 
Implements the multiplicative binomial tree numerically- Inputs- S1- u.docx
Implements the multiplicative binomial tree numerically- Inputs- S1- u.docxImplements the multiplicative binomial tree numerically- Inputs- S1- u.docx
Implements the multiplicative binomial tree numerically- Inputs- S1- u.docxRyanEAcTuckern
 
Imagine that the volcano on Mt- St- Helens erupts again- All life is.docx
Imagine that the volcano on Mt- St- Helens erupts again-  All life is.docxImagine that the volcano on Mt- St- Helens erupts again-  All life is.docx
Imagine that the volcano on Mt- St- Helens erupts again- All life is.docxRyanEAcTuckern
 
III- Thres fair tetrahedra (atme as the one in part I except (tnakenta.docx
III- Thres fair tetrahedra (atme as the one in part I except (tnakenta.docxIII- Thres fair tetrahedra (atme as the one in part I except (tnakenta.docx
III- Thres fair tetrahedra (atme as the one in part I except (tnakenta.docxRyanEAcTuckern
 
III Cld the kon to vow be lablo ol saramary satestes H0w1v2-0H1W1v2-0.docx
III Cld the kon to vow be lablo ol saramary satestes H0w1v2-0H1W1v2-0.docxIII Cld the kon to vow be lablo ol saramary satestes H0w1v2-0H1W1v2-0.docx
III Cld the kon to vow be lablo ol saramary satestes H0w1v2-0H1W1v2-0.docxRyanEAcTuckern
 
Imagine that you are planning an upcoming social media campaign for on.docx
Imagine that you are planning an upcoming social media campaign for on.docxImagine that you are planning an upcoming social media campaign for on.docx
Imagine that you are planning an upcoming social media campaign for on.docxRyanEAcTuckern
 
Iguana Incorporated paid a dividend of $1-85 this year- The dividend i.docx
Iguana Incorporated paid a dividend of $1-85 this year- The dividend i.docxIguana Incorporated paid a dividend of $1-85 this year- The dividend i.docx
Iguana Incorporated paid a dividend of $1-85 this year- The dividend i.docxRyanEAcTuckern
 
III- Assume 20 animals per group- Treatment is daily by oral gavage wi.docx
III- Assume 20 animals per group- Treatment is daily by oral gavage wi.docxIII- Assume 20 animals per group- Treatment is daily by oral gavage wi.docx
III- Assume 20 animals per group- Treatment is daily by oral gavage wi.docxRyanEAcTuckern
 
If the three subunits of a vertebrate ATP synthase are in the followi.docx
If the three  subunits of a vertebrate ATP synthase are in the followi.docxIf the three  subunits of a vertebrate ATP synthase are in the followi.docx
If the three subunits of a vertebrate ATP synthase are in the followi.docxRyanEAcTuckern
 
If the CPI was 9-9 in 1913 and 256 in 2019 - what was the inflation ra.docx
If the CPI was 9-9 in 1913 and 256 in 2019 - what was the inflation ra.docxIf the CPI was 9-9 in 1913 and 256 in 2019 - what was the inflation ra.docx
If the CPI was 9-9 in 1913 and 256 in 2019 - what was the inflation ra.docxRyanEAcTuckern
 
If Dorothy went to the prom with Daniel in early May- It was the perfe.docx
If Dorothy went to the prom with Daniel in early May- It was the perfe.docxIf Dorothy went to the prom with Daniel in early May- It was the perfe.docx
If Dorothy went to the prom with Daniel in early May- It was the perfe.docxRyanEAcTuckern
 
Identify the principal diagnosis and secondary diagnosis and place the.docx
Identify the principal diagnosis and secondary diagnosis and place the.docxIdentify the principal diagnosis and secondary diagnosis and place the.docx
Identify the principal diagnosis and secondary diagnosis and place the.docxRyanEAcTuckern
 
Identify the following formula- DMUsed Direct Labor + Allocated MOH Co.docx
Identify the following formula- DMUsed Direct Labor + Allocated MOH Co.docxIdentify the following formula- DMUsed Direct Labor + Allocated MOH Co.docx
Identify the following formula- DMUsed Direct Labor + Allocated MOH Co.docxRyanEAcTuckern
 
identify Each stage of meiosis and briefly explain what occurs during.docx
identify Each stage of meiosis and briefly explain what occurs during.docxidentify Each stage of meiosis and briefly explain what occurs during.docx
identify Each stage of meiosis and briefly explain what occurs during.docxRyanEAcTuckern
 
I- Construct a membership table for the following combination of the s.docx
I- Construct a membership table for the following combination of the s.docxI- Construct a membership table for the following combination of the s.docx
I- Construct a membership table for the following combination of the s.docxRyanEAcTuckern
 

More from RyanEAcTuckern (20)

In 2019- Facebook announced its plan to roll out a new stablecoin call.docx
In 2019- Facebook announced its plan to roll out a new stablecoin call.docxIn 2019- Facebook announced its plan to roll out a new stablecoin call.docx
In 2019- Facebook announced its plan to roll out a new stablecoin call.docx
 
In 2018- Adele- who is single- acquired section 1244 stock in the init.docx
In 2018- Adele- who is single- acquired section 1244 stock in the init.docxIn 2018- Adele- who is single- acquired section 1244 stock in the init.docx
In 2018- Adele- who is single- acquired section 1244 stock in the init.docx
 
In 2014- Oracle sued SAP for copyright infringement- Assume that both (1).docx
In 2014- Oracle sued SAP for copyright infringement- Assume that both (1).docxIn 2014- Oracle sued SAP for copyright infringement- Assume that both (1).docx
In 2014- Oracle sued SAP for copyright infringement- Assume that both (1).docx
 
import java-util-Scanner- public class MathFunctions { public static v.docx
import java-util-Scanner- public class MathFunctions { public static v.docximport java-util-Scanner- public class MathFunctions { public static v.docx
import java-util-Scanner- public class MathFunctions { public static v.docx
 
Implementation File- -------------------------------------------------.docx
Implementation File- -------------------------------------------------.docxImplementation File- -------------------------------------------------.docx
Implementation File- -------------------------------------------------.docx
 
implement in C++ language 2- employeeId 3- basicsalary 4- displayInfo.docx
implement in C++ language 2- employeeId 3- basicsalary 4- displayInfo.docximplement in C++ language 2- employeeId 3- basicsalary 4- displayInfo.docx
implement in C++ language 2- employeeId 3- basicsalary 4- displayInfo.docx
 
Implements the multiplicative binomial tree numerically- Inputs- S1- u.docx
Implements the multiplicative binomial tree numerically- Inputs- S1- u.docxImplements the multiplicative binomial tree numerically- Inputs- S1- u.docx
Implements the multiplicative binomial tree numerically- Inputs- S1- u.docx
 
Imagine that the volcano on Mt- St- Helens erupts again- All life is.docx
Imagine that the volcano on Mt- St- Helens erupts again-  All life is.docxImagine that the volcano on Mt- St- Helens erupts again-  All life is.docx
Imagine that the volcano on Mt- St- Helens erupts again- All life is.docx
 
III- Thres fair tetrahedra (atme as the one in part I except (tnakenta.docx
III- Thres fair tetrahedra (atme as the one in part I except (tnakenta.docxIII- Thres fair tetrahedra (atme as the one in part I except (tnakenta.docx
III- Thres fair tetrahedra (atme as the one in part I except (tnakenta.docx
 
III Cld the kon to vow be lablo ol saramary satestes H0w1v2-0H1W1v2-0.docx
III Cld the kon to vow be lablo ol saramary satestes H0w1v2-0H1W1v2-0.docxIII Cld the kon to vow be lablo ol saramary satestes H0w1v2-0H1W1v2-0.docx
III Cld the kon to vow be lablo ol saramary satestes H0w1v2-0H1W1v2-0.docx
 
Imagine that you are planning an upcoming social media campaign for on.docx
Imagine that you are planning an upcoming social media campaign for on.docxImagine that you are planning an upcoming social media campaign for on.docx
Imagine that you are planning an upcoming social media campaign for on.docx
 
Iguana Incorporated paid a dividend of $1-85 this year- The dividend i.docx
Iguana Incorporated paid a dividend of $1-85 this year- The dividend i.docxIguana Incorporated paid a dividend of $1-85 this year- The dividend i.docx
Iguana Incorporated paid a dividend of $1-85 this year- The dividend i.docx
 
III- Assume 20 animals per group- Treatment is daily by oral gavage wi.docx
III- Assume 20 animals per group- Treatment is daily by oral gavage wi.docxIII- Assume 20 animals per group- Treatment is daily by oral gavage wi.docx
III- Assume 20 animals per group- Treatment is daily by oral gavage wi.docx
 
If the three subunits of a vertebrate ATP synthase are in the followi.docx
If the three  subunits of a vertebrate ATP synthase are in the followi.docxIf the three  subunits of a vertebrate ATP synthase are in the followi.docx
If the three subunits of a vertebrate ATP synthase are in the followi.docx
 
If the CPI was 9-9 in 1913 and 256 in 2019 - what was the inflation ra.docx
If the CPI was 9-9 in 1913 and 256 in 2019 - what was the inflation ra.docxIf the CPI was 9-9 in 1913 and 256 in 2019 - what was the inflation ra.docx
If the CPI was 9-9 in 1913 and 256 in 2019 - what was the inflation ra.docx
 
If Dorothy went to the prom with Daniel in early May- It was the perfe.docx
If Dorothy went to the prom with Daniel in early May- It was the perfe.docxIf Dorothy went to the prom with Daniel in early May- It was the perfe.docx
If Dorothy went to the prom with Daniel in early May- It was the perfe.docx
 
Identify the principal diagnosis and secondary diagnosis and place the.docx
Identify the principal diagnosis and secondary diagnosis and place the.docxIdentify the principal diagnosis and secondary diagnosis and place the.docx
Identify the principal diagnosis and secondary diagnosis and place the.docx
 
Identify the following formula- DMUsed Direct Labor + Allocated MOH Co.docx
Identify the following formula- DMUsed Direct Labor + Allocated MOH Co.docxIdentify the following formula- DMUsed Direct Labor + Allocated MOH Co.docx
Identify the following formula- DMUsed Direct Labor + Allocated MOH Co.docx
 
identify Each stage of meiosis and briefly explain what occurs during.docx
identify Each stage of meiosis and briefly explain what occurs during.docxidentify Each stage of meiosis and briefly explain what occurs during.docx
identify Each stage of meiosis and briefly explain what occurs during.docx
 
I- Construct a membership table for the following combination of the s.docx
I- Construct a membership table for the following combination of the s.docxI- Construct a membership table for the following combination of the s.docx
I- Construct a membership table for the following combination of the s.docx
 

Recently uploaded

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

import org-jsoup-Jsoup- import org-jsoup-nodes-Document- import java-.docx

  • 1. import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import java.io.*; import java.util.ArrayList; import java.util.Scanner; public class SearchEngine { private int mode; private Tree nodeTree; // List -> Tree // build everything bahahah // TODO: mode 3 = BST mode 4 = AVL public SearchEngine(int mode) throws IOException { this.mode = mode; } public Tree getNodeTree(){ return this.nodeTree; } // assumes that the file exists already // TODO: tweak logic so that it builds the proper tree public void buildList() throws IOException { System.out.println("reading"); BufferedReader reader = new BufferedReader(new FileReader("dataset.txt")); String url; while((url = reader.readLine()) != null){ Document doc = Jsoup.connect(url).get(); String text = doc.body().text().toLowerCase(); String[] words = text.split("s+"); // splits by whitespace for (String word : words) { // HERE } } reader.close(); System.out.println("Finished reading through all URLs"); } // return a List ew ._. // TODO: Return the reference list of URLs public ArrayList search(String term) { System.out.println("Searching for " + term + " using data structure mode " + mode + "..."); // Search logic goes here return new ArrayList<>(); } public static void main(String[] args) throws IOException{ Scanner input = new Scanner(System.in); System.out.println("Enter mode as in what data structure to use:"); System.out.println(" 1. Array List "); System.out.println(" 2. Sorted Array List"); int mode = input.nextInt(); System.out.println("Building Search Engine..."); SearchEngine engine = new SearchEngine(mode); String answer = "y"; while (answer.equals("y")) { input.nextLine(); // consume the remaining newline character System.out.print("Search (enter a term to query): "); String term = input.nextLine(); engine.search(term); System.out.print("Would you like to search another term (y/n)? "); answer = input.nextLine(); } input.close(); } }