GithubHelp home page GithubHelp logo

search-engine-simulator's Introduction

SearchEngine ReadMe

Overview

The SearchEngine class is a Java program designed to manage a web graph, allowing users to perform various operations such as adding/removing pages, adding/removing links between pages, printing the graph, and searching for pages based on keywords. The program provides an interactive command-line interface (CLI) for user interaction.

Features

  • Add a new page to the graph (AP): Users can add a new page to the web graph by providing a URL and associated keywords.
  • Remove a page from the graph (RP): Users can remove an existing page from the web graph by specifying its URL.
  • Add a link between pages in the graph (AL): Users can establish a hyperlink between two existing pages in the web graph.
  • Remove a link between pages in the graph (RL): Users can remove an existing hyperlink between two pages in the web graph.
  • Print the graph (P): Users can print the entire web graph, with options to sort based on index, URL, or rank.
  • Search for pages with a keyword (S): Users can search for pages containing a specific keyword and view the search results ranked by page rank.
  • Quit (Q): Users can exit the program.

File Structure

The program relies on two text files for initializing the web graph:

  • pages.txt: Contains a list of URLs and associated keywords for web pages.
  • links.txt: Specifies the hyperlinks between pages in the web graph.

Running the Program

  1. Ensure that the pages.txt and links.txt files are present in the appropriate directory specified in the SearchEngine class.
  2. Compile and run the SearchEngine class in a Java environment.
  3. Follow the on-screen prompts to interact with the program:
    • Select options from the menu by entering the corresponding option code.
    • Provide necessary inputs such as URLs, keywords, or source/destination URLs as requested by the program.
  4. Upon selecting the Quit (Q) option, the program will terminate.

Error Handling

  • The program incorporates error handling mechanisms to manage illegal inputs and file-related errors. Users will receive appropriate error messages in case of invalid inputs or file access issues.
  • Illegal entries or invalid operations will prompt the user to try again.

Dependencies

The program is written in Java and does not rely on external libraries or frameworks beyond the standard Java Development Kit (JDK).

search-engine-simulator's People

Contributors

ingrettable avatar

Stargazers

Daniel Kogan avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.