Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add longest common sub-sequence algorithm #211

Closed
piyawutpattamanon opened this issue Apr 24, 2019 · 1 comment · Fixed by #1059
Closed

Add longest common sub-sequence algorithm #211

piyawutpattamanon opened this issue Apr 24, 2019 · 1 comment · Fixed by #1059
Labels
enhancement enhance functionalities Hacktoberfest for Hacktoberfest event

Comments

@piyawutpattamanon
Copy link

piyawutpattamanon commented Apr 24, 2019

Hi, due to my work require me to write calculate "similarity" of strings, I've created a dynamic programming version of my own and I would like to contribute to pythainlp.

I will submit a pull request within 2-3 days if there is not any problem.

Reference
https://en.wikipedia.org/wiki/Longest_common_subsequence_problem

@bact
Copy link
Member

bact commented Apr 29, 2019

Maybe we can put this somewhere inside pythainlp.util module :)

@bact bact added the enhancement enhance functionalities label May 10, 2019
@cstorm125 cstorm125 changed the title adding Longest Common Subsequence algorithm Add longest common sub-sequence algorithm May 16, 2019
@lalital lalital self-assigned this May 18, 2019
@wannaphong wannaphong added the Hacktoberfest for Hacktoberfest event label Oct 19, 2019
wannaphong added a commit that referenced this issue 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](https://copilot-workspace.githubnext.com/PyThaiNLP/pythainlp/issues/211?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement enhance functionalities Hacktoberfest for Hacktoberfest event
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants