예제 #1
0
  private String extractCompletePagesFromCitation(String completeCitation, String firstPage) {
    if (firstPage.isEmpty()) return "";

    String firstPagePrefix1 = firstPage + "�";
    String firstPagePrefix2 = firstPage + "-";

    String completePages = completeCitation.substring(completeCitation.lastIndexOf(firstPage));
    if (completePages.contains(","))
      completePages = completePages.substring(0, completePages.indexOf(",")).trim();
    //		comment: "–" != "-" !!!!
    else if (completeCitation.contains(firstPagePrefix1)) {
      completePages =
          completeCitation
              .substring(completeCitation.lastIndexOf(firstPagePrefix1) + firstPagePrefix1.length())
              .trim();
      completePages = ToolsUtil.getFirstStringOfNumbersInText(completePages);
      completePages = firstPage + "-" + completePages;
    } else if (completeCitation.contains(firstPagePrefix2)) {
      completePages =
          completeCitation
              .substring(completeCitation.lastIndexOf(firstPagePrefix2) + firstPagePrefix2.length())
              .trim();
      completePages = ToolsUtil.getFirstStringOfNumbersInText(completePages);
      completePages = firstPage + "-" + completePages;
    } else {
      completePages = firstPage;
    }

    return completePages;
  }
예제 #2
0
 private static void copyFiles() {
   String[] fileList =
       ToolsUtil.getListOfFileNames(
           "C:/Users/du/Projekte/SMAFIRA/git/data/html/fulltextWithReferences.txt");
   ToolsUtil.copyFiles(
       "C:/Users/du/Projekte/SMAFIRA/git/data/html/fulltexts",
       fileList,
       "C:/Users/du/Projekte/SMAFIRA/git/data/html/fulltextsWithRefs");
 }