Skip to content

Conversation

wannaphong
Copy link
Member

@wannaphong wannaphong commented Jan 8, 2025

Fixes #211

Add the longest common subsequence algorithm to the pythainlp.util module.

  • Create a new file pythainlp/util/lcs.py to implement the longest common subsequence algorithm.
  • Define a function longest_common_subsequence that takes two strings as input and returns their longest common subsequence.
  • Update pythainlp/util/__init__.py to import the longest_common_subsequence function from pythainlp.util.lcs and add it to the __all__ list.
  • Add unit tests for the longest_common_subsequence function in tests/core/test_util.py to ensure the correctness of the implementation.

For more details, open the Copilot Workspace session.

Fixes #211

Add the longest common subsequence algorithm to the `pythainlp.util` module.

* Create a new file `pythainlp/util/lcs.py` to implement the longest common subsequence algorithm.
* Define a function `longest_common_subsequence` that takes two strings as input and returns their longest common subsequence.
* Update `pythainlp/util/__init__.py` to import the `longest_common_subsequence` function from `pythainlp.util.lcs` and add it to the `__all__` list.
* Add unit tests for the `longest_common_subsequence` function in `tests/core/test_util.py` to ensure the correctness of the implementation.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/PyThaiNLP/pythainlp/issues/211?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link

sonarqubecloud bot commented Jan 8, 2025

@coveralls
Copy link

coveralls commented Jan 8, 2025

Coverage Status

coverage: 52.919% (+0.2%) from 52.753%
when pulling 4c5c948 on wannaphong/add-lcs
into 7332984 on dev.

@bact bact added the enhancement enhance functionalities label Jan 10, 2025
@wannaphong wannaphong merged commit c4de24c into dev Jan 13, 2025
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement enhance functionalities
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add longest common sub-sequence algorithm
3 participants