distance {jiebaR}R Documentation

Hamming distance of words

Description

This function uses Simhash worker to do keyword extraction and finds the keywords from two inputs, and then computes Hamming distance between them.

Usage

distance(codel, coder, jiebar)

vector_distance(codel, coder, jiebar)

Arguments

codel

For distance, a Chinese sentence or the path of a text file, For vector_distance, a character vector of segmented words.

coder

For distance, a Chinese sentence or the path of a text file, For vector_distance, a character vector of segmented words.

jiebar

jiebaR worker

Author(s)

Qin Wenfeng

References

http://en.wikipedia.org/wiki/Hamming_distance

See Also

worker

Examples

## Not run: 

words = "hello world"
simhasher = worker("simhash", topn = 1)
simhasher <= words
distance("hello world" , "hello world!" , simhasher)

vector_distance(c("hello","world") , c("hello", "world","!") , simhasher)


## End(Not run)

[Package jiebaR version 0.11 Index]