-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Internal Phonetic Alphabet (IPA) -- -- See the README at https://gitlab.com/ngua/ipa-hs @package ipa @version 0.3.1 module Language.IPA.Types -- | Textual representation of a speech segment or grouping of segments, -- with zero or more articulatory features; encoded in IPA transcription. -- Note this has a Semigroup instance, so various IPAs can -- conveniently be concatenated with <> newtype IPA IPA :: Text -> IPA -- | The Text value should be normalized to NFC [unIPA] :: IPA -> Text -- | normalizes Text value to NFC before wrapping it -- in IPA. This is to ensure the comparability of IPA -- values mkIPA :: Text -> IPA -- | X-SAMPA is an ASCII encoding of the IPA (ca. 1993). Note that fewer -- transcriptions are possible using X-SAMPA than the IPA, so certain -- valid IPA Segments have no direct equivalence using -- XSampa. As with IPA, XSampa is an instance of -- Semigroup newtype XSampa XSampa :: Text -> XSampa -- | The wrapped Text should only contain ASCII characters [unXSampa] :: XSampa -> Text -- | Wraps a Text value in XSampa, provided the text only -- contains ASCII characters mkXSampa :: Text -> Maybe XSampa -- | A single segment, or combination of a segment and articulatory feature data Segment -- | Pulmonic and non-pulmonic consonants Consonant :: Consonant -> Segment -- | Monoph-, diph-, and triphthongs Vowel :: Vowel -> Segment -- | A null/zero phone Zero :: Segment -- | Various other articulatory features WithSegmentalFeature :: SegmentalFeature -> Segment -> Segment -- | A segment that is conventionally surrounded by parentheses. This is -- not an official part of the IPA, but is nevertheless encountered -- fairly frequently in IPA notation in the wild Optional :: Segment -> Segment -- | Pulmonic and non-pulmonic consonants data Consonant Pulmonic :: Phonation -> Place -> Manner -> Consonant Ejective :: Place -> Manner -> Consonant Implosive :: Phonation -> Place -> Consonant -- | PostAlveolar place represents a lateral click Click :: Place -> Consonant DoublyArticulated :: Phonation -> Place -> Place -> Manner -> Consonant pattern PulmonicConsonant :: Phonation -> Place -> Manner -> Segment pattern EjectiveConsonant :: Place -> Manner -> Segment pattern ClickConsonant :: Place -> Segment pattern ImplosiveConsonant :: Phonation -> Place -> Segment pattern DoublyArticulatedConsonant :: Phonation -> Place -> Place -> Manner -> Segment -- | Consonantal manner of articulation data Manner Nasal :: Manner Plosive :: Manner Fricative :: Sibilance -> Manner Affricate :: Sibilance -> Manner Approximant :: Manner Flap :: Manner Trill :: Manner LateralAffricate :: Manner LateralFricative :: Manner LateralApproximant :: Manner LateralFlap :: Manner -- | Consonantal place of articulation data Place Bilabial :: Place LabioDental :: Place LinguoLabial :: Place Dental :: Place Alveolar :: Place PostAlveolar :: Place Retroflex :: Place Palatal :: Place Velar :: Place Uvular :: Place Pharyngeal :: Place Glottal :: Place -- | Phonation (voicing) data Phonation Voiced :: Phonation Voiceless :: Phonation -- | Sibilance for fricative consonants data Sibilance Sibilant :: Sibilance NonSibilant :: Sibilance -- | Vowel type. Note that this type does not prevent the construction of -- nonsensical vowel values such as Diphthong (Diphthong ...) -- (Diphthong ...) data Vowel Pure :: Height -> Backness -> Roundedness -> Vowel Diphthongized :: Vowel -> Vowel -> Vowel Triphthongized :: Vowel -> Vowel -> Vowel -> Vowel pattern PureVowel :: Height -> Backness -> Roundedness -> Segment pattern Diphthong :: Vowel -> Vowel -> Segment pattern Triphthong :: Vowel -> Vowel -> Vowel -> Segment -- | Vowel height data Height Close :: Height NearClose :: Height CloseMid :: Height Mid :: Height OpenMid :: Height NearOpen :: Height Open :: Height -- | Vowel backness data Backness Front :: Backness NearFront :: Backness Central :: Backness NearBack :: Backness Back :: Backness -- | Vowel roundedness data Roundedness Rounded :: Roundedness Unrounded :: Roundedness -- | Constraint synonym for syllable containers type MultiSegment t = (Applicative t, Traversable t, Monoid (t Segment)) -- | Multiple segments, or combination of multiple segments with -- suprasegmental feature data Syllable t -- | A grouping of segments without extra suprasegmental information Syllable :: t Segment -> Syllable t -- | Articulatory features that affect/encompass the entire syllable WithSuprasegmentalFeature :: SuprasegmentalFeature -> Syllable t -> Syllable t data SuprasegmentalFeature -- | Level lexical tones in Chao letters LevelLexicalTone :: LevelTone -> SuprasegmentalFeature -- | Level lexical tones, diacritic. The tone is a combining character LevelLexicalToneDiacritic :: LevelTone -> SuprasegmentalFeature -- | Lexical tone contours in Chao letters LexicalToneContour :: ToneContour -> SuprasegmentalFeature -- | Lexical tone contours, as diacritics. Each contour is a combining -- character LexicalToneContourDiacritic :: ToneContour -> SuprasegmentalFeature ToneNumber :: Int -> SuprasegmentalFeature -- | Syllable stress Stress :: Stress -> SuprasegmentalFeature -- | Explicit syllable break Break :: SuprasegmentalFeature -- | Absence of a break Linking :: SuprasegmentalFeature -- | Lexical tone represented as a contour data ToneContour Rising :: ToneContour Falling :: ToneContour HighRising :: ToneContour LowRising :: ToneContour HighFalling :: ToneContour LowFalling :: ToneContour RisingFalling :: ToneContour FallingRising :: ToneContour GlobalRise :: ToneContour GlobalFall :: ToneContour -- | Lexical tone with Chao-style tone letters data LevelTone ExtraHighTone :: LevelTone HighTone :: LevelTone MidTone :: LevelTone LowTone :: LevelTone ExtraLowTone :: LevelTone DownStep :: LevelTone UpStep :: LevelTone data Stress Primary :: Stress Secondary :: Stress -- | Vowel length; also serves as a notation for consonant gemination in -- the IPA data Length OverLong :: Length HalfLong :: Length Long :: Length -- | The default/unmarked length; using this constructor doesn't affect the -- default IPA representation of the segment Short :: Length ExtraShort :: Length -- | Various articulatory features with a diacritic represenation in the -- IPA. These can be combined with Segments using the -- WithSegmentalFeature constructor of that type to produce a -- Segment annotated with a given articulatory feature, e.g.: -- --
--   >>> toIPA $ WithSegmentalFeature (Length Long) (Vowel Close Front Unrounded)
--   Just (IPA "i\720") -- iː
--   
data SegmentalFeature Voicing :: Phonation -> SegmentalFeature Length :: Length -> SegmentalFeature SecondaryArticulation :: Segment -> SegmentalFeature Aspirated :: SegmentalFeature MoreRounded :: SegmentalFeature LessRounded :: SegmentalFeature Advanced :: SegmentalFeature Retracted :: SegmentalFeature Centralized :: SegmentalFeature MidCentralized :: SegmentalFeature Compressed :: SegmentalFeature Syllabic :: SegmentalFeature NonSyllabic :: SegmentalFeature Rhotacized :: SegmentalFeature BreathyVoice :: SegmentalFeature CreakyVoice :: SegmentalFeature LinguoLabialized :: SegmentalFeature Labialized :: SegmentalFeature Palatalized :: SegmentalFeature Velarized :: SegmentalFeature Pharyngealized :: SegmentalFeature Raised :: SegmentalFeature Lowered :: SegmentalFeature AdvancedTongueRoot :: SegmentalFeature RetractedTongueRoot :: SegmentalFeature Dentalized :: SegmentalFeature Apical :: SegmentalFeature Laminal :: SegmentalFeature Nasalized :: SegmentalFeature NasalRelease :: SegmentalFeature LateralRelease :: SegmentalFeature NoAudibleRelease :: SegmentalFeature -- | Transcription delimiters/brackets data Delimiter -- | Actual pronunciation, transcribed with square brackets, [ .. ] Phonetic :: Delimiter -- | Abstract phonemic representation, transcribed with slashes, / .. / Phonemic :: Delimiter data IPAException InvalidIPA :: Text -> IPAException InvalidXSampa :: Text -> IPAException instance GHC.Base.Semigroup Language.IPA.Types.IPA instance GHC.Generics.Generic Language.IPA.Types.IPA instance GHC.Classes.Eq Language.IPA.Types.IPA instance GHC.Show.Show Language.IPA.Types.IPA instance GHC.Base.Semigroup Language.IPA.Types.XSampa instance GHC.Generics.Generic Language.IPA.Types.XSampa instance GHC.Classes.Eq Language.IPA.Types.XSampa instance GHC.Show.Show Language.IPA.Types.XSampa instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Place instance Data.Data.Data Language.IPA.Types.Place instance GHC.Classes.Ord Language.IPA.Types.Place instance GHC.Generics.Generic Language.IPA.Types.Place instance GHC.Classes.Eq Language.IPA.Types.Place instance GHC.Show.Show Language.IPA.Types.Place instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Phonation instance Data.Data.Data Language.IPA.Types.Phonation instance GHC.Generics.Generic Language.IPA.Types.Phonation instance GHC.Classes.Eq Language.IPA.Types.Phonation instance GHC.Show.Show Language.IPA.Types.Phonation instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Sibilance instance Data.Data.Data Language.IPA.Types.Sibilance instance GHC.Generics.Generic Language.IPA.Types.Sibilance instance GHC.Classes.Eq Language.IPA.Types.Sibilance instance GHC.Show.Show Language.IPA.Types.Sibilance instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Manner instance Data.Data.Data Language.IPA.Types.Manner instance GHC.Generics.Generic Language.IPA.Types.Manner instance GHC.Classes.Eq Language.IPA.Types.Manner instance GHC.Show.Show Language.IPA.Types.Manner instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Consonant instance Data.Data.Data Language.IPA.Types.Consonant instance GHC.Generics.Generic Language.IPA.Types.Consonant instance GHC.Classes.Eq Language.IPA.Types.Consonant instance GHC.Show.Show Language.IPA.Types.Consonant instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Height instance Data.Data.Data Language.IPA.Types.Height instance GHC.Generics.Generic Language.IPA.Types.Height instance GHC.Classes.Eq Language.IPA.Types.Height instance GHC.Show.Show Language.IPA.Types.Height instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Backness instance Data.Data.Data Language.IPA.Types.Backness instance GHC.Classes.Ord Language.IPA.Types.Backness instance GHC.Generics.Generic Language.IPA.Types.Backness instance GHC.Classes.Eq Language.IPA.Types.Backness instance GHC.Show.Show Language.IPA.Types.Backness instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Roundedness instance Data.Data.Data Language.IPA.Types.Roundedness instance GHC.Generics.Generic Language.IPA.Types.Roundedness instance GHC.Classes.Eq Language.IPA.Types.Roundedness instance GHC.Show.Show Language.IPA.Types.Roundedness instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Vowel instance Data.Data.Data Language.IPA.Types.Vowel instance GHC.Generics.Generic Language.IPA.Types.Vowel instance GHC.Classes.Eq Language.IPA.Types.Vowel instance GHC.Show.Show Language.IPA.Types.Vowel instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.LevelTone instance Data.Data.Data Language.IPA.Types.LevelTone instance GHC.Classes.Ord Language.IPA.Types.LevelTone instance GHC.Generics.Generic Language.IPA.Types.LevelTone instance GHC.Classes.Eq Language.IPA.Types.LevelTone instance GHC.Show.Show Language.IPA.Types.LevelTone instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.ToneContour instance Data.Data.Data Language.IPA.Types.ToneContour instance GHC.Classes.Ord Language.IPA.Types.ToneContour instance GHC.Generics.Generic Language.IPA.Types.ToneContour instance GHC.Classes.Eq Language.IPA.Types.ToneContour instance GHC.Show.Show Language.IPA.Types.ToneContour instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Length instance Data.Data.Data Language.IPA.Types.Length instance GHC.Classes.Ord Language.IPA.Types.Length instance GHC.Generics.Generic Language.IPA.Types.Length instance GHC.Classes.Eq Language.IPA.Types.Length instance GHC.Show.Show Language.IPA.Types.Length instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Segment instance Data.Data.Data Language.IPA.Types.Segment instance GHC.Generics.Generic Language.IPA.Types.Segment instance GHC.Classes.Eq Language.IPA.Types.Segment instance GHC.Show.Show Language.IPA.Types.Segment instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.SegmentalFeature instance Data.Data.Data Language.IPA.Types.SegmentalFeature instance GHC.Generics.Generic Language.IPA.Types.SegmentalFeature instance GHC.Classes.Eq Language.IPA.Types.SegmentalFeature instance GHC.Show.Show Language.IPA.Types.SegmentalFeature instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.Stress instance Data.Data.Data Language.IPA.Types.Stress instance GHC.Classes.Ord Language.IPA.Types.Stress instance GHC.Generics.Generic Language.IPA.Types.Stress instance GHC.Classes.Eq Language.IPA.Types.Stress instance GHC.Show.Show Language.IPA.Types.Stress instance Language.Haskell.TH.Syntax.Lift Language.IPA.Types.SuprasegmentalFeature instance Data.Data.Data Language.IPA.Types.SuprasegmentalFeature instance GHC.Generics.Generic Language.IPA.Types.SuprasegmentalFeature instance GHC.Classes.Eq Language.IPA.Types.SuprasegmentalFeature instance GHC.Show.Show Language.IPA.Types.SuprasegmentalFeature instance GHC.Generics.Generic (Language.IPA.Types.Syllable t) instance GHC.Generics.Generic Language.IPA.Types.Delimiter instance GHC.Classes.Eq Language.IPA.Types.Delimiter instance GHC.Show.Show Language.IPA.Types.Delimiter instance GHC.Generics.Generic Language.IPA.Types.IPAException instance GHC.Classes.Eq Language.IPA.Types.IPAException instance GHC.Show.Show Language.IPA.Types.IPAException instance GHC.Show.Show (t Language.IPA.Types.Segment) => GHC.Show.Show (Language.IPA.Types.Syllable t) instance GHC.Classes.Eq (t Language.IPA.Types.Segment) => GHC.Classes.Eq (Language.IPA.Types.Syllable t) instance (Data.Data.Data (t Language.IPA.Types.Segment), Data.Typeable.Internal.Typeable t) => Data.Data.Data (Language.IPA.Types.Syllable t) instance Language.Haskell.TH.Syntax.Lift (t Language.IPA.Types.Segment) => Language.Haskell.TH.Syntax.Lift (Language.IPA.Types.Syllable t) instance GHC.Exception.Type.Exception Language.IPA.Types.IPAException -- | Parser for IPA literals module Language.IPA.Parser -- | Parse a single literal segment in IPA notation, returning -- InvalidIPA upon failure and a Segment upon success. Note -- that supplying two or more segment literals will cause the parse to -- fail -- --
--   >>> parseSegment "ɨːː"
--   Right (WithSegmentalFeature (Length OverLong) (Vowel Close Central Unrounded))
--   
-- --
--   >>> parseSegment "ɨːːb"
--   Left (InvalidIPA "Failed to parse character 'b'")
--   
parseSegment :: Text -> Either IPAException Segment -- | Parser for segments. This function is exposed to allow users to create -- more specific parsers for multi-segment sequences segmentP :: Parser Segment -- | Parse a literal syllable in IPA notation, returning InvalidIPA -- upon failure and a Syllable upon success, where the syllable is -- parameterized by some type t satisfying a MultiSegment -- constraint. Note that, as with parseSegment, supplying two or -- more syllable literals will cause the parse to fail -- --
--   >>> parseSyllable @[] "ma˧˥"
--   Right (WithSuprasegmentalFeature (LexicalToneContour HighRising)
--         (Syllable [Consonant (Pulmonic Voiced Bilabial Nasal),Vowel Open Front Unrounded]))
--   
parseSyllable :: MultiSegment t => Text -> Either IPAException (Syllable t) -- | Parser for syllables. This function is exposed to allow users to -- create more specific parsers for aggregations of multiple syllables syllableP :: MultiSegment t => Parser (Syllable t) -- | Parse several syllables into a container parameterized by the same -- type as that parameterizing the individual Syllables. -- Whitespace between syllables is interpreted as a syllable boundary -- --
--   >>> parseSyllables @[] "haːj˧ ɓaː˧"
--   Right [ WithSuprasegmentalFeature (LevelLexicalTone MidTone)
--             (Syllable [ Consonant (Pulmonic Voiceless Glottal (Fricative NonSibilant))
--                       , WithSegmentalFeature (Length Long) (Vowel Open Front Unrounded)
--                       , Consonant (Pulmonic Voiced Palatal Approximant)
--                       ])
--         , WithSuprasegmentalFeature (LevelLexicalTone MidTone)
--             (Syllable [ Consonant (Implosive Voiced Bilabial)
--                       , WithSegmentalFeature (Length Long) (Vowel Open Front Unrounded)
--                       ])
--         ]
--   
parseSyllables :: (MultiSegment t, Monoid (t (Syllable t))) => Text -> Either IPAException (t (Syllable t)) -- | Parser for poly-syllabic sequences, with individual syllables -- separated by (optional) whitespace syllablesP :: (MultiSegment t, Monoid (t (Syllable t))) => Parser (t (Syllable t)) -- | As parseSegment, but in X-SAMPA notation parseSegmentXSampa :: Text -> Either IPAException Segment -- | As segmentP, but in X-SAMPA notation segmentXSampaP :: Parser Segment -- | As parseSyllable, but in X-SAMPA notation parseSyllableXSampa :: MultiSegment t => Text -> Either IPAException (Syllable t) -- | As parseSyllables, but in X-SAMPA notation parseSyllablesXSampa :: (MultiSegment t, Monoid (t (Syllable t))) => Text -> Either IPAException (t (Syllable t)) -- | As syllableP, but in X-SAMPA notation syllableXSampaP :: MultiSegment t => Parser (Syllable t) module Language.IPA.QQ -- | Construct a compile-time Syllable using IPA notation -- --
--   >>> [syllable|ɣa˧˨|]
--   WithSuprasegmentalFeature (LexicalToneContour LowFalling)
--     (Syllable [ Consonant (Pulmonic Voiced Velar (Fricative NonSibilant))
--               , Vowel (Pure Open Front Unrounded)
--               ])
--   
syllable :: QuasiQuoter -- | Construct a compile-time Segment using IPA notation -- --
--   >>> [segment|ɣ|]
--   Consonant (Pulmonic Voiced Velar (Fricative NonSibilant))
--   
segment :: QuasiQuoter -- | Construct a compile-time [Syllable] using IPA notation syllables :: QuasiQuoter -- | Construct a compile-time Segment using X-SAMPA notation. This -- may be more convenient than using text values - X-SAMPA inexplicably -- chose to use backslashes as semantic tokens, which of course must be -- escaped -- --
--   >>> [segmentXS|?\|]
--   Consonant (Pulmonic Voiced Pharyngeal (Fricative NonSibilant))
--   
segmentXS :: QuasiQuoter -- | Construct a compile-time Syllable using X-SAMPA notation syllableXS :: QuasiQuoter -- | Construct a compile-time [Syllable] using X-SAMPA -- notation syllablesXS :: QuasiQuoter -- | Typeclass for representing speech sounds in IPA/X-Sampa notation module Language.IPA.Class -- | Entities representable through IPA transcription class ReprIPA a -- | Produces an IPA transcription given a valid Segment; a -- result of Nothing indicates either an unattested-yet-possible -- segment, or one considered impossible toIPA :: ReprIPA a => a -> Maybe IPA -- | Parse text in IPA notation parseIPA :: ReprIPA a => Text -> Either IPAException a -- | Entities representable through X-SAMPA transcription, an ASCII subset -- of the IPA class ReprXSampa a -- | Similar to toIPA; produces an XSampa transcription given -- a valid Segment. toXSampa :: ReprXSampa a => a -> Maybe XSampa -- | Parse text in X-SAMPA notation parseXSampa :: ReprXSampa a => Text -> Either IPAException a instance Language.IPA.Types.MultiSegment t => Language.IPA.Class.ReprXSampa (Language.IPA.Types.Syllable t) instance Language.IPA.Class.ReprXSampa Language.IPA.Types.Segment instance Language.IPA.Types.MultiSegment t => Language.IPA.Class.ReprIPA (Language.IPA.Types.Syllable t) instance Language.IPA.Class.ReprIPA Language.IPA.Types.Segment -- | Working with IPA/X-SAMPA transcriptions and phonetic/phonemic values module Language.IPA -- | "Transcribe" an IPA value by wrapping it in a Delimiter -- --
--   >>> s = PulmonicConsonant Voiced Dental (Fricative NonSibilant)
--   
--   >>> transcribe Phonemic <$> toIPA s
--   Just "/ð/"
--   
transcribe :: Delimiter -> IPA -> Text -- | As transcribe, for XSampa values transcribeXSampa :: Delimiter -> XSampa -> Text -- | Convert an IPA value to its equivalent in XSampa; note -- that several features and segments that can be transcribed in IPA -- notation are missing from X-SAMPA ipaToXSampa :: IPA -> Maybe XSampa -- | Convert an XSampa value to its equivalent in IPA xSampaToIpa :: XSampa -> Maybe IPA -- | Partial function for creating an IPA. Useful if you are certain -- that the sound in question is representable toIPA' :: ReprIPA a => a -> IPA -- | Partial function for creating an XSampa. NB: Certain segments -- that have a defined IPA representation have no XSampa -- equivalent toXSampa' :: ReprXSampa a => a -> XSampa -- | Does a text value in IPA notation represent a valid instance of -- ReprIPA? Note that you will need -XTypeApplications to -- use this, and that this just calls parseIPA to determine -- validity -- --
--   >>> isValid @Segment "L"
--   False
--   
--   >>> isValid @Segment "ʟ"
--   True
--   
isValid :: forall a. ReprIPA a => Text -> Bool -- | Does a text value represent valid individual IPA Segment? isValidSegment :: Text -> Bool -- | Is a text value a valid IPA Syllable? isValidSyllable :: Text -> Bool -- | Tests if a Segment is obstruent, i.e. formed by obstructing -- airflow isObstruent :: Segment -> Bool -- | Tests if Segment is sonorant, i.e. if it is created with an -- uninterrupted flow of air isSonorant :: Segment -> Bool -- | Tests pulmonic Consonant membership in the labial category, -- whose active articulator is one or both lips isLabial :: Consonant -> Bool -- | Tests pulmonic Consonant membership in the coronal class, whose -- active articulator is the front of the tongue isCoronal :: Consonant -> Bool -- | Tests pulmonic Consonant membership in the dorsal class, whose -- active articulator is the dorsum (back of the tongue) isDorsal :: Consonant -> Bool -- | Tests pulmonic Consonant membership in the laryngeal class, -- whose active articulator is the larynx isLaryngeal :: Consonant -> Bool -- | Tests if Consonant is rhotic, a vague category of R-like sounds -- typically represented lexicographically by some variant of the Latin -- letter r isRhotic :: Consonant -> Bool -- | Tests if a Consonant is liquid, a category of rhotics and -- voiced lateral approximants isLiquid :: Consonant -> Bool