Handbook
Glossary
parse-remark ( str -- str' )
Vocabulary
metar
.
private
Inputs
str
an
object
Outputs
str'
an
object
Definition
USING:
assocs
combinators
kernel
regexp
;
IN:
metar.private
:
parse-remark
( str -- str' )
{
{
[
dup
glossary
key?
]
[
glossary
at
]
}
{
[
dup
R/ 1\d{4}/
matches?
]
[
parse-6hr-max-temp
]
}
{
[
dup
R/ 2\d{4}/
matches?
]
[
parse-6hr-min-temp
]
}
{
[
dup
R/ 4\d{8}/
matches?
]
[
parse-24hr-temp
]
}
{
[
dup
R/ 4\/\d{3}/
matches?
]
[
parse-snow-depth
]
}
{
[
dup
R/ 5\d{4}/
matches?
]
[
parse-1hr-pressure
]
}
{
[
dup
R/ 6[\d\/]{4}/
matches?
]
[
parse-6hr-precipitation
]
}
{
[
dup
R/ 7\d{4}/
matches?
]
[
parse-24hr-precipitation
]
}
{
[
dup
R/ 8\/\d{3}/
matches?
]
[
parse-cloud-cover
]
}
{
[
dup
R/ 931\d{3}/
matches?
]
[
parse-6hr-snowfall
]
}
{
[
dup
R/ 933\d{3}/
matches?
]
[
parse-water-equivalent-snow
]
}
{
[
dup
R/ 98\d{3}/
matches?
]
[
parse-duration-of-sunshine
]
}
{
[
dup
R/ T\d{4,8}/
matches?
]
[
parse-1hr-temp
]
}
{
[
dup
R/ \d{3}\d{2,3}\/\d{2,4}/
matches?
]
[
parse-peak-wind
]
}
{
[
dup
R/ P\d{4}/
matches?
]
[
parse-1hr-precipitation
]
}
{
[
dup
R/ SLP\d{3}/
matches?
]
[
parse-sea-level-pressure
]
}
{
[
dup
R/ LTG\w+/
matches?
]
[
parse-lightning
]
}
{
[
dup
R/ PROB\d+/
matches?
]
[
parse-probability
]
}
{
[
dup
R/ \d{3}V\d{3}/
matches?
]
[
parse-varying
]
}
{
[
dup
R/ [^-]+(-[^-]+)+/
matches?
]
[
parse-from-to
]
}
{
[
dup
R/ [^\/]+(\/[^\/]+)+/
matches?
]
[
]
}
{
[
dup
R/ \d+.\d+/
matches?
]
[
]
}
{
[
dup
re-recent-weather
matches?
]
[
parse-recent-weather
]
}
{
[
dup
re-weather
matches?
]
[
parse-weather
]
}
{
[
dup
re-sky-condition
matches?
]
[
parse-sky-condition
]
}
[
parse-glossary
]
}
cond
;