<commit_before>module Network.CrawlChain.CrawlDirective where

import Network.CrawlChain.CrawlAction
import Network.CrawlChain.CrawlResult

data CrawlDirective =
    SimpleDirective (String -> [CrawlAction])          -- | access content to find absolute follow-up urls
  | RelativeDirective (String -> [CrawlAction])        -- | as simple, but found relative urls are completed
  | FollowUpDirective (CrawlResult -> [CrawlAction])   -- | as simple, but with access to complete result
  | DelayDirective Int CrawlDirective                  -- | wait additional seconds before executing
  | RetryDirective Int CrawlDirective                  -- | if given directive yields no results use add. retries
  | AlternativeDirective CrawlDirective CrawlDirective -- | fallback to second argument if first yields no results
  | RestartChainDirective (CrawlAction, CrawlDirective)-- | the possibility to start a new chain (when using alternative)
  | GuardDirective (CrawlAction -> Bool)               -- | not crawling anything, just a blacklisting option
  | DirectiveSequence [CrawlDirective]                 -- | chaining of directives
<commit_msg>Fix hackage documentation of CrawlDirective<commit_after>module Network.CrawlChain.CrawlDirective where

import Network.CrawlChain.CrawlAction
import Network.CrawlChain.CrawlResult

data CrawlDirective =
    SimpleDirective (String -> [CrawlAction])
    -- ^ access content to find absolute follow-up urls
  | RelativeDirective (String -> [CrawlAction])
    -- ^ as simple, but found relative urls are completed
  | FollowUpDirective (CrawlResult -> [CrawlAction])
    -- ^ as simple, but with access to complete result
  | DelayDirective Int CrawlDirective
    -- ^ wait additional seconds before executing
  | RetryDirective Int CrawlDirective
    -- ^ if given directive yields no results use add. retries
  | AlternativeDirective CrawlDirective CrawlDirective
    -- ^ fallback to second argument if first yields no results
  | RestartChainDirective (CrawlAction, CrawlDirective)
    -- ^ the possibility to start a new chain (when using alternative)
  | GuardDirective (CrawlAction -> Bool)
    -- ^ not crawling anything, just a blacklisting option
  | DirectiveSequence [CrawlDirective]
    -- ^ chaining of directives

{'fraction_non_alphanumeric': 0.06969563299514778, 'fraction_numerical': 0.0, 'mean_word_length': 3.6285714285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4541787', 'n_tokens_mistral': 627, 'n_tokens_neox': 582, 'n_words': 206}