"String" (Comparison Method)

Compare two strings using any distance metric.

Details

Examples

open allclose all

Basic Examples  (3)

Create an AssessmentFunction for a string question:

Use it to assess an answer:

Define assessment for a DNA sequence with tolerance:

Any sequence within an EditDistance of two is considered correct:

Set multiple answer keys with custom scores and infer the string method:

Get more details from the result:

Scope  (2)

Perform category assessment involving strings:

Assess each element of a list separately:

Get the full result details:

Options  (2)

Set a custom tolerance:

Compute equivalent comparisons directly:

Using different distance metrics might produce different results:

Applications  (1)

Define a utility function to make BioSequenceComplement support DNA strings:

Create a QuestionObject for determining DNA complements allowing one mistake in each:

Properties & Relations  (1)

When an answer matches multiple values in the answer, the closest value is chosen:

Possible Issues  (2)

Some metrics only work when comparing strings with equal length:

The "String" comparison method is based on distances, not patterns. Matching of string patterns is not supported:

Instead, specify StringMatchQ as a custom comparator: