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

Sanity check SigmetBetweenLatOrLon and SigmetOutsideLatOrLon parsing #159

Open
kasarit opened this issue Sep 26, 2023 · 0 comments
Open
Labels
sigmet/airmet SIGMET/AIRMET issues

Comments

@kasarit
Copy link
Contributor

kasarit commented Sep 26, 2023

private static String re1="((N|S)\\sOF\\s([NS]\\d{2,4})\\sAND\\s(N|S)\\sOF\\s([NS](\\d{2,4})))";
private static String re2="((W|E)\\sOF\\s([WE]\\d{3,5})\\sAND\\s(W|E)\\sOF\\s([WE](\\d{3,5})))";

public SigmetBetweenLatOrLon(final OccurrenceFrequency prio) {
    super("^("+re1+")|("+re2+")$", prio);
}

@Override
public void visitIfMatched(final Lexeme token, final Matcher match, final ConversionHints hints) {
    token.identify(SIGMET_BETWEEN_LATLON);
    token.setParsedValue(ParsedValueName.RELATIONTYPE, match.group(3));
    token.setParsedValue(ParsedValueName.RELATEDLINE, match.group(4));
    token.setParsedValue(ParsedValueName.RELATIONTYPE2, match.group(5));
    token.setParsedValue(ParsedValueName.RELATEDLINE2, match.group(6));
}

Only groups of rel1 are being read here? It should be checked, if either group 1 or 7 is null, and then read appropriate groups.

The same logic applies for both SigmetBetweenLatOrLon and SigmetOutsideLatOrLon.

@kasarit kasarit added the sigmet/airmet SIGMET/AIRMET issues label Sep 26, 2023
@kasarit kasarit changed the title Sanity check SigmetBetweenLatOrLon parsing Sanity check SigmetBetweenLatOrLon and SigmetOutsideLatOrLon parsing Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sigmet/airmet SIGMET/AIRMET issues
Projects
None yet
Development

No branches or pull requests

1 participant