GetTheMostSimilar Function

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

Then the result will be as follows:
    JAWA TIMUR
    JAWA TENGAH
    ACEH
    MALUKU
    MALUKU UTARA
    SUMATERA UTARA