java.lang.Object
de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.AlignmentXmlRepair

public class AlignmentXmlRepair extends Object
Class which helps to repair alignment files which are for example not correctly encoded. Thus it is not parsable by a stream parser.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • RESOURCE_ATTRIBUTE_PATTERN

      private static final Pattern RESOURCE_ATTRIBUTE_PATTERN
    • ESCAPED_AMPERSAND

      private static Pattern ESCAPED_AMPERSAND
  • Constructor Details

    • AlignmentXmlRepair

      public AlignmentXmlRepair()
  • Method Details

    • repairInPlace

      public static void repairInPlace(String alignmentFile)
      Repairs an alignment file inplace.
      Parameters:
      alignmentFile - The alignment file which should be repaired in place
    • repairInPlace

      public static void repairInPlace(File alignmentFile)
      Repairs an alignment file inplace.
      Parameters:
      alignmentFile - The alignment file which should be repaired in place
    • loadRepairedAlignment

      public static Alignment loadRepairedAlignment(File alignmentFile) throws IOException, SAXException
      Loads a repaired alignment.
      Parameters:
      alignmentFile - The alignment file
      Returns:
      the repaired alignment
      Throws:
      IOException - An IOException.
      SAXException - A SAXException.
    • repair

      public static String repair(File inFile)
      Repairs an alignment file.
      Parameters:
      inFile - The alignment file
      Returns:
      the repaired alignment as string.
    • repair

      public static void repair(String filePathAlignment, String filePathOut)
      Repairs an alignment file.
      Parameters:
      filePathAlignment - The alignment file
      filePathOut - The repaired alignment File
    • repair

      public static String repair(String text)
    • repair

      public static void repair(File inFile, File outFile)
      Repairs an alignment file.
      Parameters:
      inFile - The alignment file
      outFile - The repaired alignment File
    • repair

      public static void repair(InputStream in, OutputStream out)
      Repairs an alignment file.
      Parameters:
      in - The alignment stream
      out - The repaired alignment stream
    • repairXMLAttribute

      private static String repairXMLAttribute(String attribute)
    • repairAlignmentFolder

      public static void repairAlignmentFolder(File srcDir, File destDir)
      Copy all file from source to destionation directory. If a file within those directories ends with ".rdf", then this file is repaired with the repair function.
      Parameters:
      srcDir - a source directory which should contain some alignment files (for repairing)
      destDir - a destination directory where all files will be copied to