edu.northwestern.at.morphadorner.tools.adornedtotcf

## Class AdornedToTCF04

- java.lang.Object
- - edu.northwestern.at.morphadorner.tools.adornedtotcf.AdornedToTCF04

-     public class AdornedToTCF04
      extends java.lang.Object

  Converts adorned files to TCF 0.4 format.

  AdornedToTCF04 converts one or more adorned files to the Text Corpus Format (TCF) v0.4 used by the CLARIN-D project.

  Usage:

  > `adornedtotcf04 outputdirectory adorned1.xml adorned2.xml ...`

  where

  - outputdirectory specifies the output directory to receive the TCF v0.4 formatted files.
  - adorned1.xml adorned2.xml ... specifies the input MorphAdorned XML files from which to produce the TCF v0.4 versions.

  The Text Corpus Format (TCF) is used by the European CLARIN-D project to allow interchange of corpora among different web-based services. TCF is an XML-based format which consists of a plain text representation of a work along with a series of annotation layers.

  AdornedToTCF04 converts one or more MorphAdorned TEI XML files to TCF format. The text (without tags) is extracted and output, along with the following annotation layers:

  - Tokens (using the MorphAdorner word IDs)
  - Lemmata
  - Part of speech tags
  - Sentences

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AdornedToTCF04.MyToken`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static int` | `currentDocNumber` Current document.
    `protected static int` | `docsToProcess` Number of documents to process.
    `protected static int` | `INITPARAMS` # params before input file specs.
    `protected static java.lang.String` | `inputDirectory` Input directory.
    `protected static java.lang.String` | `outputDirectory` Output directory.
    `protected static java.io.PrintStream` | `outputFileStream` Output file stream.
    `protected static java.io.PrintStream` | `printStream` Wrapper for printStream to allow utf-8 output.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdornedToTCF04()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static boolean` | `initialize(java.lang.String[] args)` Initialize.
    `static void` | `main(java.lang.String[] args)` Main program.
    `protected static int` | `processFiles(java.lang.String[] args)` Process files.
    `protected static void` | `processOneFile(java.lang.String xmlFileName)` Process one file.
    `protected static void` | `terminate(int filesProcessed, long processingTime)` Terminate.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### docsToProcess

          protected static int docsToProcess

      Number of documents to process.

    - #### currentDocNumber

          protected static int currentDocNumber

      Current document.

    - #### inputDirectory

          protected static java.lang.String inputDirectory

      Input directory.

    - #### outputDirectory

          protected static java.lang.String outputDirectory

      Output directory.

    - #### outputFileStream

          protected static java.io.PrintStream outputFileStream

      Output file stream.

    - #### printStream

          protected static java.io.PrintStream printStream

      Wrapper for printStream to allow utf-8 output.

    - #### INITPARAMS

          protected static final int INITPARAMS

      # params before input file specs.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AdornedToTCF04

          public AdornedToTCF04()

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)

      Main program.
      Parameters:
        `args` - Program parameters.

    - #### initialize

          protected static boolean initialize(java.lang.String[] args)
                                       throws java.lang.Exception

      Initialize.
      Throws:
        `java.lang.Exception`

    - #### processOneFile

          protected static void processOneFile(java.lang.String xmlFileName)

      Process one file.
      Parameters:
        `xmlFileName` - Adorned XML file name to reformat for CWB.

    - #### processFiles

          protected static int processFiles(java.lang.String[] args)
                                     throws java.lang.Exception

      Process files.
      Throws:
        `java.lang.Exception`

    - #### terminate

          protected static void terminate(int filesProcessed,
                       long processingTime)

      Terminate.
      Parameters:
        `filesProcessed` - Number of files processed.
        `processingTime` - Processing time in seconds.