Learn R Programming

jiebaR (version 0.11)

distance: 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

References

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

See Also

worker

Examples

Run this code
# 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)

# }

Run the code above in your browser using DataLab