<commit_before>{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes        #-}
{-# LANGUAGE TemplateHaskell   #-}

module Web.Stellar.Internal where

import           Control.Applicative
import           Control.Monad
import           Data.Aeson
import           Data.Monoid
import           Data.Text

data APIMoney = ExtractedText {
  innerMoney :: Text
} deriving (Show, Eq)

emptyAPIMoney :: APIMoney
emptyAPIMoney = ExtractedText mempty

instance FromJSON APIMoney where
  parseJSON (Object o) = do
    ExtractedText <$> (o .: "value")
  parseJSON (String s) = do
    return $ ExtractedText s
  parseJSON _ = mzero

data APICurrency = ExtractedCurrency {<commit_msg>refactoring api money/currency<commit_after>{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes        #-}
{-# LANGUAGE TemplateHaskell   #-}

module Web.Stellar.Internal where

import           Control.Applicative
import           Control.Monad
import           Data.Aeson
import           Data.Monoid
import           Data.Text

data APIMoney = ExtractedText {
  innerMoney :: Text
} deriving (Show, Eq)

emptyAPIMoney :: APIMoney
emptyAPIMoney = ExtractedText mempty

instance FromJSON APIMoney where
  parseJSON (Object o) = ExtractedText <$> (o .: "value")
  parseJSON (String s) = return $ ExtractedText s
  parseJSON _ = mzero

data APICurrency = ExtractedCurrency {
{'fraction_non_alphanumeric': 0.08621960206337509, 'fraction_numerical': 0.0, 'mean_word_length': 3.065868263473054, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6858703', 'n_tokens_mistral': 445, 'n_tokens_neox': 430, 'n_words': 112}