<commit_before>    module StringUtils
    use MiscUtils
    use MpiUtils
    implicit none


    INTERFACE RealToStr
    module procedure SingleToStr, DoubleToStr
    END INTERFACE RealToStr

    contains

    function IsWhiteSpace(C)
    character, intent(in) :: C
    logical IsWhiteSpace

    IsWhiteSpace = (C==' ') .or. (C==char(9))

    end function IsWhiteSpace

    function GetParamCount()
    integer GetParamCount

    GetParamCount = command_argument_count()

    end function GetParamCount

    function GetParam(i)
    character(LEN=:), allocatable :: GetParam
    integer, intent(in) :: i
    character(LEN=:), allocatable :: tmp
    integer l

    if (GetParamCount() < i) then
        GetParam = ''
    else
        call get_command_argument(i,length=l)
        allocate(character(l)::tmp)
        call get_command_argument(i,value=tmp)
        GetParam = trim(tmp)
    end if

    end function GetParam

    function GetEnvironmentVariable(name, is_present) result(value)<commit_msg>added upper and lower case functions<commit_after>    module StringUtils
    use MiscUtils
    use MpiUtils
    implicit none

    character(26), parameter, private :: AlphUpper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    character(26), parameter, private :: AlphLower = 'abcdefghijklmnopqrstuvwxyz'


    INTERFACE RealToStr
    module procedure SingleToStr, DoubleToStr
    END INTERFACE RealToStr

    contains

    function IsWhiteSpace(C)
    character, intent(in) :: C
    logical IsWhiteSpace

    IsWhiteSpace = (C==' ') .or. (C==char(9))

    end function IsWhiteSpace

    function UpperCase(str) result (string)
    !   Changes an ascii string to upper case
    ! https://stackoverflow.com/questions/10759375/how-can-i-write-a-to-upper-or-to-lower-function-in-f90
    character(*), Intent(In) :: str
    character(LEN(str))      :: string
    Integer :: ic, i

    string = str
    do i = 1, LEN_TRIM(str)
        ic = INDEX(AlphLower, str(i:i))
        if (ic > 0) string(i:i) = AlphUpper(ic:ic)
    end do

    end Function UpperCase

    function LowerCase(str) result (string)
    !https://stackoverflow.com/questions/10759375/how-can-i-write-a-to-upper-or-to-lower-function-in-f90
    Character(*), Intent(In) :: str
    Character(LEN(str))      :: string
    Integer :: ic, i

    string = str
    do i = 1, LEN_TRIM(str)
        ic = INDEX(AlphUpper, str(i:i))
        if (ic > 0) string(i:i) = AlphLower(ic:ic)
    end do

    end Function LowerCase


    function GetParamCount()
    integer GetParamCount

    GetParamCount = command_argument_count()

    end function GetParamCount

    function GetParam(i)
    character(LEN=:), allocatable :: GetParam
    integer, intent(in) :: i
    character(LEN=:), allocatable :: tmp
    integer l

    if (GetParamCount() < i) then
        GetParam = ''
    else
        call get_command_argument(i,length=l)
        allocate(character(l)::tmp)
        call get_command_argument(i,value=tmp)
        GetParam = trim(tmp)
    end if

    end function GetParam

    function GetEnvironmentVariable(name, is_present) result(value)
{'fraction_non_alphanumeric': 0.10025957170668397, 'fraction_numerical': 0.00973393900064893, 'mean_word_length': 2.957637997432606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '754646', 'n_tokens_mistral': 1018, 'n_tokens_neox': 956, 'n_words': 239}