pydatastructs
pydatastructs copied to clipboard
feat: Implement Bitap Algorithm for approximate string matching
Description
The Bitap Algorithm (also known as the Shift-Or Algorithm) is a bit-parallel algorithm used for approximate string matching. It is particularly useful for fuzzy string matching and searching with errors (e.g., allowing a certain number of mismatches).
This issue involves implementing the Bitap Algorithm in the pydatastructs.strings.algorithms module.
Proposed Implementation
- Add a function
bitap(text: str, query: str, max_errors: int = 0) -> DynamicOneDimensionalArrayto thealgorithms.pyfile. - The function should return the starting positions of all matches of the
queryin thetext, allowing up tomax_errorsmismatches. - Include unit tests for the new function.
- Update the
__all__list to include thebitapfunction.
@Kishan-Ved I am working on this issue....