Open Anaphory opened 7 years ago
Alternatively, don't re-implement the wheel and look at eg. lingpy
's various alignment methods and use the needleman_wunsch
(Code in lingpy.algorithm.cython._malign.nw_align
) and other alignment methods from there.
(As remarked by @LinguList in https://github.com/PhyloStar/CogDetect/pull/22#discussion_r115956831)
Currently, the
local
keyword indistances.needleman_wunsch
comes from an afterthought/experiment with local alignment, and while it works, the return value neglects to mention the prefix and suffix parts that were not aligned.In order to not give the function different return values depending on a keyword argument, we should consider splitting that behaviour out to a different function (
smith_waterman
?) which then returns all of those values.Re-using code may be easiest if the core (ll. 106–122 currently) is exported into a separate
calculate_alignment_scores
function?