Code Monkey home page Code Monkey logo

searchengine_hyperskill's Introduction

Search Engine

This is a simple search engine application implemented in Java. The application reads records from a file and allows users to search for records using different matching strategies.

Table of Contents

Getting Started

These instructions will help you set up and run the project on your local machine for development and testing purposes.

Prerequisites

  • Java Development Kit (JDK) 11 or higher
  • Apache Maven 3.6.3 or higher

Installation

  1. Clone the repository:
    git clone https://github.com/BrianVega/SearchEngine_Hyperskill.git
  2. Navigate to the project directory:
    cd SearchEngine_Hyperskill
  3. Build the project using Maven:
    mvn clean install

Usage

  1. Load Data.
  2. Application Menu.

Load Data

  1. Run the program by passing a CLI argument that corresponds to the name of the file in plain text format that will serve as input for load the data.
  • 1.1 The CLI argument has the following syntax: --data <value> where value corresponds to the location where the input file is located.
  • 1.2 The input file needs to meet the required input standards as shown in the Sample Input File.

Sample Input File

text.txt

Dwight Joseph [email protected]
Rene Webb [email protected]
Katie Jacobs
Erick Harrington [email protected]
Myrtle Medina
Erick Burgess
(...)
<name> <surname> <email>

Application Menu

The application presents a menu with the following options:

Find a person:

  1. Select this option by entering 1.
  2. You will be prompted to choose a search strategy (ALL, ANY, NONE).
  3. After selecting the strategy, enter the search term(s).
  4. The application will display the records that match the search criteria based on the chosen strategy.

Print all people:

  1. Select this option by entering 2.
  2. The application will display all the records currently loaded in the search engine.

Exit:

  1. Select this option by entering 0.
  2. The application will exit.

Search Strategies

You can search using three different strategies:

  • ALL: Finds records containing all search terms.
  • ANY: Finds records containing any of the search terms.
  • NONE: Finds records that do not contain any of the search terms.

Architecture

The project is structured as follows:

  • org.search: Main package containing the core logic.
    • Main: Entry point of the application.
    • SearchEngine: Main class handling data loading and search operations.
    • Data: Class representing individual records.
    • Enums: Contains the Strategies enum defining search strategies.
    • Interfaces: Contains the Strategy interface and BaseSearch abstract class.
    • Models.Strategies: Contains implementations of the different search strategies (All, Any, None) and the StrategyFactory class.
    • UI: Handles user interactions.
    • IO: Handles input and output operations, including validation.

searchengine_hyperskill's People

Contributors

brianvega 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.