JavaAlgorithms/src/test/java/com/thealgorithms/strings
Prabhat-Kumar 8200a791a2
Add AhoCorasick (#4465)
* Added code to find Articulation Points and Bridges

* tried to solve clang-formant test

* removed new line at EOF to get lint to pass

* feature: Added Ahocorasick Algorithm

* fixed lint using clang-format

* removed datastructures/graphs/ArticulationPointsAndBridge.java from this branch

* removed main, since test-file is added. Also modified and renamed few functions.

* Added test-file for AhoCorasick Algorithm

* Modified some comments in test-file

* Modified some comments in AhoCorasick.java

* lint fix

* added few more test cases

* Modified some comments

* Change all class fields to private, added initializeSuffixLinksForChildNodesOfTheRoot() method, hashmap string search position (also has previous index based search), removed java.util.*

* Added Missing Test-Cases and more

* minor text changes

* added direct test check i.e. defining a variable expected and just checking if res and expected are equal.

* Created New Class Trie, merged 'buildTrie and buildSuffixAndOutputLinks' with 'Trie constructor'. Merged setUpStartPoints with searchIn. Now AhoCorasick contains -> inner class: Trie, Node. Methods: search and convert. Trie has -> Methods : constructor and searchIn

* Updated TestFile according to the updated AhoCorasick Class. Added Few more test cases

* updated - broken down constructor to relavent parts, made string final, made res local to searchIn(), doxygen-like style

* lint fix clang

* Updated Tests Files

* Added final field to Node class setters and Trie Constructor arguments, removed getTrieRoot() and some unnecessory comments, renamed [old -> new]: res -> positionByStringIndexValue, removed if condition from setupStartPoints()

* updated test file

* lint fix clang

* minor chage - 'removed a comment'

* added final fields to some arguments, class and variables, added a method initializePositionByStringIndexValue()

* updated to remove * inclusion and added the required modules only

* Implemented a new class PatternPositionRecorder to wrap up the position recording in searchIn()

* Added final fields to PatternPositionRecorder Class

* style: mark default constructor of `AhoCorasick` as `private`

* style: remoce redundant `public`

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2023-10-08 15:16:06 +02:00
..
zigZagPattern style: format code (#4212) 2023-06-09 18:52:05 +08:00
AhoCorasickTest.java Add AhoCorasick (#4465) 2023-10-08 15:16:06 +02:00
AlphabeticalTest.java Format code with prettier (#3375) 2022-10-03 17:23:00 +08:00
AnagramsTest.java Add one more solution for anagrams check (#4175) 2023-05-05 20:50:47 +03:00
CharacterSameTest.java Format code with prettier (#3375) 2022-10-03 17:23:00 +08:00
CheckAnagramsTest.java Add a new implementation for CheckAnagrams (#4231) 2023-07-06 16:56:59 +03:00
CheckVowelsTest.java Add tests for vowels check (#3658) 2022-10-26 09:15:25 +03:00
HammingDistanceTest.java Add automatic linter (#4214) 2023-06-09 20:05:14 +08:00
HorspoolSearchTest.java chore: enforce InsertNewlineAtEOF in clang-format (#4343) 2023-09-01 04:10:46 +00:00
IsomorphicTest.java Code cleanup (#4246) 2023-07-22 15:23:00 +00:00
LetterCombinationsOfPhoneNumberTest.java Code cleanup (#4246) 2023-07-22 15:23:00 +00:00
longestNonRepeativeSubstringTest.java style: format code (#4212) 2023-06-09 18:52:05 +08:00
LowerTest.java style: format code (#4212) 2023-06-09 18:52:05 +08:00
MyAtoiTest.java style: format code (#4212) 2023-06-09 18:52:05 +08:00
PalindromeTest.java Add automatic linter (#4214) 2023-06-09 20:05:14 +08:00
PangramTest.java Update Pangram.java using Java Collections (#4479) 2023-10-01 16:28:13 +05:30
ReverseStringRecursiveTest.java Code cleanup (#4246) 2023-07-22 15:23:00 +00:00
ReverseStringTest.java style: format code (#4212) 2023-06-09 18:52:05 +08:00
ReverseWordsInStringTest.java Add ReverseWordsInString (#4456) 2023-10-06 20:15:27 +02:00
RotationTest.java style: format code (#4212) 2023-06-09 18:52:05 +08:00
StringCompressionTest.java style: format code (#4212) 2023-06-09 18:52:05 +08:00
UpperTest.java Format code with prettier (#3375) 2022-10-03 17:23:00 +08:00
ValidParenthesesTest.java style: format code (#4212) 2023-06-09 18:52:05 +08:00
WordLadderTest.java style: format code (#4212) 2023-06-09 18:52:05 +08:00