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

Regex matches on non-VA causing ErrorLateralityNotFound #2

Open
dcronkite opened this issue Dec 8, 2020 · 0 comments
Open

Regex matches on non-VA causing ErrorLateralityNotFound #2

dcronkite opened this issue Dec 8, 2020 · 0 comments

Comments

@dcronkite
Copy link
Contributor

dcronkite commented Dec 8, 2020

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)
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant