With the help of this application you can calculate the Hamming distance (substitution values only) and Levenshtein distance of the given strings.
User Interface to calculate distance from Browser
Here is how you can run the project locally:
- Clone this repo
git clone {REPOSITORY_URL} - Go into the project root directory
cd /distance-calculator - Copy
.env.examplefile to.envfilecp .env.example .env
- Run the following command to install the dependency
composer install
- Run the command to serve the project
php artisan serve
- Open this link in your browser http://127.0.0.1:8000
- Goto your project directory using the following command.
cd ./distance-calculator - Run this command
php artisan app:calculate
- Input first string and hit enter.
- Input second string and hit enter.
- You should see the distance calculation of both the strings in the result.
- Goto the project directory using the following command.
cd ./distance-calculator - Run this command
php artisan test
We are using the following files in this project.
- Controllers
App\Http\Controllers\IndexController.php
- Validation Requests
App\Http\Requests\Index.php
- Routes
Routes\Web.php
- View Templates
Resources\Views\layouts\app.blade.phpResources\Views\index.blade.php
- Console Commands
App\Console\Commands\CalculationCommand.php
- Test Cases
Tests\Feature\IndexControllerTest.phpTests\Unit\CalculationTest.php




