BinaryComp {comparator}R Documentation

Binary String/Sequence Comparator

Description

Compares a pair of strings or sequences based on whether they are identical or not.

Usage

BinaryComp(score = 1, similarity = FALSE, ignore_case = FALSE)

Arguments

score

a numeric of length 1. Positive distance to return if the pair of strings/sequences are not identical. Defaults to 1.0.

similarity

a logical. If TRUE, similarities are returned instead of distances. Specifically score is returned if the strings agree, and 0.0 is returned otherwise.

ignore_case

a logical. If TRUE, case is ignored when comparing strings.

Details

If similarity = FALSE (default) the scores can be interpreted as distances. When x = y the comparator returns a distance of 0.0, and when x \neq y the comparator returns score.

If similarity = TRUE the scores can be interpreted as similarities. When x = y the comparator returns score, and when x \neq y the comparator returns 0.0.

Value

A BinaryComp instance is returned, which is an S4 class inheriting from StringComparator.


[Package comparator version 0.1.2 Index]