[ 
https://issues.apache.org/jira/browse/LANG-680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Neidhart updated LANG-680:
---------------------------------

    Attachment: LANG-680.patch

The attached patch implements the longest common substring methods using the 
dynamic programming algorithm.

The interface is the same as outlined by Henri, the variant with an array of 
strings is omitted so far, as this would require a suffix tree data structure 
to compute the lcs.

For now, the lcsAll method returns *all* found longest common substrings, and 
returns null if none could be found (i.e. the lcs would be an empty string). 
This could be changed to return an empty array, but I found this more suited.
                
> StringUtils - Longest Common Substring / Longest common susequence
> ------------------------------------------------------------------
>
>                 Key: LANG-680
>                 URL: https://issues.apache.org/jira/browse/LANG-680
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>            Reporter: Andrea Vacondio
>              Labels: LCS,, Longest, common, substring
>             Fix For: 3.x
>
>         Attachments: LANG-680.patch
>
>
> I recently needed to perform Longest commons substring on a collection of 
> filenames and I think it could be usefull to have it in StringUtils (I 
> couldn't find any discussion about it).
> Some detail here 
> http://en.wikipedia.org/wiki/Longest_common_substring
> and here
> http://en.wikipedia.org/wiki/Longest_common_subsequence_problem

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to