|
14 | 14 | import java.util.HashMap;
|
15 | 15 | import java.util.HashSet;
|
16 | 16 | import java.util.List;
|
17 |
| -import java.util.Locale; |
18 | 17 | import java.util.Map;
|
19 | 18 | import java.util.Optional;
|
20 | 19 | import java.util.Set;
|
@@ -115,14 +114,14 @@ private static List<DataSetParameters> createDataSets(Map<Type,List<Path>> types
|
115 | 114 |
|
116 | 115 | // MKTODO what about other enrichment types?
|
117 | 116 | for(Path enrichment : types.get(Type.ENRICHMENT_GENERIC)) {
|
118 |
| - DataSetFiles files = new DataSetFiles(); |
119 |
| - files.setEnrichmentFileName1(enrichment.toAbsolutePath().toString()); |
120 |
| - |
121 | 117 | Optional<Path> closestExpr = findClosestMatch(enrichment, exprFiles);
|
122 | 118 | Optional<Path> closestRanks = findClosestMatch(enrichment, rankFiles);
|
123 | 119 | Optional<Path> closestClass = findClosestMatch(enrichment, clasFiles);
|
124 | 120 | Optional<Path> closestGmt = findClosestMatch(enrichment, gmtFiles);
|
125 | 121 |
|
| 122 | + DataSetFiles files = new DataSetFiles(); |
| 123 | + files.setEnrichmentFileName1(enrichment.toAbsolutePath().toString()); |
| 124 | + |
126 | 125 | closestExpr.ifPresent(path -> {
|
127 | 126 | exprFiles.remove(path);
|
128 | 127 | files.setExpressionFileName(path.toAbsolutePath().toString());
|
@@ -151,10 +150,10 @@ private static List<DataSetParameters> createDataSets(Map<Type,List<Path>> types
|
151 | 150 | private static Optional<Path> findClosestMatch(Path p, List<Path> candidates) {
|
152 | 151 | String pf = p.getFileName().toString();
|
153 | 152 |
|
154 |
| - Map<Path,Integer> scores = new HashMap<>(); |
| 153 | + Map<Path,Double> scores = new HashMap<>(); |
155 | 154 | for(Path candidate : candidates) {
|
156 | 155 | String filename = candidate.getFileName().toString();
|
157 |
| - int score1 = StringUtils.getFuzzyDistance(pf, filename, Locale.getDefault()); |
| 156 | + double score1 = StringUtils.getJaroWinklerDistance(pf, filename); |
158 | 157 | scores.put(candidate, score1);
|
159 | 158 | }
|
160 | 159 |
|
|
0 commit comments