Description
Return a literal symbol mismatch cost.
Discrete distances depend on the representation of symbols, sets and counts. A local mismatch or count update assumes the surrounding sequence or set bookkeeping is already correct.
Return a literal symbol mismatch cost.
When to use this tool
Use Distance: Discrete Symbol Mismatch Cost when checking a supplied discrete-distance contribution or update.
How to use the tool and how it works
- Enter left, right, mismatchCost. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Return a literal symbol mismatch cost. Require mismatchCost >= 0; cost is zero for exact left/right equality, otherwise mismatchCost; equal reports that comparison.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| left | Left | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| right | Right | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| mismatchCost | Mismatch Cost | Required. Finite number. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Returned object; expand its named members below. | Required. Object. |
| result.cost | Cost | Calculated result member: number. |
| result.equal | Equal | Calculated result member: boolean. |
{
"input": {
"left": "a",
"right": "b",
"mismatchCost": 2
},
"output": {
"result": {
"cost": 2,
"equal": false
}
}
} Limitations and assumptions
- No case folding, Unicode normalization or semantic equivalence is inferred.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use the full sequences or sets to establish the original distance and actual operation before applying a local update.
References
Similar or alternative tools
- Hamming Distance Single Symbol Update
Update a Hamming count after one symbol replacement.
- Bray Curtis Negative Input Domain Check
Inspect the supplied Bray-Curtis input domain.