Skip to content

repeating words at the beginning #2

@agricolamz

Description

@agricolamz

Hi, thank you for your package! I found strange behavior when there are repeating units at the beginning of the string:

library(text.alignment)
smith_waterman("a b c d", "a b c d", type = "words") # expected
#> Swith Waterman local alignment score: 8
#> ----------
#> Document a
#> ----------
#> a b c d
#> ----------
#> Document b
#> ----------
#> a b c d
smith_waterman("a a b c d", "a a b c d", type = "words") # not expected
#> Swith Waterman local alignment score: 10
#> ----------
#> Document a
#> ----------
#> # a b c d
#> ----------
#> Document b
#> ----------
#> a a b c d
smith_waterman("a a a b c d", "a a a b c d", type = "words") # not expected
#> Swith Waterman local alignment score: 12
#> ----------
#> Document a
#> ----------
#> # a # a b c d
#> ----------
#> Document b
#> ----------
#> a # a a b c d

If I put repetitions in any other place of the string other then beginning, everything works fine as I expected...

Linux
R 4.4.1
text.alignment v 0.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions