<commit_before>module Config

open Argu
open FSharp.Configuration
open Util

module Args =
    open System

    type SortOrder =
        | Ascending
        | Descending

    type Arguments =
        | [<AltCommandLine("-p")>] Threshold  of percentage:float
        | [<AltCommandLine("-t")>] UpdateTime of minutes:float
        | [<AltCommandLine("-s")>] Sort       of SortOrder
        with
            interface IArgParserTemplate with
                member s.Usage =
                    match s with
                    | Threshold  _ -> "specify the percentage jump required to show a feed"
                    | UpdateTime _ -> "specify the minutes between updates (must be >= 5)"
                    | Sort       _ -> "specify the order feeds will be displayed in"

    let tryParse args =
        let parser = ArgumentParser.Create<Arguments>()
        try
            Success (parser, parser.Parse args)
        with
        | :? ArguParseException ->
            Failure (parser.PrintUsage())
        | ex -> Failure ex.Message

    let get (value : Quotations.Expr<('Field -> _)>) def (results : ParseResults<_>) =
        results.GetResult(value, defaultValue = def)

type Config = YamlConfig<"Config.yaml">
let config  = Config()<commit_msg>Remove unused binding<commit_after>module Config

open Argu
open FSharp.Configuration
open Util

module Args =
    open System

    type SortOrder =
        | Ascending
        | Descending

    type Arguments =
        | [<AltCommandLine("-p")>] Threshold  of percentage:float
        | [<AltCommandLine("-t")>] UpdateTime of minutes:float
        | [<AltCommandLine("-s")>] Sort       of SortOrder
        with
            interface IArgParserTemplate with
                member s.Usage =
                    match s with
                    | Threshold  _ -> "specify the percentage jump required to show a feed"
                    | UpdateTime _ -> "specify the minutes between updates (must be >= 5)"
                    | Sort       _ -> "specify the order feeds will be displayed in"

    let tryParse args =
        let parser = ArgumentParser.Create<Arguments>()
        try
            Success (parser, parser.Parse args)
        with
        | :? ArguParseException ->
            Failure (parser.PrintUsage())
        | ex -> Failure ex.Message

    let get (value : Quotations.Expr<('Field -> _)>) def (results : ParseResults<_>) =
        results.GetResult(value, defaultValue = def)

type Config = YamlConfig<"Config.yaml">
{'fraction_non_alphanumeric': 0.09338677354709418, 'fraction_numerical': 0.0008016032064128256, 'mean_word_length': 1.96437054631829, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 31, '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': '5580130', 'n_tokens_mistral': 666, 'n_tokens_neox': 635, 'n_words': 200}