Giter Club home page Giter Club logo

regex-hamlet-parser's Introduction

Regular Expressions Lab - Hamlet Parser

Instructions:

In this project, your task is to create a Java program that processes the provided "Hamlet" text file using regular expressions. The goal is to replace every occurrence of "Hamlet" with "Leon" and every occurrence of "Horatio" with "Tariq." This process should be achieved exclusively using the Pattern and Matcher classes, without relying on String Utilities for direct word replacement.

Step 1: Set Up the Project

Begin by forking this repository and submit the URL of your fork via the Student Portal.

Step 2: Write Test Cases

Start by writing test cases that will guide the development of your program. You are responsible for creating all the necessary tests to ensure the correctness and robustness of your solution. Some stubs for test cases have been provided, but you should expand upon these to cover various scenarios.

Step 3: Implement the Text Replacement Logic

In this step, you will create methods to process the input text file using regular expressions. The main objective is to find and replace the target words "Hamlet" and "Horatio" with "Leon" and "Tariq," respectively. Ensure that your implementation uses the Pattern and Matcher classes to perform these replacements.

Step 4: Handle File Input and Output

Develop methods to read the "Hamlet" text file and save the modified content back to a new file. Consider error handling and file I/O operations to make your program robust.

Step 5: Test Your Implementation

Execute the test cases you created in Step 2 to validate your solution. Ensure that the replacements are accurate, and the program handles different scenarios effectively.

Step 6: Optimize and Refactor

Review your code for any potential optimizations or improvements. Consider factors such as code readability, performance, and maintainability.

Step 7:Final Checks

Double-check your project to ensure it meets all the requirements and provides accurate text replacement.

Step 8: Submission

Commit and push to your fork.

regex-hamlet-parser's People

Contributors

miscbits avatar thesleuth avatar

Watchers

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