NlpTools API
Class

NlpTools\Similarity\HammingDistance

class HammingDistance implements DistanceInterface

This class implements the hamming distance of two strings or sets.

To be used with numbers one should pass the numbers to decbin() first
and make sure the smaller number is properly padded with zeros.

Methods

int dist(string $A, string $B)

Details

at line 19
public int dist(string $A, string $B)

Parameters

string $A
string $B

Return Value

int The hamming distance of the two strings A and B