Class TextAlgorithms
java.lang.Object
org.episteme.core.mathematics.discrete.TextAlgorithms
High-performance bit-parallel text matching algorithms.
References:
- Baeza-Yates, R., invalid input: '&' Gonnet, G. H. (1992). A new approach to text searching. Communications of the ACM, 35(10), 74-82. (Shift-Or algorithm)
- Wu, S., invalid input: '&' Manber, U. (1992). Fast text searching: allowing errors. Communications of the ACM, 35(10), 83-91. (Shift-And algorithm)
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionshiftOrSearch(String text, String pattern) Finds all exact occurrences of a pattern in a text using the Shift-Or algorithm.
-
Constructor Details
-
TextAlgorithms
public TextAlgorithms()
-
-
Method Details
-
shiftOrSearch
Finds all exact occurrences of a pattern in a text using the Shift-Or algorithm. Complexity: O(n + m + sigma) where n is text length, m pattern length, sigma alphabet size. Restricted to pattern length invalid input: '<'= 64.- Parameters:
text- The text to search inpattern- The pattern to look for- Returns:
- List of starting positions
-