Giter Site home page Giter Site logo

oscarfa28 / string-matching Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

This repository houses two Python scripts for string matching algorithms - 'naive_matching' and 'booyer-moore-horspool.' These scripts are designed to efficiently search for occurrences of one string (the pattern) within another (the text).

Python 100.00%
booyer-moore-harspool brute-force-search naive python string-matching

string-matching's Introduction

String-Matching

Naive Matching: The naive matching algorithm, also known as "brute force," is the simplest method for searching for a pattern in a text string. It works by comparing the pattern with every possible substring of the main text string. It starts at the first position of the text string and slides the pattern one position at a time until it finds a match or reaches the end. It is easy to implement but can be inefficient on long text strings due to the large number of required comparisons.

Boyer-Moore-Horspool: The Boyer-Moore-Horspool algorithm is a more sophisticated algorithm for pattern searching in text strings. It is based on the idea of skipping several positions in the text string when a mismatch is encountered between the pattern and the text. It uses two main heuristics: the last character of the pattern (Boyer-Moore rule) and a skip table (Horspool rule) based on the characters in the pattern. These heuristics allow it to avoid many unnecessary comparisons, making it efficient in most practical cases. The Boyer-Moore-Horspool algorithm is widely used in text search applications due to its speed and efficiency.

string-matching's People

Contributors

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