test_class.file: common/src/test/java/uk/ac/kcl/iop/brc/core/pipeline/common/utils/StringToolsTest.java
test_class.identifier: StringToolsTest
test_case.body: @Test
      public void shouldGetTheFirstHtmlWithContent() {
          String html = "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
                  "<head>\n" +
                  "<meta name=\"X-Parsed-By\" content=\"org.apache.tika.parser.DefaultParser\" />\n" +
                  "<meta name=\"X-Parsed-By\" content=\"org.apache.tika.parser.ocr.TesseractOCRParser\" />\n" +
                  "<meta name=\"Content-Type\" content=\"image/tiff\" />\n" +
                  "<title></title>\n" +
                  "</head>\n" +
                  "<body><div>Replace this ﬁle with prentcsmacro . sty for your meeting,\n" +
                  "or with entcsinacro.st for your meeting. Both can be\n" +
                  "found at the LN l‘CS l\\= acro Home Page.\n" +
                  "\n" +
                  "An Example Paper\n" +
                  "\n" +
                  "My Name 1'2\n" +
                  "\n" +
                  "My Department\n" +
                  "My Um‘ver.s‘-ity\n" +
                  "My City, My Country\n" +
                  "\n" +
                  "My Co—author 3\n" +
                  "\n" +
                  "My Co-author's Department\n" +
                  "M y C 0- auth or \"5 Umvve rs-2' ty\n" +
                  "My Co—a.uthor'.s‘ City, My Co—aut/z0r's Country\n" +
                  "\n" +
                  "Abstract\n" +
                  "\n" +
                  "This is a short example to show the basics of using the TSNTCS style macro ﬁles.\n" +
                  "Ample examples of how ﬁles should look may be found among the published volumes\n" +
                  "of the series at the ENTCS Home Page http://www.elsevier.n1/locate/entcs.\n" +
                  "\n" +
                  "Key words: Please list keywords from your paper here, separated\n" +
                  "by commas.\n" +
                  "\n" +
                  "1 Introduction\n" +
                  "\n" +
                  "This short note provides a guide to using the ENTCS macro package for\n" +
                  "preparing papers for publication in your conference Proceedings. The Pro-\n" +
                  "ceedings may be printed and hard copies distributed to participants at the\n" +
                  "meeting; this is an option to Conference Organizers may choose to exercise.\n" +
                  "The Proceedings also will be par of a volume in the series Electronic Notes\n" +
                  "272. Theoretical Computer .S'cz'en.ce (ILNTCS), which is published under the aus-\n" +
                  "pices of Elsevier Science B. V., the publishers of ’1'heoretz'cal Computer Science.\n" +
                  "It’s home page is http://www.e1sevier.nl/locate/entcs\n" +
                  "The l£l\\'TCS macro package consists of two ﬁles:\n" +
                  "\n" +
                  "entcs.c1s, the basic style ﬁle, and\n" +
                  "\n" +
                  "</div>\n" +
                  "</body></html><html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
                  "<head>\n" +
                  "<meta name=\"Compression\" content=\"Uncompressed\" />\n" +
                  "<meta name=\"tiff:ImageLength\" content=\"3508\" />\n" +
                  "<meta name=\"Samples Per Pixel\" content=\"4 samples/pixel\" />\n" +
                  "<meta name=\"tiff:ImageWidth\" content=\"2480\" />\n" +
                  "<meta name=\"tiff:YResolution\" content=\"300.0\" />\n" +
                  "<meta name=\"Bits Per Sample\" content=\"8 8 8 8 bits/component/pixel\" />\n" +
                  "<meta name=\"Y Resolution\" content=\"300 dots per (no unit)\" />\n" +
                  "<title></title>\n" +
                  "</head>\n" +
                  "<body /></html>";
  
          String firstHtmlWithContent = StringTools.getFirstHtmlWithContent(html);
  
          assertThat(firstHtmlWithContent.contains("short note provides"), equalTo(true));
          assertThat(firstHtmlWithContent.contains("Y Resolution"), equalTo(false));
      }
test_case.class_method_signature: StringToolsTest.shouldGetTheFirstHtmlWithContent()
test_case.full_signature: @Test public void shouldGetTheFirstHtmlWithContent()
test_case.identifier: shouldGetTheFirstHtmlWithContent
test_case.invocations: getFirstHtmlWithContent assertThat contains equalTo assertThat contains equalTo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldGetTheFirstHtmlWithContent()
focal_class.declarator: maleNames = new ArrayList<>()
focal_class.modifier: private static
focal_class.original_string: private static List<String> maleNames = new ArrayList<>();
focal_class.type: List<String>
focal_class.var_name: maleNames
focal_class.declarator: femaleNames = new ArrayList<>()
focal_class.modifier: private static
focal_class.original_string: private static List<String> femaleNames = new ArrayList<>();
focal_class.type: List<String>
focal_class.var_name: femaleNames
focal_class.declarator: lastNames = new ArrayList<>()
focal_class.modifier: private static
focal_class.original_string: private static List<String> lastNames = new ArrayList<>();
focal_class.type: List<String>
focal_class.var_name: lastNames
focal_class.file: common/src/main/java/uk/ac/kcl/iop/brc/core/pipeline/common/utils/StringTools.java
focal_class.identifier: StringTools
focal_class.class_method_signature: StringTools.getLevenshteinDistance(String str1, String str2)
focal_class.full_signature: public static int getLevenshteinDistance(String str1, String str2)
focal_class.identifier: getLevenshteinDistance
focal_class.modifiers: public static
focal_class.parameters: (String str1, String str2)
focal_class.return: int
focal_class.signature: int getLevenshteinDistance(String str1, String str2)
focal_class.class_method_signature: StringTools.getApproximatelyMatchingStringList(String sourceString, String search)
focal_class.full_signature: public static Set<String> getApproximatelyMatchingStringList(String sourceString, String search)
focal_class.identifier: getApproximatelyMatchingStringList
focal_class.modifiers: public static
focal_class.parameters: (String sourceString, String search)
focal_class.return: Set<String>
focal_class.signature: Set<String> getApproximatelyMatchingStringList(String sourceString, String search)
focal_class.class_method_signature: StringTools.isNotTooShort(String string)
focal_class.full_signature: public boolean isNotTooShort(String string)
focal_class.identifier: isNotTooShort
focal_class.modifiers: public
focal_class.parameters: (String string)
focal_class.return: boolean
focal_class.signature: boolean isNotTooShort(String string)
focal_class.class_method_signature: StringTools.getApproximatelyMatchingStringList(String sourceString, String search, int maxDistance)
focal_class.full_signature: public static Set<String> getApproximatelyMatchingStringList(String sourceString, String search, int maxDistance)
focal_class.identifier: getApproximatelyMatchingStringList
focal_class.modifiers: public static
focal_class.parameters: (String sourceString, String search, int maxDistance)
focal_class.return: Set<String>
focal_class.signature: Set<String> getApproximatelyMatchingStringList(String sourceString, String search, int maxDistance)
focal_class.class_method_signature: StringTools.getMaxAllowedLevenshteinDistanceFor(String word)
focal_class.full_signature: protected static int getMaxAllowedLevenshteinDistanceFor(String word)
focal_class.identifier: getMaxAllowedLevenshteinDistanceFor
focal_class.modifiers: protected static
focal_class.parameters: (String word)
focal_class.return: int
focal_class.signature: int getMaxAllowedLevenshteinDistanceFor(String word)
focal_class.class_method_signature: StringTools.getCompletingString(String string, int begin, int end)
focal_class.full_signature: public static String getCompletingString(String string, int begin, int end)
focal_class.identifier: getCompletingString
focal_class.modifiers: public static
focal_class.parameters: (String string, int begin, int end)
focal_class.return: String
focal_class.signature: String getCompletingString(String string, int begin, int end)
focal_class.class_method_signature: StringTools.getMatchingWindowsAboveThreshold(String text, String search, double threshold)
focal_class.full_signature: public static List<MatchingWindow> getMatchingWindowsAboveThreshold(String text, String search, double threshold)
focal_class.identifier: getMatchingWindowsAboveThreshold
focal_class.modifiers: public static
focal_class.parameters: (String text, String search, double threshold)
focal_class.return: List<MatchingWindow>
focal_class.signature: List<MatchingWindow> getMatchingWindowsAboveThreshold(String text, String search, double threshold)
focal_class.class_method_signature: StringTools.takeBag(String[] textWords, int startWordIndex, int bagSize)
focal_class.full_signature: private static MatchingWindow takeBag(String[] textWords, int startWordIndex, int bagSize)
focal_class.identifier: takeBag
focal_class.modifiers: private static
focal_class.parameters: (String[] textWords, int startWordIndex, int bagSize)
focal_class.return: MatchingWindow
focal_class.signature: MatchingWindow takeBag(String[] textWords, int startWordIndex, int bagSize)
focal_class.class_method_signature: StringTools.splitIntoWordsWithLengthHigherThan(String string, int minLength)
focal_class.full_signature: public static Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength)
focal_class.identifier: splitIntoWordsWithLengthHigherThan
focal_class.modifiers: public static
focal_class.parameters: (String string, int minLength)
focal_class.return: Set<String>
focal_class.signature: Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength)
focal_class.class_method_signature: StringTools.splitIntoWordsWithLengthHigherThan(String string, int minLength, String... ignoreWords)
focal_class.full_signature: public static Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength, String... ignoreWords)
focal_class.identifier: splitIntoWordsWithLengthHigherThan
focal_class.modifiers: public static
focal_class.parameters: (String string, int minLength, String... ignoreWords)
focal_class.return: Set<String>
focal_class.signature: Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength, String... ignoreWords)
focal_class.class_method_signature: StringTools.noContentInHtml(String text)
focal_class.full_signature: public static boolean noContentInHtml(String text)
focal_class.identifier: noContentInHtml
focal_class.modifiers: public static
focal_class.parameters: (String text)
focal_class.return: boolean
focal_class.signature: boolean noContentInHtml(String text)
focal_class.class_method_signature: StringTools.getRegexMatchesWithMinLength(String text, String regex, int minLength)
focal_class.full_signature: public static List<String> getRegexMatchesWithMinLength(String text, String regex, int minLength)
focal_class.identifier: getRegexMatchesWithMinLength
focal_class.modifiers: public static
focal_class.parameters: (String text, String regex, int minLength)
focal_class.return: List<String>
focal_class.signature: List<String> getRegexMatchesWithMinLength(String text, String regex, int minLength)
focal_class.class_method_signature: StringTools.getRandomForeName()
focal_class.full_signature: public static String getRandomForeName()
focal_class.identifier: getRandomForeName
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getRandomForeName()
focal_class.class_method_signature: StringTools.getRandomSurname()
focal_class.full_signature: public static String getRandomSurname()
focal_class.identifier: getRandomSurname
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getRandomSurname()
focal_class.class_method_signature: StringTools.loadSurnames()
focal_class.full_signature: private static void loadSurnames()
focal_class.identifier: loadSurnames
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void loadSurnames()
focal_class.class_method_signature: StringTools.loadFemaleNames()
focal_class.full_signature: private static void loadFemaleNames()
focal_class.identifier: loadFemaleNames
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void loadFemaleNames()
focal_class.class_method_signature: StringTools.loadMaleNames()
focal_class.full_signature: private static void loadMaleNames()
focal_class.identifier: loadMaleNames
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void loadMaleNames()
focal_class.class_method_signature: StringTools.getFirstHtmlWithContent(String html)
focal_class.full_signature: public static String getFirstHtmlWithContent(String html)
focal_class.identifier: getFirstHtmlWithContent
focal_class.modifiers: public static
focal_class.parameters: (String html)
focal_class.return: String
focal_class.signature: String getFirstHtmlWithContent(String html)
focal_class.class_method_signature: StringTools.getMetaDataFromHTML(String html)
focal_class.full_signature: public static String getMetaDataFromHTML(String html)
focal_class.identifier: getMetaDataFromHTML
focal_class.modifiers: public static
focal_class.parameters: (String html)
focal_class.return: String
focal_class.signature: String getMetaDataFromHTML(String html)
focal_class.class_method_signature: StringTools.addMetaDataToHtml(String htmlText, String metaData)
focal_class.full_signature: public static String addMetaDataToHtml(String htmlText, String metaData)
focal_class.identifier: addMetaDataToHtml
focal_class.modifiers: public static
focal_class.parameters: (String htmlText, String metaData)
focal_class.return: String
focal_class.signature: String addMetaDataToHtml(String htmlText, String metaData)
focal_method.body: public static String getFirstHtmlWithContent(String html) {
          String[] split = html.split("<html");
          for (String htmlPart : split) {
              if (noContentInHtml(htmlPart)) {
                  continue;
              }
  
              return String.format("%s%s", "<html", htmlPart);
          }
  
          return "";
      }
focal_method.class_method_signature: StringTools.getFirstHtmlWithContent(String html)
focal_method.full_signature: public static String getFirstHtmlWithContent(String html)
focal_method.identifier: getFirstHtmlWithContent
focal_method.invocations: split noContentInHtml format
focal_method.modifiers: public static
focal_method.parameters: (String html)
focal_method.return: String
focal_method.signature: String getFirstHtmlWithContent(String html)