Number of input and output field
| Number of input field |
: |
One |
| Number of output field |
: |
One |
This transformation function is used to find the most similar match between streaming data and a reference file.
The parameters of this transformation function are:
- File Reference
The name and path of the reference file.
- Field Splitter
The delimiter used to separate fields in the reference file. If not specified, the default delimiter is a comma (,).
- Index Of Ref. Field
The index of the field in the reference file that will be used as the reference key. If not specified, it defaults to 0.
- Similarity Algorithm
The algorithm used to calculate text similarity. The available algorithms are:
- LongestCommonSubsequence
- Cosine
- Jaccard
- JaroWinkler
- Levenshtein
- Metaphone
- NeedlemanWunsch
- QGram
- SmithWaterman
- SorensenDice
- Soundex
For example, the contents of the stream data are as follows:
Desa2 Kec./Kab. Sidoarja Jawa Timur 52314
Desa3 Kec./Kab. Pemalang Kabupaten Pemalang Jawa Tengah 52314
Desa4 Kec./Kab. Beurem Aceh 5231
Desa5 Kec./Kab. Maluku 52311
Desa6 Kec./Kab. Maluku Utara 52314
Desa7 Prop. Sumatera Utara 5236
And the reference file (reference/provisi.txt) contains:
ACEH
BALI
BANTEN
BENGKULU
DI YOGYAKARTA
DKI JAKARTA
GORONTALO
JAMBI
JAWA BARAT
JAWA TENGAH
JAWA TIMUR
KALIMANTAN BARAT
KALIMANTAN SELATAN
KALIMANTAN TENGAH
KALIMANTAN TIMUR
KALIMANTAN UTARA
KEPULAUAN BANGKA BELITUNG
KEPULAUAN RIAU
LAMPUNG
MALUKU
MALUKU UTARA
NUSA TENGGARA BARAT
NUSA TENGGARA TIMUR
PAPUA
PAPUA BARAT
RIAU
SULAWESI BARAT
SULAWESI SELATAN
SULAWESI TENGAH
SULAWESI TENGGARA
SULAWESI UTARA
SUMATERA BARAT
SUMATERA SELATAN
SUMATERA UTARA
And the parameters are as follows:
- File reference : reference/provisi.txt
- field splitter : ,
- Index of ref. field : 0
- Similarity Algorithm : LongestCommonSubsequence
Then the result will be as follows:
JAWA TIMUR
JAWA TENGAH
ACEH
MALUKU
MALUKU UTARA
SUMATERA UTARA