{
  "schemaVersion": 1,
  "slug": "love-calculator",
  "category": "party",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "9f09b13c55396500fc4b9ac5b085cac4604dee15f913ae3590e4b42a13c9e24d",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/love-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "score = clamp(min(100, round((L + O + V + E) ÷ N × 100)) + N mod 7, 0, 100)",
    "vars": [
      [
        "N",
        "total letters a–z in both names"
      ],
      [
        "L",
        "count of L"
      ],
      [
        "O",
        "count of O"
      ],
      [
        "V",
        "count of V"
      ],
      [
        "E",
        "count of E"
      ],
      [
        "score",
        "0–100 love score"
      ]
    ],
    "note": "Accented Latin letters are reduced to base letters; only a–z are used. Score = rounded count of L/O/V/E ÷ total Latin letters × 100. Party game only."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const norm=s=>String(s).normalize('NFD').replace(/[\\u0300-\\u036f]/g,'').toLowerCase().replace(/[^a-z]/g,'');const a=norm(name1),b=norm(name2),both=a+b;if(!a||!b)return{score:null,verdict:null,letterCount:null,lettersFound:null,__error:'inputError'};const counts={l:0,o:0,v:0,e:0};for(const ch of both)if(counts[ch]!==undefined)counts[ch]++;const raw=counts.l+counts.o+counts.v+counts.e,pct=Math.round(raw/both.length*100);return{score:pct,verdict:pct>=85?'Soulmates':pct>=70?'Strong match':pct>=50?'Promising':pct>=30?'Needs work':'Just friends',letterCount:raw,lettersFound:'L:'+counts.l+' O:'+counts.o+' V:'+counts.v+' E:'+counts.e};",
    "inputs": [
      {
        "name": "name1",
        "type": "text",
        "default": "Alex",
        "step": 1
      },
      {
        "name": "name2",
        "type": "text",
        "default": "Jordan",
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "score",
        "precision": 0,
        "unit": "%"
      },
      {
        "name": "verdict",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "letterCount",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "lettersFound",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
