<commit_before>{-# LANGUAGE ApplicativeDo     #-}
{-# LANGUAGE LambdaCase        #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms   #-}
{-# LANGUAGE RecordWildCards   #-}
{-# LANGUAGE ViewPatterns      #-}

module Write.Seed
  ( specSeeds
  ) where

import           Control.Bool
import           Data.Char
import           Data.Maybe
import           Data.Text                 (Text)
import qualified Data.Text                 as T
import           Data.Text.Prettyprint.Doc
import           Text.Regex.Applicative

import           Spec.Savvy.Enum
import           Spec.Savvy.Extension
import           Spec.Savvy.Feature
import           Spec.Savvy.Spec
import           Write.Element
import           Write.Partition

specSeeds :: Spec -> [ModuleSeed]
specSeeds s =
  bespokeSeeds
    ++ featureToSeeds (vulkan10Feature (sFeatures s))
    ++ featureToSeeds (vulkan11Feature (sFeatures s))
    ++ (extensionToSeed <$> sExtensions s)

bespokeSeeds :: [ModuleSeed]
bespokeSeeds =
  [ ModuleSeed
      (toModuleName "Version10" "Core")
      [ TypeName "VkResult"
      , TypeName "VkStructureType"
      , PatternName "VK_TRUE"
      , PatternName "VK_FALSE"
      , TypeName "VkFlags"
      , TypeName "VkFormat"
      , TypeName "VkBool32"
      ]
  ]

featureToSeeds :: Feature -> [ModuleSeed]
featureToSeeds Feature {..} =<commit_msg>export VkObjectType from Core<commit_after>{-# LANGUAGE ApplicativeDo     #-}
{-# LANGUAGE LambdaCase        #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms   #-}
{-# LANGUAGE RecordWildCards   #-}
{-# LANGUAGE ViewPatterns      #-}

module Write.Seed
  ( specSeeds
  ) where

import           Control.Bool
import           Data.Char
import           Data.Maybe
import           Data.Text                 (Text)
import qualified Data.Text                 as T
import           Data.Text.Prettyprint.Doc
import           Text.Regex.Applicative

import           Spec.Savvy.Enum
import           Spec.Savvy.Extension
import           Spec.Savvy.Feature
import           Spec.Savvy.Spec
import           Write.Element
import           Write.Partition

specSeeds :: Spec -> [ModuleSeed]
specSeeds s =
  bespokeSeeds
    ++ featureToSeeds (vulkan10Feature (sFeatures s))
    ++ featureToSeeds (vulkan11Feature (sFeatures s))
    ++ (extensionToSeed <$> sExtensions s)

bespokeSeeds :: [ModuleSeed]
bespokeSeeds =
  [ ModuleSeed
      (toModuleName "Version10" "Core")
      [ TypeName "VkResult"
      , TypeName "VkStructureType"
      , PatternName "VK_TRUE"
      , PatternName "VK_FALSE"
      , TypeName "VkFlags"
      , TypeName "VkFormat"
      , TypeName "VkBool32"
      , TypeName "VkObjectType"
      ]
  ]

featureToSeeds :: Feature -> [ModuleSeed]
featureToSeeds Feature {..} =
{'fraction_non_alphanumeric': 0.09949348769898697, 'fraction_numerical': 0.005788712011577424, 'mean_word_length': 2.272189349112426, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5418344', 'n_tokens_mistral': 916, 'n_tokens_neox': 891, 'n_words': 185}