Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

kanow-algorithms/naive-string-matcher

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

naive-string-matcher

Requirements

Before testing this code, please make sure you have:

Installation

Clone repo:

git clone https://github.com/kanow-algorithms/naive-string-matcher.git

Testing

To run tests run this command in the root of this project:

cargo test

Description

naive_string_matcher takes two parameters:

  • text → is a reference to vector of all characters in which you want to find the word
  • pattern → is a reference to vector of all search word characters

Example

Input:

let text = vec!['H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'];
let pattern = vec!['w', 'o', 'r', 'l', 'd'];
naive_string_matcher(&text, &pattern);

Output:

[6]

How it works

On this graphic you can see how naive-string-matcher algorithm works:

NaiveStringMatcher

About

Rust implementation of naive string matcher algorithm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.