packages feed

casa-abbreviations-and-acronyms 0.0.3 → 0.0.5

raw patch · 7 files changed

+58/−40 lines, 7 filesdep ~basedep ~these

Dependency ranges changed: base, these

Files

casa-abbreviations-and-acronyms.cabal view
@@ -1,12 +1,12 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                  casa-abbreviations-and-acronyms-version:               0.0.3+version:               0.0.5 synopsis:              CASA Abbreviations and Acronyms description:          <<http://i.imgur.com/uZnp9ke.png>>   .-  CASA Abbreviations and Acronym+  CASA Abbreviations and Acronyms   .   https://www.casa.gov.au/about-us/standard-page/aviation-abbreviations-and-acronyms license:               BSD3@@ -35,14 +35,14 @@                        , Data.Aviation.Casa.AbbreviationsAndAcronyms.Render.Spacing                        , Data.Aviation.Casa.AbbreviationsAndAcronyms.Search                        -  build-depends:         base              >= 4.8     && < 4.11+  build-depends:         base              >= 4.8     && < 4.12                        , lens              >= 4.15    && < 4.17                        , containers        >= 0.5     && < 0.6                        , fuzzy             >= 0.1.0.0 && < 0.2                        , monoid-subclasses >= 0.4     && < 0.5                        , wreq              >= 0.5     && < 0.6                        , bytestring        >= 0.10    && < 0.11-                       , these             >= 0.7     && < 0.8+                       , these             >= 0.7.4   && < 0.8    hs-source-dirs:      src/library @@ -57,7 +57,7 @@    main-is:             Main.hs -  build-depends:        base                 >= 4.8     && < 4.11                    +  build-depends:        base                 >= 4.8     && < 4.12                       , lens                 >= 4.15    && < 4.17                       , fuzzy                >= 0.1.0.0 && < 0.2                       , optparse-applicative >= 0.13.2  && < 0.15
changelog.md view
@@ -1,3 +1,15 @@+0.0.5++* Remove leading and trailing space from acronym parts.+* Fix bug with spacing.+* Fix bug with upper-case output on exact match.++0.0.4++* Make acronym name upper-case.+* base < 4.12.+* Fix some imports to work on newer GHC.+ 0.0.3  * Add -x|--max-results option.
src/executable/Main.hs view
@@ -6,9 +6,10 @@  import Control.Applicative((<*>), (<**>)) import Control.Category((.), id)-import Control.Lens((%~), lens)+import Control.Lens((%~), lens, (&)) import Data.Bool(bool)-import Data.Aviation.Casa.AbbreviationsAndAcronyms.Acronym(HasAcronym(acronym), Acronym)+import Data.Char(toUpper)+import Data.Aviation.Casa.AbbreviationsAndAcronyms.Acronym(HasAcronym(acronym), Acronym, name) import Data.Aviation.Casa.AbbreviationsAndAcronyms.Render(renderHeaderAcronyms, renderAcronyms) import Data.Aviation.Casa.AbbreviationsAndAcronyms.Render.Colours(Colours, standardColours) import Data.Aviation.Casa.AbbreviationsAndAcronyms.Render.Config(ConfigReader, Config(Config), runConfig)@@ -27,7 +28,7 @@ import Data.Ord(Ord((>=), (>)), max, min) import Data.Semigroup((<>)) import Data.String(String)-import Data.Traversable(Traversable)+import Data.Traversable(Traversable(traverse)) import Options.Applicative(Parser, execParser, info, helper, fullDesc, header, option, maybeReader, short, long, value, help, switch, strOption) import Prelude(Show(show)) import System.IO(IO, putStrLn)@@ -39,9 +40,9 @@ main =   let execopts =         execParser-          (info ((parserOptions :: Parser (Options [] ShowAcronym)) <**> helper) (+          (info (parserOptions <**> helper) (             fullDesc <>-            header "casa-abbreviations-and-acronyms for searching CASA abbreviations and acronyms 0.0.3 <https://www.casa.gov.au/about-us/standard-page/aviation-abbreviations-and-acronyms>"+            header "casa-abbreviations-and-acronyms for searching CASA abbreviations and acronyms 0.0.5 <https://www.casa.gov.au/about-us/standard-page/aviation-abbreviations-and-acronyms>"           )         )   in  do  opts <- execopts@@ -49,11 +50,12 @@             Options clrs rndr maxr (MatchField fz ex) typ (FieldSpacing mn xn mm xm ms xs mr xr) term ->               let acro =                     let match =-                          case typ of-                            ExactMatch ->-                              fmap (\a -> ShowAcronym a "-") . maybeToList . ex-                            InexactMatch x ->-                              fmap (\(Fuzzy o _ s) -> ShowAcronym o (show s)) . maybe id (\n -> filter (\(Fuzzy _ _ s) -> s >= n)) x . fz+                          fmap (\o -> (o & name . traverse %~ toUpper)) .+                            case typ of+                              ExactMatch ->+                                fmap (\a -> ShowAcronym a "-") . maybeToList . ex+                              InexactMatch x ->+                                fmap (\(Fuzzy o _ s) -> ShowAcronym o (show s)) . maybe id (\n -> filter (\(Fuzzy _ _ s) -> s >= n)) x . fz                     in  match term                   space =                     foldr
src/library/Data/Aviation/Casa/AbbreviationsAndAcronyms/Acronym.hs view
@@ -384,7 +384,7 @@       "Attorney-General's Department"       ""   , Acronym-      "AGL "+      "AGL"       "Above Ground Level"       "ICAO/AIP"   , Acronym@@ -445,7 +445,7 @@       "AIS"   , Acronym       "ALA"-      "Aircraft Landing Area "+      "Aircraft Landing Area"       "AIP"   , Acronym       "ALA"@@ -573,7 +573,7 @@       "ICAO"   , Acronym       "ANO"-      "Air Navigation Order "+      "Air Navigation Order"       ""   , Acronym       "ANS"@@ -1124,7 +1124,7 @@       "Civil Aviation Order"       ""   , Acronym-      "CAR "+      "CAR"       "Civil Aviation Regulations 1988"       ""   , Acronym@@ -1233,7 +1233,7 @@       "ICAO"   , Acronym       "CGL"-      " Circling guidance light(s)"+      "Circling guidance light(s)"       "ICAO"   , Acronym       "CH"@@ -1589,7 +1589,7 @@       "AIS"   , Acronym       "DE"-      "Form (used to preceed the call sign of the calling station) (to be used in AFS as a procedure signal)&lt;/em&gt;"+      "Form (used to preceed the call sign of the calling station) (to be used in AFS as a procedure signal)"       "ICAO/AIP"   , Acronym       "DEC"@@ -2006,7 +2006,7 @@   , Acronym       "EVU"       "Enforceable Voluntary Undertaking"-      "Civil Aviation Act 1988 "+      "Civil Aviation Act 1988"   , Acronym       "EXC"       "Except"@@ -2093,7 +2093,7 @@       "ICAO"   , Acronym       "FD"-      "Fault Detection "+      "Fault Detection"       ""   , Acronym       "FDE"@@ -2229,7 +2229,7 @@       "AIS"   , Acronym       "FPL"-      "Filed Flight Plan Message "+      "Filed Flight Plan Message"       "AIS"   , Acronym       "FPM"@@ -2449,7 +2449,7 @@       "AIS"   , Acronym       "GNSS"-      " Global navigation satellite system"+      "Global navigation satellite system"       "ICAO/AIP"   , Acronym       "GP"@@ -2672,7 +2672,7 @@       "Hold Short Lights"       "AIS"   , Acronym-      "HUD "+      "HUD"       "Head Up Display"       "AIS"   , Acronym@@ -3489,7 +3489,7 @@       "AIS"   , Acronym       "MPL"-      "Multi-crew Pilot Licence "+      "Multi-crew Pilot Licence"       "ATA/FAR"   , Acronym       "MPS"@@ -4013,12 +4013,12 @@       "CASA"   , Acronym       "OTAC"-      "Overseas Territories Aviation Circulars "-      "Air Safety Support International (UK) "+      "Overseas Territories Aviation Circulars"+      "Air Safety Support International (UK)"   , Acronym       "OTAR"       "Overseas Territories Aviation Requirements"-      "Air Safety Support International (UK) "+      "Air Safety Support International (UK)"   , Acronym       "OTLK"       "Outlook (used in Sigmet messages for volcanic ash and tropical cyclones)"@@ -4121,7 +4121,7 @@       "AIS"   , Acronym       "PDSE"-      "Pre-departure Service Check "+      "Pre-departure Service Check"       "CASR Part 144"   , Acronym       "PEC"@@ -4369,11 +4369,11 @@       "AIS"   , Acronym       "RA-Aus"-      "Recreational Aviation Australia "+      "Recreational Aviation Australia"       ""   , Acronym       "RAAA"-      "Recreational Aviation Association of Australia "+      "Recreational Aviation Association of Australia"       "AIS"   , Acronym       "RAAO"@@ -4781,7 +4781,7 @@       ""   , Acronym       "SARPs"-      "Standards and Recommended Practices "+      "Standards and Recommended Practices"       "ICAO"   , Acronym       "SARTIME"@@ -4981,7 +4981,7 @@       "CAR 1988"   , Acronym       "SOR"-      "Summary of responses "+      "Summary of responses"       "CAR 1998"   , Acronym       "SOT"
src/library/Data/Aviation/Casa/AbbreviationsAndAcronyms/Render.hs view
@@ -101,8 +101,10 @@                               a1 `k` a2)                   m                   n+              sep =+                chc (replicate shc '|')               spacers a1 a2 =-                a1 ++ chc (replicate shc '|') ++ a2+                a1 ++ sep ++ a2               column4 =                 let hn' =                       chn (replicate shn ' ')@@ -115,8 +117,8 @@                     column12 =                       alignWidth spacers (chn <$> name'') (chm <$> meaning'') hn' hm'                     column3 =-                      alignWidth spacers column12 (chs <$> source'') (hn' ++ hm') hs'-                in  alignWidth spacers column3 (chr <$> score'') (hn' ++ hm' ++ hs') hr'+                      alignWidth spacers column12 (chs <$> source'') (hn' ++ sep ++ hm') hs'+                in  alignWidth spacers column3 (chr <$> score'') (hn' ++ sep ++ hm' ++ sep ++ hs') hr'           pure (newlines column4)  renderAcronyms ::
src/library/Data/Aviation/Casa/AbbreviationsAndAcronyms/Render/Colours.hs view
@@ -19,7 +19,8 @@ import Control.Lens(Traversal', Lens') import Data.Functor(fmap, (<$>)) import Data.List((++))-import Data.Semigroup(Semigroup((<>)), Monoid(mappend, mempty))+import Data.Monoid(Monoid(mappend, mempty))+import Data.Semigroup(Semigroup((<>))) import Data.String(String)  data Colours =
src/library/Data/Aviation/Casa/AbbreviationsAndAcronyms/Render/Spacing.hs view
@@ -22,8 +22,9 @@ import Data.Function(($)) import Data.Functor(fmap) import Data.Int(Int)+import Data.Monoid(Monoid(mappend, mempty)) import Data.Ord(Ord, max, min)-import Data.Semigroup+import Data.Semigroup(Semigroup((<>))) import Data.String(String) import Prelude(Show)