distance {LSAfun} | R Documentation |
Compute distance
Description
Computes distance metrics for two single words
Usage
distance(x,y,method="euclidean",tvectors=tvectors)
Arguments
x |
A single word, given as a character of |
y |
A single word, given as a character of |
method |
Specifies whether to compute |
tvectors |
the semantic space in which the computation is to be done (a numeric matrix where every row is a word vector) |
Details
Computes Minkowski metrics, i.e. geometric distances between the vectors for two given words. Possible options are euclidean
for the Euclidean Distance, d(x,y) = \sqrt{\sum{(x-y)^2}}
, and cityblock
for the City Block metric, d(x,y) = \sum{|x-y|}
Value
The distance value as a numeric
Author(s)
Fritz Guenther
See Also
Examples
data(wonderland)
distance("alice","rabbit",method="euclidean",tvectors=wonderland)
[Package LSAfun version 0.7.1 Index]