[ drop f ]
} case [
2 group dup [ weather key? ] all?
- [ [ weather at ] map unwords ]
+ [ [ weather at ] map join-words ]
[ concat parse-glossary ] if
] dip prepend
] if ;
[ [ f ] [ low-clouds at "low clouds are %s" sprintf ] if-zero ]
[ [ f ] [ mid-clouds at "middle clouds are %s" sprintf ] if-zero ]
[ [ f ] [ high-clouds at "high clouds are %s" sprintf ] if-zero ]
- tri* 3array unwords ;
+ tri* 3array join-words ;
: parse-inches ( str -- str' )
dup [ CHAR: / = ] all? [ drop "unknown" ] [
"sea-level pressure is %s hPa" sprintf ;
: parse-lightning ( str -- str' )
- "LTG" ?head drop 2 group [ lightning at ] map unwords ;
+ "LTG" ?head drop 2 group [ lightning at ] map join-words ;
CONSTANT: re-recent-weather R/ ((\w{2})?[BE]\d{2,4}((\w{2})?[BE]\d{2,4})?)+/
: parse-recent-weather ( str -- str' )
split-recent-weather
- [ (parse-recent-weather) ] map unwords ;
+ [ (parse-recent-weather) ] map join-words ;
: parse-varying ( str -- str' )
"V" split1 [ string>number ] bi@
} cond ;
: metar-remarks ( report seq -- report )
- [ parse-remark ] map unwords >>remarks ;
+ [ parse-remark ] map join-words >>remarks ;
: <metar-report> ( metar -- report )
[ metar-report new ] dip [ >>raw ] keep
: <taf-report> ( taf -- report )
[ taf-report new ] dip [ >>raw ] keep
- lines [ [ blank? ] trim ] map
+ split-lines [ [ blank? ] trim ] map
rest dup first "TAF" = [ rest ] when
harvest unclip swapd taf-body swap taf-partials ;