distance: Hamming distance of words

Description Usage Arguments Author(s) References See Also Examples

View source: R/simhash.R

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

1
2
3
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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)

jiebaR documentation built on Dec. 16, 2019, 1:19 a.m.