入力
strsimilarity_input| id |
src_text1 |
src_text2 |
tar_text |
| 1 |
astre |
astter |
aster |
| 2 |
hone |
fone |
phone |
| 3 |
acqiese |
acquire |
acquiesce |
| 4 |
AAAACCCCCGGGGA |
CCCGGGAACCAACC |
CCAGGGAAACCCAC |
| 5 |
alice |
allen |
allies |
| 6 |
angela |
angle |
angels |
| 7 |
senter |
center |
centre |
| 8 |
chef |
cheap |
chief |
| 9 |
circus |
circle |
circuit |
| 10 |
debt |
debut |
debris |
| 11 |
deal |
dell |
lead |
| 12 |
bare |
bear |
bear |
SQL呼び出し
SELECT * FROM StringSimilarity (
ON strsimilarity_input PARTITION BY ANY
USING
ComparisonColumnPairs ('jaro (src_text1, tar_text) AS jaro1_sim',
'LD (src_text1, tar_text) AS ld1_sim',
'n_gram (src_text1, tar_text, 2) AS ngram1_sim',
'jaro_winkler (src_text1, tar_text, 0.1) AS jw1_sim'
)
CaseSensitive ('true')
Accumulate ('id', 'src_text1', 'tar_text')
) AS dt ORDER BY id;
出力
列1~3| id |
src_text1 |
tar_text |
| 1 |
astre |
aster |
| 2 |
hone |
phone |
| 3 |
acqiese |
acquiesce |
| 4 |
AAAACCCCCGGGGA |
CCAGGGAAACCCAC |
| 5 |
alice |
allies |
| 6 |
angela |
angels |
| 7 |
senter |
centre |
| 8 |
chef |
chief |
| 9 |
circus |
circuit |
| 10 |
debt |
debris |
| 11 |
deal |
lead |
| 12 |
bare |
bear |
列4~7| jaro1_sim |
ld1_sim |
ngram1_sim |
jw1_sim |
| 0.933333333333333 |
0.6 |
0.5 |
0.953333333333333 |
| 0.933333333333333 |
0.8 |
0.75 |
0.933333333333333 |
| 0.925925925925926 |
0.777777777777778 |
0.5 |
0.948148148148148 |
| 0.824175824175824 |
0.214285714285714 |
0.384615384615385 |
0.824175824175824 |
| 0.822222222222222 |
0.5 |
0.4 |
0.857777777777778 |
| 0.888888888888889 |
0.833333333333333 |
0.8 |
0.933333333333333 |
| 0.822222222222222 |
0.5 |
0.4 |
0.822222222222222 |
| 0.933333333333333 |
0.8 |
0.5 |
0.946666666666667 |
| 0.849206349206349 |
0.714285714285714 |
0.666666666666667 |
0.90952380952381 |
| 0.75 |
0.5 |
0.4 |
0.825 |
| 0.666666666666667 |
0.5 |
0.333333333333333 |
0.666666666666667 |
| 0.833333333333333 |
0.5 |
0.333333333333333 |
0.85 |