Fixed bug in template. Fixes #20.

This commit is contained in:
John Wiseman 2020-02-04 17:35:08 -08:00
parent 159e74b748
commit 8e88b8771f

View File

@ -265,19 +265,43 @@
(def description-templates
(map generation/parse-template
[(str "[{registration}|{registration}, {type|a-an},|{militaryregistration}, a military aircraft,|"
"{militaryregistration}, a military {type},|"
"Aircraft with unknown registration, ICAO {icao}|"
"{type} with unknown registration, ICAO {icao}"
"Military aircraft with unknown registration, ICAO {militaryicao}] "
"?:[(callsign {callsign}) ]"
"is circling over [{neighbourhood}, {locality}|{neighbourhood}, {county}|{locality}] "
"?:[at {alt} feet, ]"
"?:[speed {speed} MPH, ]"
"?:[squawking {squawk}, ]"
"?:[{nearbydistance} miles from {nearbylandmark} ]"
"?:[#{registration} |#{militaryregistration} ]"
"https://tar1090.adsbexchange.com/?icao={icao}&zoom=13")]))
[(str
"["
;; BEGIN identity & type group. We choose one of the following:
;;
;; 1. Civilian registration w/o type.
"{registration}|"
;; 2. Civilian registration w/ type.
"{registration}, {type|a-an},|"
;; Military registration w/o type.
"{militaryregistration}, a military aircraft,|"
;; Military registration w/ type.
"{militaryregistration}, a military {type},|"
;; Civilian w/ unknown registration, and don't have type.
"Aircraft with unknown registration, ICAO {icao}|"
;; Civilian w/ unknown registration, and have type.
"{type} with unknown registration, ICAO {icao}|"
;; Military with unknown registration.
"Military aircraft with unknown registration, ICAO {militaryicao}"
;; END identity & type group.
"] "
;; Callsign.
"?:[(callsign {callsign}) ]"
;; Ideally neighbourhood as well as city or county, but
;; maybe just city.
"is circling over [{neighbourhood}, {locality}|{neighbourhood}, {county}|{locality}] "
;; Altitude.
"?:[at {alt} feet, ]"
;; Speed;
"?:[speed {speed} MPH, ]"
;; Transponder squawk.
"?:[squawking {squawk}, ]"
;; Landmark.
"?:[{nearbydistance} miles from {nearbylandmark} ]"
;; Hashtag based on registration.
"?:[#{registration} |#{militaryregistration} ]"
;; tar1090 link.
"https://tar1090.adsbexchange.com/?icao={icao}&zoom=13")]))
(defn expand-template [data]