Text Distance directive
The TEXT-DISTANCE directive measures the difference between two sequences of characters, using a specified method of measuring the distance between strings.
Syntax
text-distance 'method' :column1 :column2 :destinationmethodspecifies the method to be used to measure the distance between the strings ofcolumn1andcolumn2destinationis the column the resulting difference will be stored in. If it exists, it will be overwritten. If it does not exist, it will be created.
Note: If either or both of the two columns do not exist, no error will be returned, and the destination column will still be created or overwritten.
Usage Notes
These distance measure methods are supported:
block-distanceblockcosinedamerau-levenshteindiceeuclideangeneralized-jaccardidentityjaccardjarolevenshteinlongest-common-subsequencelongest-common-substringoverlap-cofficientsimon-white
Example
Using this record as an example:
{
"tweet1": "CheeseBurgers are God tellin us everything's gonna be cool...",
"tweet2": "Forgiveness can open up a whole new perspective on life, Forgiveness is an act of God's grace."
}Applying this directive:
text-distance 'block' :tweet1 :tweet2 :distanceresults in this record:
{
"tweet1": "CheeseBurgers are God tellin us everything's gonna be cool...",
"tweet2": "Forgiveness can open up a whole new perspective on life, Forgiveness is an act of God's grace."
"destination": 26.0
}
Created in 2020 by Google Inc.