Skip to content

Regex matches on non-VA causing ErrorLateralityNotFound #2

@dcronkite

Description

@dcronkite

This can be replicated with the following test:

def test_scalp_does_not_error
	a = VAExtractor.new
	a.extract('SCALP ')  # the 'LP ' will be captured
end

The regular expression incorrectly identifies some text as a potential VA score. If no VA score is found, these will raise an ErrorLateralityNotFound. (E.g., "LP " is captured.)

raise ErrorLateralityNotFound

NB: Under the current code, other errors may occur before since boundary conditions aren't checked, but this is the underlying issue. (E.g.,

lat = searchpriorlines(lines[i-3..i-1].reverse)
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions