{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Comprehend.Types.PartOfSpeechTag where
import Amazonka.Comprehend.Types.PartOfSpeechTagType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PartOfSpeechTag = PartOfSpeechTag'
{
PartOfSpeechTag -> Maybe PartOfSpeechTagType
tag :: Prelude.Maybe PartOfSpeechTagType,
PartOfSpeechTag -> Maybe Double
score :: Prelude.Maybe Prelude.Double
}
deriving (PartOfSpeechTag -> PartOfSpeechTag -> Bool
(PartOfSpeechTag -> PartOfSpeechTag -> Bool)
-> (PartOfSpeechTag -> PartOfSpeechTag -> Bool)
-> Eq PartOfSpeechTag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PartOfSpeechTag -> PartOfSpeechTag -> Bool
$c/= :: PartOfSpeechTag -> PartOfSpeechTag -> Bool
== :: PartOfSpeechTag -> PartOfSpeechTag -> Bool
$c== :: PartOfSpeechTag -> PartOfSpeechTag -> Bool
Prelude.Eq, ReadPrec [PartOfSpeechTag]
ReadPrec PartOfSpeechTag
Int -> ReadS PartOfSpeechTag
ReadS [PartOfSpeechTag]
(Int -> ReadS PartOfSpeechTag)
-> ReadS [PartOfSpeechTag]
-> ReadPrec PartOfSpeechTag
-> ReadPrec [PartOfSpeechTag]
-> Read PartOfSpeechTag
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PartOfSpeechTag]
$creadListPrec :: ReadPrec [PartOfSpeechTag]
readPrec :: ReadPrec PartOfSpeechTag
$creadPrec :: ReadPrec PartOfSpeechTag
readList :: ReadS [PartOfSpeechTag]
$creadList :: ReadS [PartOfSpeechTag]
readsPrec :: Int -> ReadS PartOfSpeechTag
$creadsPrec :: Int -> ReadS PartOfSpeechTag
Prelude.Read, Int -> PartOfSpeechTag -> ShowS
[PartOfSpeechTag] -> ShowS
PartOfSpeechTag -> String
(Int -> PartOfSpeechTag -> ShowS)
-> (PartOfSpeechTag -> String)
-> ([PartOfSpeechTag] -> ShowS)
-> Show PartOfSpeechTag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PartOfSpeechTag] -> ShowS
$cshowList :: [PartOfSpeechTag] -> ShowS
show :: PartOfSpeechTag -> String
$cshow :: PartOfSpeechTag -> String
showsPrec :: Int -> PartOfSpeechTag -> ShowS
$cshowsPrec :: Int -> PartOfSpeechTag -> ShowS
Prelude.Show, (forall x. PartOfSpeechTag -> Rep PartOfSpeechTag x)
-> (forall x. Rep PartOfSpeechTag x -> PartOfSpeechTag)
-> Generic PartOfSpeechTag
forall x. Rep PartOfSpeechTag x -> PartOfSpeechTag
forall x. PartOfSpeechTag -> Rep PartOfSpeechTag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PartOfSpeechTag x -> PartOfSpeechTag
$cfrom :: forall x. PartOfSpeechTag -> Rep PartOfSpeechTag x
Prelude.Generic)
newPartOfSpeechTag ::
PartOfSpeechTag
newPartOfSpeechTag :: PartOfSpeechTag
newPartOfSpeechTag =
PartOfSpeechTag' :: Maybe PartOfSpeechTagType -> Maybe Double -> PartOfSpeechTag
PartOfSpeechTag'
{ $sel:tag:PartOfSpeechTag' :: Maybe PartOfSpeechTagType
tag = Maybe PartOfSpeechTagType
forall a. Maybe a
Prelude.Nothing,
$sel:score:PartOfSpeechTag' :: Maybe Double
score = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
partOfSpeechTag_tag :: Lens.Lens' PartOfSpeechTag (Prelude.Maybe PartOfSpeechTagType)
partOfSpeechTag_tag :: (Maybe PartOfSpeechTagType -> f (Maybe PartOfSpeechTagType))
-> PartOfSpeechTag -> f PartOfSpeechTag
partOfSpeechTag_tag = (PartOfSpeechTag -> Maybe PartOfSpeechTagType)
-> (PartOfSpeechTag
-> Maybe PartOfSpeechTagType -> PartOfSpeechTag)
-> Lens
PartOfSpeechTag
PartOfSpeechTag
(Maybe PartOfSpeechTagType)
(Maybe PartOfSpeechTagType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartOfSpeechTag' {Maybe PartOfSpeechTagType
tag :: Maybe PartOfSpeechTagType
$sel:tag:PartOfSpeechTag' :: PartOfSpeechTag -> Maybe PartOfSpeechTagType
tag} -> Maybe PartOfSpeechTagType
tag) (\s :: PartOfSpeechTag
s@PartOfSpeechTag' {} Maybe PartOfSpeechTagType
a -> PartOfSpeechTag
s {$sel:tag:PartOfSpeechTag' :: Maybe PartOfSpeechTagType
tag = Maybe PartOfSpeechTagType
a} :: PartOfSpeechTag)
partOfSpeechTag_score :: Lens.Lens' PartOfSpeechTag (Prelude.Maybe Prelude.Double)
partOfSpeechTag_score :: (Maybe Double -> f (Maybe Double))
-> PartOfSpeechTag -> f PartOfSpeechTag
partOfSpeechTag_score = (PartOfSpeechTag -> Maybe Double)
-> (PartOfSpeechTag -> Maybe Double -> PartOfSpeechTag)
-> Lens
PartOfSpeechTag PartOfSpeechTag (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartOfSpeechTag' {Maybe Double
score :: Maybe Double
$sel:score:PartOfSpeechTag' :: PartOfSpeechTag -> Maybe Double
score} -> Maybe Double
score) (\s :: PartOfSpeechTag
s@PartOfSpeechTag' {} Maybe Double
a -> PartOfSpeechTag
s {$sel:score:PartOfSpeechTag' :: Maybe Double
score = Maybe Double
a} :: PartOfSpeechTag)
instance Core.FromJSON PartOfSpeechTag where
parseJSON :: Value -> Parser PartOfSpeechTag
parseJSON =
String
-> (Object -> Parser PartOfSpeechTag)
-> Value
-> Parser PartOfSpeechTag
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PartOfSpeechTag"
( \Object
x ->
Maybe PartOfSpeechTagType -> Maybe Double -> PartOfSpeechTag
PartOfSpeechTag'
(Maybe PartOfSpeechTagType -> Maybe Double -> PartOfSpeechTag)
-> Parser (Maybe PartOfSpeechTagType)
-> Parser (Maybe Double -> PartOfSpeechTag)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe PartOfSpeechTagType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tag") Parser (Maybe Double -> PartOfSpeechTag)
-> Parser (Maybe Double) -> Parser PartOfSpeechTag
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Score")
)
instance Prelude.Hashable PartOfSpeechTag
instance Prelude.NFData PartOfSpeechTag