<commit_before>_    = require \lodash
Cons = require "#{process.cwd!}/site/lib/model-constraints"
H    = require \./helper

exports.get-spec = (...args) ->
  const DMY1 = '20/10/1980'
  const  MY1 =    '10/1980'
  const   Y1 =       '1980'
  const DMY2 = '31/10/1990'
  const DMY3 = '01/11/1990'
  const DMY4 = '30/06/2014'
  const DMY5 = '01/07/2014'

  h = H \edge, ...args

  function get-spec-ab fields then h.get-spec \ab, fields
  function get-spec-ac fields then h.get-spec \ac, fields
  function get-spec-ba fields then h.get-spec \ba, fields
  function get-spec-bc fields then h.get-spec \bc, fields

  ab: _.extend do
    get-spec-ab!
    is:
      eq: get-spec-ab a_is:\eq
      gt: get-spec-ab a_is:\gt
      lt: get-spec-ab a_is:\lt
    how:
      number: get-spec-ab how:'7 voting members'
      symbol: get-spec-ab how:'founder, co-chair &/or CEO'
      max   : get-spec-ab how:\x * 50
      max-gt: get-spec-ab how:\x * 51
      min   : get-spec-ab how:\xx
      min-lt: get-spec-ab how:\x
    when:
      null: get-spec-ab when:''
      from:
        dmy: get-spec-ab when:"#DMY1-"
        my : get-spec-ab when:"#MY1-"
        y  : get-spec-ab when:"#Y1-"
        bad: get-spec-ab when:'32/10/2000-'
      to:
        dmy: get-spec-ab when:"-#DMY1"
        my : get-spec-ab when:"-#MY1"
        y  : get-spec-ab when:"-#Y1"
        bad: get-spec-ab when:'-01/13/2000'
      DMY1-DMY2: get-spec-ab when:"#DMY1-#DMY2"<commit_msg>refactor<commit_after>_    = require \lodash
Cons = require "#{process.cwd!}/site/lib/model-constraints"
H    = require \./helper

exports.get-spec = (...args) ->
  const DMY1 = '20/10/1980'
  const  MY1 =    '10/1980'
  const   Y1 =       '1980'
  const DMY2 = '31/10/1990'
  const DMY3 = '01/11/1990'
  const DMY4 = '30/06/2014'
  const DMY5 = '01/07/2014'

  h = H \edge ...args

  function get-spec-ab fields then h.get-spec \ab fields
  function get-spec-ac fields then h.get-spec \ac fields
  function get-spec-ba fields then h.get-spec \ba fields
  function get-spec-bc fields then h.get-spec \bc fields

  ab: _.extend do
    get-spec-ab!
    is:
      eq: get-spec-ab a_is:\eq
      gt: get-spec-ab a_is:\gt
      lt: get-spec-ab a_is:\lt
    how:
      number: get-spec-ab how:'7 voting members'
      symbol: get-spec-ab how:'founder, co-chair &/or CEO'
      max   : get-spec-ab how:\x * 50
      max-gt: get-spec-ab how:\x * 51
      min   : get-spec-ab how:\xx
      min-lt: get-spec-ab how:\x
    when:
      null: get-spec-ab when:''
      from:
        dmy: get-spec-ab when:"#DMY1-"
        my : get-spec-ab when:"#MY1-"
        y  : get-spec-ab when:"#Y1-"
        bad: get-spec-ab when:'32/10/2000-'
      to:
        dmy: get-spec-ab when:"-#DMY1"
        my : get-spec-ab when:"-#MY1"
        y  : get-spec-ab when:"-#Y1"
        bad: get-spec-ab when:'-01/13/2000'
      DMY1-DMY2: get-spec-ab when:"#DMY1-#DMY2"
{'fraction_non_alphanumeric': 0.16493055555555555, 'fraction_numerical': 0.06111111111111111, 'mean_word_length': 1.9670442842430484, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5605224', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1158, 'n_words': 273}