Plaintext parser issues

I’d like snow to supersede a general sky condition in my plaintext-parser output, as I think it should per plaintext-parser.txt. But for some reason, it’s not working consistently.

If you look at the attached screenshot, Tuesday has a snow icon despite a small chance of it, but Wednesday doesn’t despite predicting precipitation. Same thing for Friday night.

How can I fix this? I’m in a ski community and any snow falling warrants a snow icon in these parts. :wink:

Thanks!

You can reorder the entries in plaintext-parser-data.txt from

cond|rain likely|ra|nra|Rain likely|
cond|rain very likely|ra|nra|Rain likely|
cond|chance of rain|ra|nra|Chance rain|
cond|rain|ra|nra|Chance rain|
cond|mix|rasn|rasn|Mix|
cond|sleet|ip|ip|Sleet|
cond|snow|sn|nsn|Snow|

to


cond|mix|rasn|rasn|Mix|
cond|sleet|ip|ip|Sleet|
cond|snow|sn|nsn|Snow|
cond|rain likely|ra|nra|Rain likely|
cond|rain very likely|ra|nra|Rain likely|
cond|chance of rain|ra|nra|Chance rain|
cond|rain|ra|nra|Chance rain|

and that will give priority to the freezing stuff more than rain for the icon.

Best regards,
Ken

Thanks Ken, but still no luck. I made the changes you recommended but it’s still behaving oddly. You can see my plaintext-parser-data.txt here:

http://www.wrightwoodweather.com/plaintext-parser-data.txt

The conditions/icons are still showing something other than snow, despite snow in the forecast. Even Friday night, with >20 inches of snow predicted – certainly noteworthy – is choosing to display fog.

Ah… found the issue and think I’ve corrected it.
Try http://saratoga-weather.org/plaintext-parser-test.php?sce=view and see how that works for you.

Best regards,
Ken

Ken,

Installed and it looks like it’s working perfectly.

Thanks!
Jason

You’re welcome, Jason.

With our Mediterranean climate here in Saratoga, we only get to see Snow about every 15-20 years, so no chance to test it with local WXSIM forecasts.

The issue was having the ‘snow’ condition rejected from selection because there was a ‘snow level’ statement (prevents false positives). I added some debugging code to that area and saw that if ’ of snow|snow likely’ appeared, it was the real deal and shouldn’t be rejected from selection. Funny, my samples of 10 snow forecasts never had that particular combination before, but now I have yours to test with :slight_smile:

I’ll be releasing the updated script shortly.

Best regards,
Ken

Good, I am glad I can help. :slight_smile: Snow level is an important factor around here, since terrain varies from near 0’ in Los Angeles to 9,000+ feet – and the ski resort is about 6,600’ at the base, mountain passes around 4,200 ft, desert communities at 3,000 ft, etc.

It seems to still be having trouble occasionally, though. Tonight’s icon is defaulting to Fog, even though snow is forecast and I even put snow at the top of the conditions list in plaintext-parser-data.txt just to see if it would make a difference. It still shows fog tonight and t-storms today, despite having snow as the first condition in the data.txt file.

You can see the plaintext here: http://www.wrightwoodweather.com/plaintext_ken.txt

Thanks,
Jason

Thanks for the sample, Jason.

Try http://saratoga-weather.org/plaintext-parser-test.php?sce=view … it was the ‘snow very likely’ that wasn’t handled correctly.

Looks good, thanks Ken. :smiley: