Skip to content

Commit

Permalink
Just some information
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuchss committed Sep 26, 2024
1 parent a4abbab commit 1af8a8d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ protected void process() {
buildModel(componentNames);
}

private static List<String> mergeViaSimilarity(List<String> componentNamesDocumentation, List<String> componentNamesCode) {
private List<String> mergeViaSimilarity(List<String> componentNamesDocumentation, List<String> componentNamesCode) {
WordSimUtils simUtils = new WordSimUtils();
simUtils.setMeasures(Collections.singletonList(new LevenshteinMeasure(CommonTextToolsConfig.LEVENSHTEIN_MIN_LENGTH,
CommonTextToolsConfig.LEVENSHTEIN_MAX_DISTANCE, 0.8)));
CommonTextToolsConfig.LEVENSHTEIN_MAX_DISTANCE, 0.5)));
List<String> componentNames = new ArrayList<>();
for (String componentName : Stream.concat(componentNamesDocumentation.stream(), componentNamesCode.stream()).toList()) {
if (componentNames.stream().noneMatch(it -> simUtils.areWordsSimilar(it, componentName))) {
componentNames.add(componentName);
} else {
logger.info("Similar component name found (skipping): {}", componentName);
}
}
return componentNames;
Expand Down

0 comments on commit 1af8a8d

Please sign in to comment.