Skip to content

closekn/KnuthMorrisPratt.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KnuthMorrisPratt.jl

Build Status Coverage Coverage

A Julia implementation of the Knuth-Morris-Pratt algorithm for string searching.

Feature

  • Find the first occurrence of a keyword in the text.

Install

  • Press ']' in Julia's REPL to enter package mode.
pkg> add https://github.com/closekn/KnuthMorrisPratt.jl

Example

  • code
using KnuthMorrisPratt
text = "Hello, world!"
keyword = "world"

pos = KMP_search(text, keyword)

if pos <= length(text)
  println("Found : $(pos)")
else
  println("Not Found")
end
  • output
Found : 8

About

Word Search Module Using Knuth-Morris-Pratt

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages