Mercurial > hg > anteater
comparison src/de/mpiwg/anteater/ml/SimilarityHelper.java @ 4:dcc35f89dce3
include linneaus findings
author | jdamerow |
---|---|
date | Thu, 25 Oct 2012 15:25:08 -0700 |
parents | 036535fcd179 |
children |
comparison
equal
deleted
inserted
replaced
3:ae96e4bc7fb2 | 4:dcc35f89dce3 |
---|---|
11 * @return biggest substring contained in both strings | 11 * @return biggest substring contained in both strings |
12 */ | 12 */ |
13 public static String getBiggestSubstring(String s1, String s2) { | 13 public static String getBiggestSubstring(String s1, String s2) { |
14 String sub = s1; | 14 String sub = s1; |
15 int j = s1.length(); | 15 int j = s1.length(); |
16 | |
17 if (s1 == null || s2 == null) | |
18 return ""; | |
16 | 19 |
17 String subString = ""; | 20 String subString = ""; |
18 String comparingString = s2; | 21 String comparingString = s2; |
19 while (j >= 0) { | 22 while (j >= 0) { |
20 for (int i = 0; i < j; i++) { | 23 for (int i = 0; i < j; i++) { |