ordinal 0.2.0.0 → 0.3.0.0
raw patch · 15 files changed
+1456/−36 lines, 15 filesdep +data-defaultPVP ok
version bump matches the API change (PVP)
Dependencies added: data-default
API changes (from Hackage documentation)
+ Text.Numerals.Algorithm: instance Data.Default.Class.Default Text.Numerals.Algorithm.HighNumberAlgorithm
+ Text.Numerals.Class: ShortOrdinal :: NumberType
+ Text.Numerals.Class: instance Data.Default.Class.Default Text.Numerals.Class.NumberType
+ Text.Numerals.Class: instance GHC.Read.Read Text.Numerals.Class.NumberType
+ Text.Numerals.Class: instance GHC.Show.Show Text.Numerals.Class.NumberType
+ Text.Numerals.Class: toShortOrdinal :: (NumToWord a, Integral i) => a -> i -> Text
+ Text.Numerals.Class: type FreeNumberToWords = forall i. Integral i => NumberToWords i
- Text.Numerals.Algorithm: numeralsAlgorithm :: (Foldable f, Foldable g) => Text -> Text -> Text -> f Text -> g (Integer, Text) -> FreeValueSplitter -> FreeMergerFunction -> (Text -> Text) -> NumeralsAlgorithm
+ Text.Numerals.Algorithm: numeralsAlgorithm :: (Foldable f, Foldable g) => Text -> Text -> Text -> f Text -> g (Integer, Text) -> FreeValueSplitter -> FreeMergerFunction -> (Text -> Text) -> FreeNumberToWords -> NumeralsAlgorithm
Files
- CHANGELOG.md +5/−0
- README.md +5/−3
- ordinal.cabal +2/−1
- src/Text/Numerals/Algorithm.hs +18/−5
- src/Text/Numerals/Class.hs +34/−6
- src/Text/Numerals/Internal.hs +15/−0
- src/Text/Numerals/Languages/Dutch.hs +9/−3
- src/Text/Numerals/Languages/English.hs +19/−5
- src/Text/Numerals/Languages/French.hs +9/−3
- src/Text/Numerals/Languages/German.hs +9/−3
- test/Text/Numerals/LanguageTest.hs +19/−3
- test/Text/Numerals/Languages/DutchSpec.hs +328/−1
- test/Text/Numerals/Languages/EnglishSpec.hs +328/−1
- test/Text/Numerals/Languages/FrenchSpec.hs +328/−1
- test/Text/Numerals/Languages/GermanSpec.hs +328/−1
CHANGELOG.md view
@@ -2,6 +2,11 @@ For a full list of changes, see the history on [GitHub](https://github.com/hapytex/ordinal). +## Version 0.3.0.0++Add support for short ordinal numbers and make `NumberType` and `HighNumberAlgorithm`+an instance of `Default`.+ ## Version 0.2.0.0 Added support for the *German* language.
README.md view
@@ -19,15 +19,17 @@ ## Usage -One can import the `Text.Numerals` module, and use the `toCardinal`-and `toOrdinal` functions with a number-to-word algorithm that is exported by-the `Text.Numerals.Languages` module, for example:+One can import the `Text.Numerals` module, and use the `toCardinal`,+`toOrdinal` and `toShortOrdinal` functions with a number-to-word+algorithm that is exported by the `Text.Numerals.Languages` module, for example: ``` Prelude Text.Numerals Data.Text.IO> Data.Text.IO.putStrLn (toCardinal english 42) forty-two Prelude Text.Numerals Data.Text.IO> Data.Text.IO.putStrLn (toOrdinal french 42) quarante-deuxième+Prelude Text.Numerals Data.Text.IO> Data.Text.IO.putStrLn (toShortOrdinal dutch 42)+42e ``` One can also define a language algorithm themselves, for this one can look at
ordinal.cabal view
@@ -1,5 +1,5 @@ name: ordinal-version: 0.2.0.0+version: 0.3.0.0 synopsis: Convert numbers to words in different languages. description: A package based on Python's num2words package that converts numbers@@ -39,6 +39,7 @@ build-depends: base >= 4.7 && < 5 , containers >=0.5+ , data-default >=0.2 , regex >=1.0 , text >= 0.1 , template-haskell >=2.2.0.0
src/Text/Numerals/Algorithm.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE RankNTypes, TupleSections #-}+{-# LANGUAGE OverloadedStrings, RankNTypes, TupleSections #-} {-| Module : Text.Numerals.Algorithm@@ -27,13 +27,20 @@ , compressSegments ) where +import Data.Default(Default(def)) import Data.Foldable(toList) import Data.List(sortOn) import Data.Text(Text, cons, toTitle) import Data.Vector(Vector, (!), (!?), fromList) import qualified Data.Vector as V -import Text.Numerals.Class(NumToWord(toCardinal, toOrdinal), FreeMergerFunction, FreeValueSplitter, MergerFunction, MNumberSegment, NumberSegment(NumberSegment), NumberSegmenting, ValueSplit(valueSplit), ValueSplitter)+import Text.Numerals.Class(+ NumToWord(toCardinal, toOrdinal, toShortOrdinal)+ , FreeMergerFunction, FreeNumberToWords, FreeValueSplitter+ , MergerFunction, MNumberSegment+ , NumberSegment(NumberSegment), NumberSegmenting+ , ValueSplit(valueSplit), ValueSplitter+ ) import Text.Numerals.Internal(_thousand, _iLogFloor) import Text.Numerals.Prefix(latinPrefixes) @@ -47,6 +54,7 @@ , highWords :: FreeValueSplitter -- ^ A function that is used to generate words for large values (greater than or equal to one /million/), often constructed with the /short scale/ or /long scale/. , mergeFunction :: FreeMergerFunction -- ^ A function that specifies how to merge words based on the grammar of that specific language. , ordinize :: Text -> Text -- ^ A function to conver the /cardinal/ form of a number in an /ordinal/ one.+ , shortOrdinal :: FreeNumberToWords -- ^ A function that converts a number to its /short ordinal/ form. } @@ -59,6 +67,7 @@ j = fromIntegral i :: Integer toOrdinal na@NumeralsAlgorithm { ordinize=_ordinize } = _ordinize . toCardinal na+ toShortOrdinal = shortOrdinal _toNumberScale :: (Integral i, Integral j) => i -> (j, i)@@ -67,12 +76,16 @@ -- | A data type used for to map larger numbers to words. This data type -- supports the /short scale/ and /long scale/ with /Latin/ prefixes, and--- custom suffixes.+-- custom suffixes. The 'Default' value is the /short scale/ with /illion/+-- as suffix. This is used in /English/ for large numbers. data HighNumberAlgorithm = ShortScale Text | LongScale Text Text deriving (Eq, Ord, Read, Show) +instance Default HighNumberAlgorithm where+ def = ShortScale "illion"+ -- | Construct a 'FreeValueSplitter' function for the given suffix for a /short scale/. shortScale :: Text -> FreeValueSplitter shortScale = valueSplit . ShortScale@@ -100,7 +113,7 @@ | otherwise = _highWithSuffix suf2 k where k = div j 2 --- Generate a /value splitter/ for a 'HighNumberAlgorithm' but where the result+-- | Generate a /value splitter/ for a 'HighNumberAlgorithm' but where the result -- is post-processed by a function. valueSplit' :: (Text -> Text) -- ^ The post-processing function.@@ -115,7 +128,7 @@ -- | A /smart constructor/ for the 'NumeralsAlgorithm' type. This constructor -- allows one to use an arbitrary 'Foldable' type for the low words and mid -- words. It will also order the midwords accordingly.-numeralsAlgorithm :: (Foldable f, Foldable g) => Text -> Text -> Text -> f Text -> g (Integer, Text) -> FreeValueSplitter -> FreeMergerFunction -> (Text -> Text) -> NumeralsAlgorithm+numeralsAlgorithm :: (Foldable f, Foldable g) => Text -> Text -> Text -> f Text -> g (Integer, Text) -> FreeValueSplitter -> FreeMergerFunction -> (Text -> Text) -> FreeNumberToWords -> NumeralsAlgorithm numeralsAlgorithm minus zero one _lowWords _midWords = NumeralsAlgorithm minus one (fromList (zero : one : toList _lowWords)) (sortOn (negate . fst) (toList _midWords)) _maybeSegment :: Integral i => (i -> NumberSegment i) -> i -> MNumberSegment i
src/Text/Numerals/Class.hs view
@@ -13,19 +13,28 @@ module Text.Numerals.Class ( -- * Typeclasses- NumToWord(toCardinal, toOrdinal, toWords)+ NumToWord(toCardinal, toOrdinal, toShortOrdinal, toWords) , ValueSplit(valueSplit) -- * Types of numbers- , NumberType(Cardinal, Ordinal)+ , NumberType(Cardinal, Ordinal, ShortOrdinal) -- * Segmenting a number , NumberSegment(NumberSegment, segmentDivision, segmentValue, segmentText, segmentRemainder) , MNumberSegment -- * Utility type synonyms+ , NumberToWords, FreeNumberToWords , MergerFunction, FreeMergerFunction, ValueSplitter, FreeValueSplitter, NumberSegmenting ) where +import Data.Default(Default(def)) import Data.Text(Text) +-- | A type alias for a function that maps a number to a 'Text' object.+type NumberToWords i = i -> Text++-- | A type alias for a 'NumberToWords' function, with a free 'Integral'+-- variable.+type FreeNumberToWords = forall i . Integral i => NumberToWords i+ -- | A type alias of a function that is used to merge the names of two numbers according -- to gramatical rules. The type parameter is the type of the numbers to merge. type MergerFunction i = i -> i -> Text -> Text -> Text@@ -61,27 +70,45 @@ type MNumberSegment i = Maybe (NumberSegment i) -- | A data type that specifies the different types of numbers. These can be--- used to specify the "target format".+-- used to specify the "target format". The 'Default' number type is 'Cardinal'. data NumberType = Cardinal -- ^ /Cardinal/ numbers like one, two, three, etc. | Ordinal -- ^ /Ordinal/ numbers like first, second, third, etc.- deriving (Bounded, Enum, Eq, Ord)+ | ShortOrdinal -- ^ /Short ordinal/ numbers like 1st, 2nd, 3rd, etc.+ deriving (Bounded, Enum, Eq, Ord, Read, Show) +instance Default NumberType where+ def = Cardinal+ -- | A type class used for num to word algorithms. It maps an 'Integral' type -- @i@ to 'Text'. class NumToWord a where -- | Convert the given number to a 'Text' object that is the given number in- -- words.+ -- words in /cardinal/ form. toCardinal :: Integral i => a -- ^ The conversion algorithm that transforms the number into words. -> i -- ^ The number to transform into a /cardinal/ form. -> Text -- ^ The number in words in a /cardinal/ form. toCardinal = toWords Cardinal++ -- | Convert the given number to a 'Text' object that is the given number in+ -- words in /cardinal/ form. toOrdinal :: Integral i => a -- ^ The conversion algorithm that transforms the number into words. -> i -- ^ The number to transform into a /ordinal/ form. -> Text -- ^ The number in words in a /ordinal/ form. toOrdinal = toWords Ordinal++ -- | Convert the given number to a 'Text' object that is the given number+ -- in words in /short cardinal/ form.+ toShortOrdinal :: Integral i+ => a -- ^ The conversion algorithm that transforms the number into words.+ -> i -- ^ The number to transform into a /ordinal/ form.+ -> Text -- ^ The number in words in a /ordinal/ form.+ toShortOrdinal = toWords Ordinal++ -- | Convert the given number to a 'Text' object that is the given number in+ -- words in the given 'NumberType'. toWords :: Integral i => NumberType -- ^ The given format to convert the number to. -> a -- ^ The conversion algorithm that transforms the number into words.@@ -89,7 +116,8 @@ -> Text -- ^ The number in words in the given form. toWords Cardinal = toCardinal toWords Ordinal = toOrdinal- {-# MINIMAL toCardinal, toOrdinal | toWords #-}+ toWords ShortOrdinal = toShortOrdinal+ {-# MINIMAL toCardinal, toOrdinal, toShortOrdinal | toWords #-} -- | A type class used to split a value, based on the name of a number in a -- specific language. The value that is used to split, is often, depending on
src/Text/Numerals/Internal.hs view
@@ -7,8 +7,11 @@ , _hundred, _thousand, _million, _billion, _trillion , _iLog, _iLogFloor , _stripLastIf+ , _showIntegral+ , _showPositive ) where +import Data.Char(intToDigit) import Data.Text(Text, cons, dropEnd, isSuffixOf, singleton, pack) import qualified Data.Text as T @@ -81,3 +84,15 @@ _replaceSuffix :: Int -> Text -> Text -> Text _replaceSuffix n s = (<> s) . dropEnd n++_showIntegral :: Integral i => i -> String -> String+_showIntegral n s+ | n < 0 = '-' : _showPositive (-(fromIntegral n :: Integer)) s+ | otherwise = _showPositive n s++_showPositive :: Integral i => i -> String -> String+_showPositive n s+ | q == 0 = tl+ | otherwise = _showPositive q tl+ where (q, r) = quotRem n 10+ tl = intToDigit (fromIntegral r) : s
src/Text/Numerals/Languages/Dutch.hs view
@@ -23,13 +23,13 @@ , merge' ) where -import Data.Text(Text, snoc)+import Data.Text(Text, pack, snoc) import Data.Vector(Vector) import Text.Numerals.Algorithm(HighNumberAlgorithm(LongScale), NumeralsAlgorithm, numeralsAlgorithm) import Text.Numerals.Algorithm.Template(ordinizeFromDict) import Text.Numerals.Class(valueSplit)-import Text.Numerals.Internal(_million, _mergeWithSpace)+import Text.Numerals.Internal(_million, _mergeWithSpace, _showIntegral) $(pure (ordinizeFromDict "_ordinize'" [ ("nul", "nuld")@@ -59,7 +59,7 @@ -- | A 'NumeralsAlgorithm' to convert numbers to words in the /Dutch/ language. dutch :: NumeralsAlgorithm -- ^ A 'NumeralsAlgorithm' that can be used to convert numbers to different formats.-dutch = numeralsAlgorithm negativeWord' zeroWord' oneWord' lowWords' midWords' (valueSplit highWords') merge' ordinize'+dutch = numeralsAlgorithm negativeWord' zeroWord' oneWord' lowWords' midWords' (valueSplit highWords') merge' ordinize' shortOrdinal' -- | The words used to mark a negative number in the /Dutch/ language. negativeWord' :: Text@@ -145,3 +145,9 @@ -- suffixes. highWords' :: HighNumberAlgorithm highWords' = LongScale "iljoen" "iljard"++-- | A function to convert a number to its /short ordinal/ form in /Dutch/.+shortOrdinal' :: Integral i+ => i -- ^ The number to convert to /short ordinal/ form.+ -> Text -- ^ The equivalent 'Text' specifying the number in /short ordinal/ form.+shortOrdinal' = pack . (`_showIntegral` "e")
src/Text/Numerals/Languages/English.hs view
@@ -23,14 +23,15 @@ , merge' ) where -import Data.Text(Text, isSuffixOf)+import Data.Default(def)+import Data.Text(Text, isSuffixOf, pack) import qualified Data.Text as T import Data.Vector(Vector) -import Text.Numerals.Algorithm(HighNumberAlgorithm(ShortScale), NumeralsAlgorithm, numeralsAlgorithm)+import Text.Numerals.Algorithm(HighNumberAlgorithm, NumeralsAlgorithm, numeralsAlgorithm) import Text.Numerals.Algorithm.Template(ordinizeFromDict) import Text.Numerals.Class(valueSplit)-import Text.Numerals.Internal(_mergeWith, _mergeWithSpace, _mergeWithHyphen)+import Text.Numerals.Internal(_div10, _mergeWith, _mergeWithSpace, _mergeWithHyphen, _rem10, _showIntegral) _ordinizepp :: Text -> Text _ordinizepp t@@ -56,7 +57,7 @@ -- | A 'NumeralsAlgorithm' to convert numbers to words in the /English/ language. english :: NumeralsAlgorithm -- ^ A 'NumeralsAlgorithm' that can be used to convert numbers to different formats.-english = numeralsAlgorithm negativeWord' zeroWord' oneWord' lowWords' midWords' (valueSplit highWords') merge' ordinize'+english = numeralsAlgorithm negativeWord' zeroWord' oneWord' lowWords' midWords' (valueSplit highWords') merge' ordinize' shortOrdinal' -- | The words used to mark a negative number in the /English/ language. negativeWord' :: Text@@ -121,4 +122,17 @@ -- | An algorithm to obtain the names of /large/ numbers (one million or larger) -- in /English/. English uses a /short scale/ with the @illion@ suffix. highWords' :: HighNumberAlgorithm-highWords' = ShortScale "illion"+highWords' = def++-- | A function to convert a number to its /short ordinal/ form in /English/.+shortOrdinal' :: Integral i+ => i -- ^ The number to convert to /short ordinal/ form.+ -> Text -- ^ The equivalent 'Text' specifying the number in /short ordinal/ form.+shortOrdinal' i = pack (_showIntegral i (_shortOrdinalSuffix i))+ where _shortOrdinalSuffix n+ | _rem10 (_div10 n) == 1 = "th"+ | otherwise = go' (_rem10 n)+ go' 1 = "st"+ go' 2 = "nd"+ go' 3 = "rd"+ go' _ = "th"
src/Text/Numerals/Languages/French.hs view
@@ -23,13 +23,13 @@ , merge' ) where -import Data.Text(Text, isSuffixOf, snoc)+import Data.Text(Text, isSuffixOf, pack, snoc) import Data.Vector(Vector) import Text.Numerals.Algorithm(HighNumberAlgorithm(LongScale), NumeralsAlgorithm, numeralsAlgorithm) import Text.Numerals.Algorithm.Template(ordinizeFromDict) import Text.Numerals.Class(FreeMergerFunction, valueSplit)-import Text.Numerals.Internal(_divisable100, _mergeWith, _mergeWithSpace, _mergeWithHyphen, _million, _stripLastIf, _thousand)+import Text.Numerals.Internal(_divisable100, _mergeWith, _mergeWithSpace, _mergeWithHyphen, _million, _showIntegral, _stripLastIf, _thousand) $(pure (ordinizeFromDict "_ordinize'" [ ("cinq", "cinqu")@@ -38,7 +38,7 @@ -- | A 'NumeralsAlgorithm' to convert numbers to words in the /French/ language. french :: NumeralsAlgorithm -- ^ A 'NumeralsAlgorithm' that can be used to convert numbers to different formats.-french = numeralsAlgorithm negativeWord' zeroWord' oneWord' lowWords' midWords' (valueSplit highWords') merge' ordinize'+french = numeralsAlgorithm negativeWord' zeroWord' oneWord' lowWords' midWords' (valueSplit highWords') merge' ordinize' shortOrdinal' -- | The words used to mark a negative number in the /French/ language. negativeWord' :: Text@@ -122,3 +122,9 @@ -- suffixes. highWords' :: HighNumberAlgorithm highWords' = LongScale "illion" "illiard"++-- | A function to convert a number to its /short ordinal/ form in /French/.+shortOrdinal' :: Integral i+ => i -- ^ The number to convert to /short ordinal/ form.+ -> Text -- ^ The equivalent 'Text' specifying the number in /short ordinal/ form.+shortOrdinal' = pack . (`_showIntegral` "e")
src/Text/Numerals/Languages/German.hs view
@@ -24,13 +24,13 @@ ) where import Data.Bool(bool)-import Data.Text(Text, isSuffixOf, toLower, toTitle)+import Data.Text(Text, isSuffixOf, pack, toLower, toTitle) import Data.Vector(Vector) import Text.Numerals.Algorithm(HighNumberAlgorithm(LongScale), NumeralsAlgorithm, numeralsAlgorithm, valueSplit') import Text.Numerals.Algorithm.Template(ordinizeFromDict) import Text.Numerals.Class(FreeMergerFunction)-import Text.Numerals.Internal(_mergeWith, _mergeWithSpace, _million)+import Text.Numerals.Internal(_mergeWith, _mergeWithSpace, _million, _showIntegral) import Text.RE.TDFA.Text(RE, SearchReplace, (*=~/), ed) $(pure (ordinizeFromDict "_ordinize'" [@@ -49,7 +49,7 @@ -- | A 'NumeralsAlgorithm' to convert numbers to words in the /German/ language. german :: NumeralsAlgorithm -- ^ A 'NumeralsAlgorithm' that can be used to convert numbers to different formats.-german = numeralsAlgorithm negativeWord' zeroWord' oneWord' lowWords' midWords' (valueSplit' toTitle highWords') merge' ordinize'+german = numeralsAlgorithm negativeWord' zeroWord' oneWord' lowWords' midWords' (valueSplit' toTitle highWords') merge' ordinize' shortOrdinal' -- | The words used to mark a negative number in the /German/ language. negativeWord' :: Text@@ -142,3 +142,9 @@ -- suffixes. highWords' :: HighNumberAlgorithm highWords' = LongScale "illion" "illiard"++-- | A function to convert a number to its /short ordinal/ form in /German/.+shortOrdinal' :: Integral i+ => i -- ^ The number to convert to /short ordinal/ form.+ -> Text -- ^ The equivalent 'Text' specifying the number in /short ordinal/ form.+shortOrdinal' = pack . (`_showIntegral` ".")
test/Text/Numerals/LanguageTest.hs view
@@ -9,7 +9,7 @@ import Test.Hspec(SpecWith, describe, it, shouldBe) import Test.QuickCheck(property) -import Text.Numerals.Class(toCardinal, toOrdinal)+import Text.Numerals.Class(toCardinal, toOrdinal, toShortOrdinal) import Text.Numerals.Algorithm(NumeralsAlgorithm) testDifferCardinal :: NumeralsAlgorithm -> Integer -> Integer -> Bool@@ -33,8 +33,12 @@ testEquivalenceOrdinal :: Integral i => NumeralsAlgorithm -> i -> Bool testEquivalenceOrdinal al i = toOrdinal al i == toOrdinal al (fromIntegral i :: Integer) -testLanguage :: String -> NumeralsAlgorithm -> [(Integer, Text)] -> [(Integer, Text)] -> SpecWith ()-testLanguage languageName al cs os = describe languageName $ do+testEquivalenceShortOrdinal :: Integral i => NumeralsAlgorithm -> i -> Bool+testEquivalenceShortOrdinal al i = toShortOrdinal al i == toShortOrdinal al (fromIntegral i :: Integer)+++testLanguage :: String -> NumeralsAlgorithm -> [(Integer, Text)] -> [(Integer, Text)] -> [(Integer, Text)] -> SpecWith ()+testLanguage languageName al cs os ss = describe languageName $ do describe "Automatied tests" $ do it "Different cardinal names" (property (testDifferCardinal al)) it "Different ordinal names" (property (testDifferOrdinal al))@@ -60,5 +64,17 @@ it "Check toOrdinal algorithm with Word16" (property (testEquivalenceOrdinal al :: Word16 -> Bool)) it "Check toOrdinal algorithm with Word32" (property (testEquivalenceOrdinal al :: Word32 -> Bool)) it "Check toOrdinal algorithm with Word64" (property (testEquivalenceOrdinal al :: Word64 -> Bool))+ it "Check toShortOrdinal algorithm with Int" (property (testEquivalenceShortOrdinal al :: Int -> Bool))+ it "Check toShortOrdinal algorithm with Int8" (property (testEquivalenceShortOrdinal al :: Int8 -> Bool))+ it "Check toShortOrdinal algorithm with Int16" (property (testEquivalenceShortOrdinal al :: Int16 -> Bool))+ it "Check toShortOrdinal algorithm with Int32" (property (testEquivalenceShortOrdinal al :: Int32 -> Bool))+ it "Check toShortOrdinal algorithm with Int64" (property (testEquivalenceShortOrdinal al :: Int64 -> Bool))+ it "Check toShortOrdinal algorithm with Word" (property (testEquivalenceShortOrdinal al :: Word -> Bool))+ it "Check toShortOrdinal algorithm with Word8" (property (testEquivalenceShortOrdinal al :: Word8 -> Bool))+ it "Check toShortOrdinal algorithm with Word16" (property (testEquivalenceShortOrdinal al :: Word16 -> Bool))+ it "Check toShortOrdinal algorithm with Word32" (property (testEquivalenceShortOrdinal al :: Word32 -> Bool))+ it "Check toShortOrdinal algorithm with Word64" (property (testEquivalenceShortOrdinal al :: Word64 -> Bool))+ describe "Test cardinal numbers" (mapM_ (uncurry (testNumberConversion (toCardinal al))) cs) describe "Test ordinal numbers" (mapM_ (uncurry (testNumberConversion (toOrdinal al))) os)+ describe "Test short ordinal numbers" (mapM_ (uncurry (testNumberConversion (toShortOrdinal al))) ss)
test/Text/Numerals/Languages/DutchSpec.hs view
@@ -9,7 +9,7 @@ import Text.Numerals.LanguageTest(testLanguage) spec :: Spec-spec = testLanguage "Dutch" dutch cardinals ordinals+spec = testLanguage "Dutch" dutch cardinals ordinals shortOrdinals cardinals :: [(Integer, Text)] cardinals = [@@ -663,4 +663,331 @@ , (10000000000000000000000, "tien triljardste") , (100000000000000000000000, "honderd triljardste") , (1000000000000000000000000, "een quadriljoenste")+ ]++shortOrdinals :: [(Integer, Text)]+shortOrdinals = [+ (0, "0e")+ , (1, "1e")+ , (2, "2e")+ , (3, "3e")+ , (4, "4e")+ , (5, "5e")+ , (6, "6e")+ , (7, "7e")+ , (8, "8e")+ , (9, "9e")+ , (10, "10e")+ , (11, "11e")+ , (12, "12e")+ , (13, "13e")+ , (14, "14e")+ , (15, "15e")+ , (16, "16e")+ , (17, "17e")+ , (18, "18e")+ , (19, "19e")+ , (20, "20e")+ , (21, "21e")+ , (22, "22e")+ , (23, "23e")+ , (24, "24e")+ , (25, "25e")+ , (26, "26e")+ , (27, "27e")+ , (28, "28e")+ , (29, "29e")+ , (30, "30e")+ , (31, "31e")+ , (32, "32e")+ , (33, "33e")+ , (34, "34e")+ , (35, "35e")+ , (36, "36e")+ , (37, "37e")+ , (38, "38e")+ , (39, "39e")+ , (40, "40e")+ , (41, "41e")+ , (42, "42e")+ , (43, "43e")+ , (44, "44e")+ , (45, "45e")+ , (46, "46e")+ , (47, "47e")+ , (48, "48e")+ , (49, "49e")+ , (50, "50e")+ , (51, "51e")+ , (52, "52e")+ , (53, "53e")+ , (54, "54e")+ , (55, "55e")+ , (56, "56e")+ , (57, "57e")+ , (58, "58e")+ , (59, "59e")+ , (60, "60e")+ , (61, "61e")+ , (62, "62e")+ , (63, "63e")+ , (64, "64e")+ , (65, "65e")+ , (66, "66e")+ , (67, "67e")+ , (68, "68e")+ , (69, "69e")+ , (70, "70e")+ , (71, "71e")+ , (72, "72e")+ , (73, "73e")+ , (74, "74e")+ , (75, "75e")+ , (76, "76e")+ , (77, "77e")+ , (78, "78e")+ , (79, "79e")+ , (80, "80e")+ , (81, "81e")+ , (82, "82e")+ , (83, "83e")+ , (84, "84e")+ , (85, "85e")+ , (86, "86e")+ , (87, "87e")+ , (88, "88e")+ , (89, "89e")+ , (90, "90e")+ , (91, "91e")+ , (92, "92e")+ , (93, "93e")+ , (94, "94e")+ , (95, "95e")+ , (96, "96e")+ , (97, "97e")+ , (98, "98e")+ , (99, "99e")+ , (100, "100e")+ , (101, "101e")+ , (102, "102e")+ , (103, "103e")+ , (104, "104e")+ , (105, "105e")+ , (106, "106e")+ , (107, "107e")+ , (108, "108e")+ , (109, "109e")+ , (110, "110e")+ , (111, "111e")+ , (112, "112e")+ , (113, "113e")+ , (114, "114e")+ , (115, "115e")+ , (116, "116e")+ , (117, "117e")+ , (118, "118e")+ , (119, "119e")+ , (120, "120e")+ , (121, "121e")+ , (122, "122e")+ , (123, "123e")+ , (124, "124e")+ , (125, "125e")+ , (126, "126e")+ , (127, "127e")+ , (128, "128e")+ , (129, "129e")+ , (130, "130e")+ , (131, "131e")+ , (132, "132e")+ , (133, "133e")+ , (134, "134e")+ , (135, "135e")+ , (136, "136e")+ , (137, "137e")+ , (138, "138e")+ , (139, "139e")+ , (140, "140e")+ , (141, "141e")+ , (142, "142e")+ , (143, "143e")+ , (144, "144e")+ , (145, "145e")+ , (146, "146e")+ , (147, "147e")+ , (148, "148e")+ , (149, "149e")+ , (150, "150e")+ , (151, "151e")+ , (152, "152e")+ , (153, "153e")+ , (154, "154e")+ , (155, "155e")+ , (156, "156e")+ , (157, "157e")+ , (158, "158e")+ , (159, "159e")+ , (160, "160e")+ , (161, "161e")+ , (162, "162e")+ , (163, "163e")+ , (164, "164e")+ , (165, "165e")+ , (166, "166e")+ , (167, "167e")+ , (168, "168e")+ , (169, "169e")+ , (170, "170e")+ , (171, "171e")+ , (172, "172e")+ , (173, "173e")+ , (174, "174e")+ , (175, "175e")+ , (176, "176e")+ , (177, "177e")+ , (178, "178e")+ , (179, "179e")+ , (180, "180e")+ , (181, "181e")+ , (182, "182e")+ , (183, "183e")+ , (184, "184e")+ , (185, "185e")+ , (186, "186e")+ , (187, "187e")+ , (188, "188e")+ , (189, "189e")+ , (190, "190e")+ , (191, "191e")+ , (192, "192e")+ , (193, "193e")+ , (194, "194e")+ , (195, "195e")+ , (196, "196e")+ , (197, "197e")+ , (198, "198e")+ , (199, "199e")+ , (200, "200e")+ , (233, "233e")+ , (377, "377e")+ , (610, "610e")+ , (987, "987e")+ , (1597, "1597e")+ , (2584, "2584e")+ , (4181, "4181e")+ , (6765, "6765e")+ , (10946, "10946e")+ , (17711, "17711e")+ , (28657, "28657e")+ , (46368, "46368e")+ , (75025, "75025e")+ , (121393, "121393e")+ , (196418, "196418e")+ , (317811, "317811e")+ , (514229, "514229e")+ , (832040, "832040e")+ , (1346269, "1346269e")+ , (2178309, "2178309e")+ , (3524578, "3524578e")+ , (5702887, "5702887e")+ , (9227465, "9227465e")+ , (14930352, "14930352e")+ , (24157817, "24157817e")+ , (39088169, "39088169e")+ , (63245986, "63245986e")+ , (102334155, "102334155e")+ , (165580141, "165580141e")+ , (267914296, "267914296e")+ , (433494437, "433494437e")+ , (701408733, "701408733e")+ , (1134903170, "1134903170e")+ , (1836311903, "1836311903e")+ , (2971215073, "2971215073e")+ , (4807526976, "4807526976e")+ , (7778742049, "7778742049e")+ , (12586269025, "12586269025e")+ , (20365011074, "20365011074e")+ , (32951280099, "32951280099e")+ , (53316291173, "53316291173e")+ , (86267571272, "86267571272e")+ , (139583862445, "139583862445e")+ , (225851433717, "225851433717e")+ , (365435296162, "365435296162e")+ , (591286729879, "591286729879e")+ , (956722026041, "956722026041e")+ , (1548008755920, "1548008755920e")+ , (2504730781961, "2504730781961e")+ , (4052739537881, "4052739537881e")+ , (6557470319842, "6557470319842e")+ , (10610209857723, "10610209857723e")+ , (17167680177565, "17167680177565e")+ , (27777890035288, "27777890035288e")+ , (44945570212853, "44945570212853e")+ , (72723460248141, "72723460248141e")+ , (117669030460994, "117669030460994e")+ , (190392490709135, "190392490709135e")+ , (308061521170129, "308061521170129e")+ , (498454011879264, "498454011879264e")+ , (806515533049393, "806515533049393e")+ , (1304969544928657, "1304969544928657e")+ , (2111485077978050, "2111485077978050e")+ , (3416454622906707, "3416454622906707e")+ , (5527939700884757, "5527939700884757e")+ , (8944394323791464, "8944394323791464e")+ , (14472334024676221, "14472334024676221e")+ , (23416728348467685, "23416728348467685e")+ , (37889062373143906, "37889062373143906e")+ , (61305790721611591, "61305790721611591e")+ , (99194853094755497, "99194853094755497e")+ , (160500643816367088, "160500643816367088e")+ , (259695496911122585, "259695496911122585e")+ , (420196140727489673, "420196140727489673e")+ , (679891637638612258, "679891637638612258e")+ , (1100087778366101931, "1100087778366101931e")+ , (1779979416004714189, "1779979416004714189e")+ , (2880067194370816120, "2880067194370816120e")+ , (4660046610375530309, "4660046610375530309e")+ , (7540113804746346429, "7540113804746346429e")+ , (12200160415121876738, "12200160415121876738e")+ , (19740274219868223167, "19740274219868223167e")+ , (31940434634990099905, "31940434634990099905e")+ , (51680708854858323072, "51680708854858323072e")+ , (83621143489848422977, "83621143489848422977e")+ , (135301852344706746049, "135301852344706746049e")+ , (218922995834555169026, "218922995834555169026e")+ , (354224848179261915075, "354224848179261915075e")+ , (573147844013817084101, "573147844013817084101e")+ , (927372692193078999176, "927372692193078999176e")+ , (1500520536206896083277, "1500520536206896083277e")+ , (2427893228399975082453, "2427893228399975082453e")+ , (3928413764606871165730, "3928413764606871165730e")+ , (6356306993006846248183, "6356306993006846248183e")+ , (10284720757613717413913, "10284720757613717413913e")+ , (16641027750620563662096, "16641027750620563662096e")+ , (26925748508234281076009, "26925748508234281076009e")+ , (43566776258854844738105, "43566776258854844738105e")+ , (70492524767089125814114, "70492524767089125814114e")+ , (114059301025943970552219, "114059301025943970552219e")+ , (1000, "1000e")+ , (10000, "10000e")+ , (100000, "100000e")+ , (1000000, "1000000e")+ , (10000000, "10000000e")+ , (100000000, "100000000e")+ , (1000000000, "1000000000e")+ , (10000000000, "10000000000e")+ , (100000000000, "100000000000e")+ , (1000000000000, "1000000000000e")+ , (10000000000000, "10000000000000e")+ , (100000000000000, "100000000000000e")+ , (1000000000000000, "1000000000000000e")+ , (10000000000000000, "10000000000000000e")+ , (100000000000000000, "100000000000000000e")+ , (1000000000000000000, "1000000000000000000e")+ , (10000000000000000000, "10000000000000000000e")+ , (100000000000000000000, "100000000000000000000e")+ , (1000000000000000000000, "1000000000000000000000e")+ , (10000000000000000000000, "10000000000000000000000e")+ , (100000000000000000000000, "100000000000000000000000e")+ , (1000000000000000000000000, "1000000000000000000000000e") ]
test/Text/Numerals/Languages/EnglishSpec.hs view
@@ -9,7 +9,7 @@ import Text.Numerals.LanguageTest(testLanguage) spec :: Spec-spec = testLanguage "English" english cardinals ordinals+spec = testLanguage "English" english cardinals ordinals shortOrdinals cardinals :: [(Integer, Text)] cardinals = [@@ -663,4 +663,331 @@ , (10000000000000000000000, "ten sextillionth") , (100000000000000000000000, "one hundred sextillionth") , (1000000000000000000000000, "one septillionth")+ ]++shortOrdinals :: [(Integer, Text)]+shortOrdinals = [+ (0,"0th")+ , (1,"1st")+ , (2,"2nd")+ , (3,"3rd")+ , (4,"4th")+ , (5,"5th")+ , (6,"6th")+ , (7,"7th")+ , (8,"8th")+ , (9,"9th")+ , (10,"10th")+ , (11,"11th")+ , (12,"12th")+ , (13,"13th")+ , (14,"14th")+ , (15,"15th")+ , (16,"16th")+ , (17,"17th")+ , (18,"18th")+ , (19,"19th")+ , (20,"20th")+ , (21,"21st")+ , (22,"22nd")+ , (23,"23rd")+ , (24,"24th")+ , (25,"25th")+ , (26,"26th")+ , (27,"27th")+ , (28,"28th")+ , (29,"29th")+ , (30,"30th")+ , (31,"31st")+ , (32,"32nd")+ , (33,"33rd")+ , (34,"34th")+ , (35,"35th")+ , (36,"36th")+ , (37,"37th")+ , (38,"38th")+ , (39,"39th")+ , (40,"40th")+ , (41,"41st")+ , (42,"42nd")+ , (43,"43rd")+ , (44,"44th")+ , (45,"45th")+ , (46,"46th")+ , (47,"47th")+ , (48,"48th")+ , (49,"49th")+ , (50,"50th")+ , (51,"51st")+ , (52,"52nd")+ , (53,"53rd")+ , (54,"54th")+ , (55,"55th")+ , (56,"56th")+ , (57,"57th")+ , (58,"58th")+ , (59,"59th")+ , (60,"60th")+ , (61,"61st")+ , (62,"62nd")+ , (63,"63rd")+ , (64,"64th")+ , (65,"65th")+ , (66,"66th")+ , (67,"67th")+ , (68,"68th")+ , (69,"69th")+ , (70,"70th")+ , (71,"71st")+ , (72,"72nd")+ , (73,"73rd")+ , (74,"74th")+ , (75,"75th")+ , (76,"76th")+ , (77,"77th")+ , (78,"78th")+ , (79,"79th")+ , (80,"80th")+ , (81,"81st")+ , (82,"82nd")+ , (83,"83rd")+ , (84,"84th")+ , (85,"85th")+ , (86,"86th")+ , (87,"87th")+ , (88,"88th")+ , (89,"89th")+ , (90,"90th")+ , (91,"91st")+ , (92,"92nd")+ , (93,"93rd")+ , (94,"94th")+ , (95,"95th")+ , (96,"96th")+ , (97,"97th")+ , (98,"98th")+ , (99,"99th")+ , (100,"100th")+ , (101,"101st")+ , (102,"102nd")+ , (103,"103rd")+ , (104,"104th")+ , (105,"105th")+ , (106,"106th")+ , (107,"107th")+ , (108,"108th")+ , (109,"109th")+ , (110,"110th")+ , (111,"111th")+ , (112,"112th")+ , (113,"113th")+ , (114,"114th")+ , (115,"115th")+ , (116,"116th")+ , (117,"117th")+ , (118,"118th")+ , (119,"119th")+ , (120,"120th")+ , (121,"121st")+ , (122,"122nd")+ , (123,"123rd")+ , (124,"124th")+ , (125,"125th")+ , (126,"126th")+ , (127,"127th")+ , (128,"128th")+ , (129,"129th")+ , (130,"130th")+ , (131,"131st")+ , (132,"132nd")+ , (133,"133rd")+ , (134,"134th")+ , (135,"135th")+ , (136,"136th")+ , (137,"137th")+ , (138,"138th")+ , (139,"139th")+ , (140,"140th")+ , (141,"141st")+ , (142,"142nd")+ , (143,"143rd")+ , (144,"144th")+ , (145,"145th")+ , (146,"146th")+ , (147,"147th")+ , (148,"148th")+ , (149,"149th")+ , (150,"150th")+ , (151,"151st")+ , (152,"152nd")+ , (153,"153rd")+ , (154,"154th")+ , (155,"155th")+ , (156,"156th")+ , (157,"157th")+ , (158,"158th")+ , (159,"159th")+ , (160,"160th")+ , (161,"161st")+ , (162,"162nd")+ , (163,"163rd")+ , (164,"164th")+ , (165,"165th")+ , (166,"166th")+ , (167,"167th")+ , (168,"168th")+ , (169,"169th")+ , (170,"170th")+ , (171,"171st")+ , (172,"172nd")+ , (173,"173rd")+ , (174,"174th")+ , (175,"175th")+ , (176,"176th")+ , (177,"177th")+ , (178,"178th")+ , (179,"179th")+ , (180,"180th")+ , (181,"181st")+ , (182,"182nd")+ , (183,"183rd")+ , (184,"184th")+ , (185,"185th")+ , (186,"186th")+ , (187,"187th")+ , (188,"188th")+ , (189,"189th")+ , (190,"190th")+ , (191,"191st")+ , (192,"192nd")+ , (193,"193rd")+ , (194,"194th")+ , (195,"195th")+ , (196,"196th")+ , (197,"197th")+ , (198,"198th")+ , (199,"199th")+ , (200,"200th")+ , (233,"233rd")+ , (377,"377th")+ , (610,"610th")+ , (987,"987th")+ , (1597,"1597th")+ , (2584,"2584th")+ , (4181,"4181st")+ , (6765,"6765th")+ , (10946,"10946th")+ , (17711,"17711th")+ , (28657,"28657th")+ , (46368,"46368th")+ , (75025,"75025th")+ , (121393,"121393rd")+ , (196418,"196418th")+ , (317811,"317811th")+ , (514229,"514229th")+ , (832040,"832040th")+ , (1346269,"1346269th")+ , (2178309,"2178309th")+ , (3524578,"3524578th")+ , (5702887,"5702887th")+ , (9227465,"9227465th")+ , (14930352,"14930352nd")+ , (24157817,"24157817th")+ , (39088169,"39088169th")+ , (63245986,"63245986th")+ , (102334155,"102334155th")+ , (165580141,"165580141st")+ , (267914296,"267914296th")+ , (433494437,"433494437th")+ , (701408733,"701408733rd")+ , (1134903170,"1134903170th")+ , (1836311903,"1836311903rd")+ , (2971215073,"2971215073rd")+ , (4807526976,"4807526976th")+ , (7778742049,"7778742049th")+ , (12586269025,"12586269025th")+ , (20365011074,"20365011074th")+ , (32951280099,"32951280099th")+ , (53316291173,"53316291173rd")+ , (86267571272,"86267571272nd")+ , (139583862445,"139583862445th")+ , (225851433717,"225851433717th")+ , (365435296162,"365435296162nd")+ , (591286729879,"591286729879th")+ , (956722026041,"956722026041st")+ , (1548008755920,"1548008755920th")+ , (2504730781961,"2504730781961st")+ , (4052739537881,"4052739537881st")+ , (6557470319842,"6557470319842nd")+ , (10610209857723,"10610209857723rd")+ , (17167680177565,"17167680177565th")+ , (27777890035288,"27777890035288th")+ , (44945570212853,"44945570212853rd")+ , (72723460248141,"72723460248141st")+ , (117669030460994,"117669030460994th")+ , (190392490709135,"190392490709135th")+ , (308061521170129,"308061521170129th")+ , (498454011879264,"498454011879264th")+ , (806515533049393,"806515533049393rd")+ , (1304969544928657,"1304969544928657th")+ , (2111485077978050,"2111485077978050th")+ , (3416454622906707,"3416454622906707th")+ , (5527939700884757,"5527939700884757th")+ , (8944394323791464,"8944394323791464th")+ , (14472334024676221,"14472334024676221st")+ , (23416728348467685,"23416728348467685th")+ , (37889062373143906,"37889062373143906th")+ , (61305790721611591,"61305790721611591st")+ , (99194853094755497,"99194853094755497th")+ , (160500643816367088,"160500643816367088th")+ , (259695496911122585,"259695496911122585th")+ , (420196140727489673,"420196140727489673rd")+ , (679891637638612258,"679891637638612258th")+ , (1100087778366101931,"1100087778366101931st")+ , (1779979416004714189,"1779979416004714189th")+ , (2880067194370816120,"2880067194370816120th")+ , (4660046610375530309,"4660046610375530309th")+ , (7540113804746346429,"7540113804746346429th")+ , (12200160415121876738,"12200160415121876738th")+ , (19740274219868223167,"19740274219868223167th")+ , (31940434634990099905,"31940434634990099905th")+ , (51680708854858323072,"51680708854858323072nd")+ , (83621143489848422977,"83621143489848422977th")+ , (135301852344706746049,"135301852344706746049th")+ , (218922995834555169026,"218922995834555169026th")+ , (354224848179261915075,"354224848179261915075th")+ , (573147844013817084101,"573147844013817084101st")+ , (927372692193078999176,"927372692193078999176th")+ , (1500520536206896083277,"1500520536206896083277th")+ , (2427893228399975082453,"2427893228399975082453rd")+ , (3928413764606871165730,"3928413764606871165730th")+ , (6356306993006846248183,"6356306993006846248183rd")+ , (10284720757613717413913,"10284720757613717413913th")+ , (16641027750620563662096,"16641027750620563662096th")+ , (26925748508234281076009,"26925748508234281076009th")+ , (43566776258854844738105,"43566776258854844738105th")+ , (70492524767089125814114,"70492524767089125814114th")+ , (114059301025943970552219,"114059301025943970552219th")+ , (1000,"1000th")+ , (10000,"10000th")+ , (100000,"100000th")+ , (1000000,"1000000th")+ , (10000000,"10000000th")+ , (100000000,"100000000th")+ , (1000000000,"1000000000th")+ , (10000000000,"10000000000th")+ , (100000000000,"100000000000th")+ , (1000000000000,"1000000000000th")+ , (10000000000000,"10000000000000th")+ , (100000000000000,"100000000000000th")+ , (1000000000000000,"1000000000000000th")+ , (10000000000000000,"10000000000000000th")+ , (100000000000000000,"100000000000000000th")+ , (1000000000000000000,"1000000000000000000th")+ , (10000000000000000000,"10000000000000000000th")+ , (100000000000000000000,"100000000000000000000th")+ , (1000000000000000000000,"1000000000000000000000th")+ , (10000000000000000000000,"10000000000000000000000th")+ , (100000000000000000000000,"100000000000000000000000th")+ , (1000000000000000000000000,"1000000000000000000000000th") ]
test/Text/Numerals/Languages/FrenchSpec.hs view
@@ -9,7 +9,7 @@ import Text.Numerals.LanguageTest(testLanguage) spec :: Spec-spec = testLanguage "French" french cardinals ordinals+spec = testLanguage "French" french cardinals ordinals shortOrdinals cardinals :: [(Integer, Text)] cardinals = [@@ -663,4 +663,331 @@ , (10000000000000000000000, "dix trilliardsième") , (100000000000000000000000, "cent trilliardsième") , (1000000000000000000000000, "un quadrillionième")+ ]++shortOrdinals :: [(Integer, Text)]+shortOrdinals = [+ (0, "0e")+ , (1, "1e")+ , (2, "2e")+ , (3, "3e")+ , (4, "4e")+ , (5, "5e")+ , (6, "6e")+ , (7, "7e")+ , (8, "8e")+ , (9, "9e")+ , (10, "10e")+ , (11, "11e")+ , (12, "12e")+ , (13, "13e")+ , (14, "14e")+ , (15, "15e")+ , (16, "16e")+ , (17, "17e")+ , (18, "18e")+ , (19, "19e")+ , (20, "20e")+ , (21, "21e")+ , (22, "22e")+ , (23, "23e")+ , (24, "24e")+ , (25, "25e")+ , (26, "26e")+ , (27, "27e")+ , (28, "28e")+ , (29, "29e")+ , (30, "30e")+ , (31, "31e")+ , (32, "32e")+ , (33, "33e")+ , (34, "34e")+ , (35, "35e")+ , (36, "36e")+ , (37, "37e")+ , (38, "38e")+ , (39, "39e")+ , (40, "40e")+ , (41, "41e")+ , (42, "42e")+ , (43, "43e")+ , (44, "44e")+ , (45, "45e")+ , (46, "46e")+ , (47, "47e")+ , (48, "48e")+ , (49, "49e")+ , (50, "50e")+ , (51, "51e")+ , (52, "52e")+ , (53, "53e")+ , (54, "54e")+ , (55, "55e")+ , (56, "56e")+ , (57, "57e")+ , (58, "58e")+ , (59, "59e")+ , (60, "60e")+ , (61, "61e")+ , (62, "62e")+ , (63, "63e")+ , (64, "64e")+ , (65, "65e")+ , (66, "66e")+ , (67, "67e")+ , (68, "68e")+ , (69, "69e")+ , (70, "70e")+ , (71, "71e")+ , (72, "72e")+ , (73, "73e")+ , (74, "74e")+ , (75, "75e")+ , (76, "76e")+ , (77, "77e")+ , (78, "78e")+ , (79, "79e")+ , (80, "80e")+ , (81, "81e")+ , (82, "82e")+ , (83, "83e")+ , (84, "84e")+ , (85, "85e")+ , (86, "86e")+ , (87, "87e")+ , (88, "88e")+ , (89, "89e")+ , (90, "90e")+ , (91, "91e")+ , (92, "92e")+ , (93, "93e")+ , (94, "94e")+ , (95, "95e")+ , (96, "96e")+ , (97, "97e")+ , (98, "98e")+ , (99, "99e")+ , (100, "100e")+ , (101, "101e")+ , (102, "102e")+ , (103, "103e")+ , (104, "104e")+ , (105, "105e")+ , (106, "106e")+ , (107, "107e")+ , (108, "108e")+ , (109, "109e")+ , (110, "110e")+ , (111, "111e")+ , (112, "112e")+ , (113, "113e")+ , (114, "114e")+ , (115, "115e")+ , (116, "116e")+ , (117, "117e")+ , (118, "118e")+ , (119, "119e")+ , (120, "120e")+ , (121, "121e")+ , (122, "122e")+ , (123, "123e")+ , (124, "124e")+ , (125, "125e")+ , (126, "126e")+ , (127, "127e")+ , (128, "128e")+ , (129, "129e")+ , (130, "130e")+ , (131, "131e")+ , (132, "132e")+ , (133, "133e")+ , (134, "134e")+ , (135, "135e")+ , (136, "136e")+ , (137, "137e")+ , (138, "138e")+ , (139, "139e")+ , (140, "140e")+ , (141, "141e")+ , (142, "142e")+ , (143, "143e")+ , (144, "144e")+ , (145, "145e")+ , (146, "146e")+ , (147, "147e")+ , (148, "148e")+ , (149, "149e")+ , (150, "150e")+ , (151, "151e")+ , (152, "152e")+ , (153, "153e")+ , (154, "154e")+ , (155, "155e")+ , (156, "156e")+ , (157, "157e")+ , (158, "158e")+ , (159, "159e")+ , (160, "160e")+ , (161, "161e")+ , (162, "162e")+ , (163, "163e")+ , (164, "164e")+ , (165, "165e")+ , (166, "166e")+ , (167, "167e")+ , (168, "168e")+ , (169, "169e")+ , (170, "170e")+ , (171, "171e")+ , (172, "172e")+ , (173, "173e")+ , (174, "174e")+ , (175, "175e")+ , (176, "176e")+ , (177, "177e")+ , (178, "178e")+ , (179, "179e")+ , (180, "180e")+ , (181, "181e")+ , (182, "182e")+ , (183, "183e")+ , (184, "184e")+ , (185, "185e")+ , (186, "186e")+ , (187, "187e")+ , (188, "188e")+ , (189, "189e")+ , (190, "190e")+ , (191, "191e")+ , (192, "192e")+ , (193, "193e")+ , (194, "194e")+ , (195, "195e")+ , (196, "196e")+ , (197, "197e")+ , (198, "198e")+ , (199, "199e")+ , (200, "200e")+ , (233, "233e")+ , (377, "377e")+ , (610, "610e")+ , (987, "987e")+ , (1597, "1597e")+ , (2584, "2584e")+ , (4181, "4181e")+ , (6765, "6765e")+ , (10946, "10946e")+ , (17711, "17711e")+ , (28657, "28657e")+ , (46368, "46368e")+ , (75025, "75025e")+ , (121393, "121393e")+ , (196418, "196418e")+ , (317811, "317811e")+ , (514229, "514229e")+ , (832040, "832040e")+ , (1346269, "1346269e")+ , (2178309, "2178309e")+ , (3524578, "3524578e")+ , (5702887, "5702887e")+ , (9227465, "9227465e")+ , (14930352, "14930352e")+ , (24157817, "24157817e")+ , (39088169, "39088169e")+ , (63245986, "63245986e")+ , (102334155, "102334155e")+ , (165580141, "165580141e")+ , (267914296, "267914296e")+ , (433494437, "433494437e")+ , (701408733, "701408733e")+ , (1134903170, "1134903170e")+ , (1836311903, "1836311903e")+ , (2971215073, "2971215073e")+ , (4807526976, "4807526976e")+ , (7778742049, "7778742049e")+ , (12586269025, "12586269025e")+ , (20365011074, "20365011074e")+ , (32951280099, "32951280099e")+ , (53316291173, "53316291173e")+ , (86267571272, "86267571272e")+ , (139583862445, "139583862445e")+ , (225851433717, "225851433717e")+ , (365435296162, "365435296162e")+ , (591286729879, "591286729879e")+ , (956722026041, "956722026041e")+ , (1548008755920, "1548008755920e")+ , (2504730781961, "2504730781961e")+ , (4052739537881, "4052739537881e")+ , (6557470319842, "6557470319842e")+ , (10610209857723, "10610209857723e")+ , (17167680177565, "17167680177565e")+ , (27777890035288, "27777890035288e")+ , (44945570212853, "44945570212853e")+ , (72723460248141, "72723460248141e")+ , (117669030460994, "117669030460994e")+ , (190392490709135, "190392490709135e")+ , (308061521170129, "308061521170129e")+ , (498454011879264, "498454011879264e")+ , (806515533049393, "806515533049393e")+ , (1304969544928657, "1304969544928657e")+ , (2111485077978050, "2111485077978050e")+ , (3416454622906707, "3416454622906707e")+ , (5527939700884757, "5527939700884757e")+ , (8944394323791464, "8944394323791464e")+ , (14472334024676221, "14472334024676221e")+ , (23416728348467685, "23416728348467685e")+ , (37889062373143906, "37889062373143906e")+ , (61305790721611591, "61305790721611591e")+ , (99194853094755497, "99194853094755497e")+ , (160500643816367088, "160500643816367088e")+ , (259695496911122585, "259695496911122585e")+ , (420196140727489673, "420196140727489673e")+ , (679891637638612258, "679891637638612258e")+ , (1100087778366101931, "1100087778366101931e")+ , (1779979416004714189, "1779979416004714189e")+ , (2880067194370816120, "2880067194370816120e")+ , (4660046610375530309, "4660046610375530309e")+ , (7540113804746346429, "7540113804746346429e")+ , (12200160415121876738, "12200160415121876738e")+ , (19740274219868223167, "19740274219868223167e")+ , (31940434634990099905, "31940434634990099905e")+ , (51680708854858323072, "51680708854858323072e")+ , (83621143489848422977, "83621143489848422977e")+ , (135301852344706746049, "135301852344706746049e")+ , (218922995834555169026, "218922995834555169026e")+ , (354224848179261915075, "354224848179261915075e")+ , (573147844013817084101, "573147844013817084101e")+ , (927372692193078999176, "927372692193078999176e")+ , (1500520536206896083277, "1500520536206896083277e")+ , (2427893228399975082453, "2427893228399975082453e")+ , (3928413764606871165730, "3928413764606871165730e")+ , (6356306993006846248183, "6356306993006846248183e")+ , (10284720757613717413913, "10284720757613717413913e")+ , (16641027750620563662096, "16641027750620563662096e")+ , (26925748508234281076009, "26925748508234281076009e")+ , (43566776258854844738105, "43566776258854844738105e")+ , (70492524767089125814114, "70492524767089125814114e")+ , (114059301025943970552219, "114059301025943970552219e")+ , (1000, "1000e")+ , (10000, "10000e")+ , (100000, "100000e")+ , (1000000, "1000000e")+ , (10000000, "10000000e")+ , (100000000, "100000000e")+ , (1000000000, "1000000000e")+ , (10000000000, "10000000000e")+ , (100000000000, "100000000000e")+ , (1000000000000, "1000000000000e")+ , (10000000000000, "10000000000000e")+ , (100000000000000, "100000000000000e")+ , (1000000000000000, "1000000000000000e")+ , (10000000000000000, "10000000000000000e")+ , (100000000000000000, "100000000000000000e")+ , (1000000000000000000, "1000000000000000000e")+ , (10000000000000000000, "10000000000000000000e")+ , (100000000000000000000, "100000000000000000000e")+ , (1000000000000000000000, "1000000000000000000000e")+ , (10000000000000000000000, "10000000000000000000000e")+ , (100000000000000000000000, "100000000000000000000000e")+ , (1000000000000000000000000, "1000000000000000000000000e") ]
test/Text/Numerals/Languages/GermanSpec.hs view
@@ -9,7 +9,7 @@ import Text.Numerals.LanguageTest(testLanguage) spec :: Spec-spec = testLanguage "German" german cardinals ordinals+spec = testLanguage "German" german cardinals ordinals shortOrdinals cardinals :: [(Integer, Text)] cardinals = [@@ -663,4 +663,331 @@ , (10000000000000000000000, "zehntrilliardste") , (100000000000000000000000, "einhunderttrilliardste") , (1000000000000000000000000, "quadrillionste")+ ]++shortOrdinals :: [(Integer, Text)]+shortOrdinals = [+ (0, "0.")+ , (1, "1.")+ , (2, "2.")+ , (3, "3.")+ , (4, "4.")+ , (5, "5.")+ , (6, "6.")+ , (7, "7.")+ , (8, "8.")+ , (9, "9.")+ , (10, "10.")+ , (11, "11.")+ , (12, "12.")+ , (13, "13.")+ , (14, "14.")+ , (15, "15.")+ , (16, "16.")+ , (17, "17.")+ , (18, "18.")+ , (19, "19.")+ , (20, "20.")+ , (21, "21.")+ , (22, "22.")+ , (23, "23.")+ , (24, "24.")+ , (25, "25.")+ , (26, "26.")+ , (27, "27.")+ , (28, "28.")+ , (29, "29.")+ , (30, "30.")+ , (31, "31.")+ , (32, "32.")+ , (33, "33.")+ , (34, "34.")+ , (35, "35.")+ , (36, "36.")+ , (37, "37.")+ , (38, "38.")+ , (39, "39.")+ , (40, "40.")+ , (41, "41.")+ , (42, "42.")+ , (43, "43.")+ , (44, "44.")+ , (45, "45.")+ , (46, "46.")+ , (47, "47.")+ , (48, "48.")+ , (49, "49.")+ , (50, "50.")+ , (51, "51.")+ , (52, "52.")+ , (53, "53.")+ , (54, "54.")+ , (55, "55.")+ , (56, "56.")+ , (57, "57.")+ , (58, "58.")+ , (59, "59.")+ , (60, "60.")+ , (61, "61.")+ , (62, "62.")+ , (63, "63.")+ , (64, "64.")+ , (65, "65.")+ , (66, "66.")+ , (67, "67.")+ , (68, "68.")+ , (69, "69.")+ , (70, "70.")+ , (71, "71.")+ , (72, "72.")+ , (73, "73.")+ , (74, "74.")+ , (75, "75.")+ , (76, "76.")+ , (77, "77.")+ , (78, "78.")+ , (79, "79.")+ , (80, "80.")+ , (81, "81.")+ , (82, "82.")+ , (83, "83.")+ , (84, "84.")+ , (85, "85.")+ , (86, "86.")+ , (87, "87.")+ , (88, "88.")+ , (89, "89.")+ , (90, "90.")+ , (91, "91.")+ , (92, "92.")+ , (93, "93.")+ , (94, "94.")+ , (95, "95.")+ , (96, "96.")+ , (97, "97.")+ , (98, "98.")+ , (99, "99.")+ , (100, "100.")+ , (101, "101.")+ , (102, "102.")+ , (103, "103.")+ , (104, "104.")+ , (105, "105.")+ , (106, "106.")+ , (107, "107.")+ , (108, "108.")+ , (109, "109.")+ , (110, "110.")+ , (111, "111.")+ , (112, "112.")+ , (113, "113.")+ , (114, "114.")+ , (115, "115.")+ , (116, "116.")+ , (117, "117.")+ , (118, "118.")+ , (119, "119.")+ , (120, "120.")+ , (121, "121.")+ , (122, "122.")+ , (123, "123.")+ , (124, "124.")+ , (125, "125.")+ , (126, "126.")+ , (127, "127.")+ , (128, "128.")+ , (129, "129.")+ , (130, "130.")+ , (131, "131.")+ , (132, "132.")+ , (133, "133.")+ , (134, "134.")+ , (135, "135.")+ , (136, "136.")+ , (137, "137.")+ , (138, "138.")+ , (139, "139.")+ , (140, "140.")+ , (141, "141.")+ , (142, "142.")+ , (143, "143.")+ , (144, "144.")+ , (145, "145.")+ , (146, "146.")+ , (147, "147.")+ , (148, "148.")+ , (149, "149.")+ , (150, "150.")+ , (151, "151.")+ , (152, "152.")+ , (153, "153.")+ , (154, "154.")+ , (155, "155.")+ , (156, "156.")+ , (157, "157.")+ , (158, "158.")+ , (159, "159.")+ , (160, "160.")+ , (161, "161.")+ , (162, "162.")+ , (163, "163.")+ , (164, "164.")+ , (165, "165.")+ , (166, "166.")+ , (167, "167.")+ , (168, "168.")+ , (169, "169.")+ , (170, "170.")+ , (171, "171.")+ , (172, "172.")+ , (173, "173.")+ , (174, "174.")+ , (175, "175.")+ , (176, "176.")+ , (177, "177.")+ , (178, "178.")+ , (179, "179.")+ , (180, "180.")+ , (181, "181.")+ , (182, "182.")+ , (183, "183.")+ , (184, "184.")+ , (185, "185.")+ , (186, "186.")+ , (187, "187.")+ , (188, "188.")+ , (189, "189.")+ , (190, "190.")+ , (191, "191.")+ , (192, "192.")+ , (193, "193.")+ , (194, "194.")+ , (195, "195.")+ , (196, "196.")+ , (197, "197.")+ , (198, "198.")+ , (199, "199.")+ , (200, "200.")+ , (233, "233.")+ , (377, "377.")+ , (610, "610.")+ , (987, "987.")+ , (1597, "1597.")+ , (2584, "2584.")+ , (4181, "4181.")+ , (6765, "6765.")+ , (10946, "10946.")+ , (17711, "17711.")+ , (28657, "28657.")+ , (46368, "46368.")+ , (75025, "75025.")+ , (121393, "121393.")+ , (196418, "196418.")+ , (317811, "317811.")+ , (514229, "514229.")+ , (832040, "832040.")+ , (1346269, "1346269.")+ , (2178309, "2178309.")+ , (3524578, "3524578.")+ , (5702887, "5702887.")+ , (9227465, "9227465.")+ , (14930352, "14930352.")+ , (24157817, "24157817.")+ , (39088169, "39088169.")+ , (63245986, "63245986.")+ , (102334155, "102334155.")+ , (165580141, "165580141.")+ , (267914296, "267914296.")+ , (433494437, "433494437.")+ , (701408733, "701408733.")+ , (1134903170, "1134903170.")+ , (1836311903, "1836311903.")+ , (2971215073, "2971215073.")+ , (4807526976, "4807526976.")+ , (7778742049, "7778742049.")+ , (12586269025, "12586269025.")+ , (20365011074, "20365011074.")+ , (32951280099, "32951280099.")+ , (53316291173, "53316291173.")+ , (86267571272, "86267571272.")+ , (139583862445, "139583862445.")+ , (225851433717, "225851433717.")+ , (365435296162, "365435296162.")+ , (591286729879, "591286729879.")+ , (956722026041, "956722026041.")+ , (1548008755920, "1548008755920.")+ , (2504730781961, "2504730781961.")+ , (4052739537881, "4052739537881.")+ , (6557470319842, "6557470319842.")+ , (10610209857723, "10610209857723.")+ , (17167680177565, "17167680177565.")+ , (27777890035288, "27777890035288.")+ , (44945570212853, "44945570212853.")+ , (72723460248141, "72723460248141.")+ , (117669030460994, "117669030460994.")+ , (190392490709135, "190392490709135.")+ , (308061521170129, "308061521170129.")+ , (498454011879264, "498454011879264.")+ , (806515533049393, "806515533049393.")+ , (1304969544928657, "1304969544928657.")+ , (2111485077978050, "2111485077978050.")+ , (3416454622906707, "3416454622906707.")+ , (5527939700884757, "5527939700884757.")+ , (8944394323791464, "8944394323791464.")+ , (14472334024676221, "14472334024676221.")+ , (23416728348467685, "23416728348467685.")+ , (37889062373143906, "37889062373143906.")+ , (61305790721611591, "61305790721611591.")+ , (99194853094755497, "99194853094755497.")+ , (160500643816367088, "160500643816367088.")+ , (259695496911122585, "259695496911122585.")+ , (420196140727489673, "420196140727489673.")+ , (679891637638612258, "679891637638612258.")+ , (1100087778366101931, "1100087778366101931.")+ , (1779979416004714189, "1779979416004714189.")+ , (2880067194370816120, "2880067194370816120.")+ , (4660046610375530309, "4660046610375530309.")+ , (7540113804746346429, "7540113804746346429.")+ , (12200160415121876738, "12200160415121876738.")+ , (19740274219868223167, "19740274219868223167.")+ , (31940434634990099905, "31940434634990099905.")+ , (51680708854858323072, "51680708854858323072.")+ , (83621143489848422977, "83621143489848422977.")+ , (135301852344706746049, "135301852344706746049.")+ , (218922995834555169026, "218922995834555169026.")+ , (354224848179261915075, "354224848179261915075.")+ , (573147844013817084101, "573147844013817084101.")+ , (927372692193078999176, "927372692193078999176.")+ , (1500520536206896083277, "1500520536206896083277.")+ , (2427893228399975082453, "2427893228399975082453.")+ , (3928413764606871165730, "3928413764606871165730.")+ , (6356306993006846248183, "6356306993006846248183.")+ , (10284720757613717413913, "10284720757613717413913.")+ , (16641027750620563662096, "16641027750620563662096.")+ , (26925748508234281076009, "26925748508234281076009.")+ , (43566776258854844738105, "43566776258854844738105.")+ , (70492524767089125814114, "70492524767089125814114.")+ , (114059301025943970552219, "114059301025943970552219.")+ , (1000, "1000.")+ , (10000, "10000.")+ , (100000, "100000.")+ , (1000000, "1000000.")+ , (10000000, "10000000.")+ , (100000000, "100000000.")+ , (1000000000, "1000000000.")+ , (10000000000, "10000000000.")+ , (100000000000, "100000000000.")+ , (1000000000000, "1000000000000.")+ , (10000000000000, "10000000000000.")+ , (100000000000000, "100000000000000.")+ , (1000000000000000, "1000000000000000.")+ , (10000000000000000, "10000000000000000.")+ , (100000000000000000, "100000000000000000.")+ , (1000000000000000000, "1000000000000000000.")+ , (10000000000000000000, "10000000000000000000.")+ , (100000000000000000000, "100000000000000000000.")+ , (1000000000000000000000, "1000000000000000000000.")+ , (10000000000000000000000, "10000000000000000000000.")+ , (100000000000000000000000, "100000000000000000000000.")+ , (1000000000000000000000000, "1000000000000000000000000.") ]