GithubHelp home page GithubHelp logo

algo_lab5_booyermoore's Introduction

Algo_Lab5_BooyerMoore

Algorithm Boyer-Moore

(Алгоритм для пошуку шаблону у стрічці) {BoyerMoore} class finds the first occurrence of a pattern string in a text string.

Files below:

src contains: BoyerMoore

tests contains: BooyerMooreTest

And pom.xml included

How to run: First you need to check your maven dependencies, and then open tests and run them: There are two types of tests included with realisation of search:

@Before
public void beforeSearch() {
	boyerMoore = new BoyerMoore("AAAGTT");
}

@Test
public void testSearchSuccess() {
	assertEquals(0, boyerMoore.search("AAAGTT"));
	assertEquals(1, boyerMoore.search("CAAAGTT"));
	assertEquals(0, boyerMoore.search("AAAGTTC"));
	assertEquals(5, boyerMoore.search("AAAGTAAAGTTAAAGT"));

	System.out.println("!");

}
@Test
public void testSearchFailure() {
	assertEquals(-1, boyerMoore.search("AAAGTC"));
	assertEquals(-1, boyerMoore.search("CAAGTT"));
	assertEquals(-1, boyerMoore.search("AAACTT"));
	assertEquals(-1, boyerMoore.search("AACGTT"));
}

}

also you can run tests using: mvn test

If code runs without errors - everything allright!

Сlass BoyerMoore Contains all the methods of search!

algo_lab5_booyermoore's People

Contributors

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