Java Snippet iterate row calculation with String Similarity

Hi everyone,

Some of you have already helped me in a previous post regarding the usage of the Java library called java-string-similarity, which can be downloaded here.

The previous post helped me select the maximum between two matching text similarity scores. However, the columns “cNAMESONE” and “cNAMESTWO” must be organized so that each name in “cNAMESONE” is compared with each row in “cNAMESTWO”.

To achieve this, these columns must be organized to include all possible combinations for cross-referencing the data. I currently achieve this using the “Cross Joiner” node, but this method significantly increases the number of records.

Therefore, I am looking to code a more resource-efficient approach to achieve the following:

  1. Calculate matching scores for the first row of the “cNAMESONE” table against the entire “cNAMESTWO” table.

  2. Store the results in a temporary table, keeping only scores greater than 80% (“out_Max” > 80%).

  3. Repeat this process for each subsequent row in the “c_NAMESONE” table, appending results to the same temporary table.

I have attempted to implement the above solution, but I am encountering some errors. I would greatly appreciate any assistance.

Interation among rows.knwf

Thank you