{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data PartOfSpeechTag = PartOfSpeechTag'
{
PartOfSpeechTag -> Maybe Double
score :: Prelude.Maybe Prelude.Double,
PartOfSpeechTag -> Maybe PartOfSpeechTagType
tag :: Prelude.Maybe PartOfSpeechTagType
}
deriving (PartOfSpeechTag -> PartOfSpeechTag -> Bool
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]
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
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. 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'
{ $sel:score:PartOfSpeechTag' :: Maybe Double
score = forall a. Maybe a
Prelude.Nothing,
$sel:tag:PartOfSpeechTag' :: Maybe PartOfSpeechTagType
tag = forall a. Maybe a
Prelude.Nothing
}
partOfSpeechTag_score :: Lens.Lens' PartOfSpeechTag (Prelude.Maybe Prelude.Double)
partOfSpeechTag_score :: Lens' PartOfSpeechTag (Maybe Double)
partOfSpeechTag_score = 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)
partOfSpeechTag_tag :: Lens.Lens' PartOfSpeechTag (Prelude.Maybe PartOfSpeechTagType)
partOfSpeechTag_tag :: Lens' PartOfSpeechTag (Maybe PartOfSpeechTagType)
partOfSpeechTag_tag = 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)
instance Data.FromJSON PartOfSpeechTag where
parseJSON :: Value -> Parser PartOfSpeechTag
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PartOfSpeechTag"
( \Object
x ->
Maybe Double -> Maybe PartOfSpeechTagType -> PartOfSpeechTag
PartOfSpeechTag'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Score")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Tag")
)
instance Prelude.Hashable PartOfSpeechTag where
hashWithSalt :: Int -> PartOfSpeechTag -> Int
hashWithSalt Int
_salt PartOfSpeechTag' {Maybe Double
Maybe PartOfSpeechTagType
tag :: Maybe PartOfSpeechTagType
score :: Maybe Double
$sel:tag:PartOfSpeechTag' :: PartOfSpeechTag -> Maybe PartOfSpeechTagType
$sel:score:PartOfSpeechTag' :: PartOfSpeechTag -> Maybe Double
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
score
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PartOfSpeechTagType
tag
instance Prelude.NFData PartOfSpeechTag where
rnf :: PartOfSpeechTag -> ()
rnf PartOfSpeechTag' {Maybe Double
Maybe PartOfSpeechTagType
tag :: Maybe PartOfSpeechTagType
score :: Maybe Double
$sel:tag:PartOfSpeechTag' :: PartOfSpeechTag -> Maybe PartOfSpeechTagType
$sel:score:PartOfSpeechTag' :: PartOfSpeechTag -> Maybe Double
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
score seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PartOfSpeechTagType
tag