Class Converter

    • Constructor Detail

      • Converter

        public Converter()
        Default constructor.
    • Method Detail

      • getHelp

        public Boolean getHelp()
        Getter for help: Display help info about available serialization parameters.
        Returns:
        Display help info about available serialization parameters.
      • setHelp

        @Switch(value="Display help info about available serialization parameters",
                compulsory=false)
        public Converter setHelp​(Boolean newHelp)
        Setter for help: Display help info about available serialization parameters.
        Parameters:
        newHelp - Display help info about available serialization parameters.
      • getVerbose

        public Boolean getVerbose()
        Getter for verbose: Whether detailed verbose output is printed or not.
        Returns:
        Whether detailed verbose output is printed or not.
      • setVerbose

        @Switch(value="Print verbose output",
                compulsory=false)
        public void setVerbose​(Boolean newVerbose)
        Setter for verbose: Whether detailed verbose output is printed or not.
        Parameters:
        newVerbose - Whether detailed verbose output is printed or not.
      • getBatchMode

        public Boolean getBatchMode()
        Getter for batchMode: Whether to start processing immediately (true) or wait until the user presses "Convert" (false).
        Returns:
        Whether to start processing immediately (true) or wait until the user presses "Convert" (false).
      • setBatchMode

        @Switch(value="Start processing immediately, rather than waiting for the user to press Convert",
                compulsory=false)
        public void setBatchMode​(Boolean newBatchMode)
        Setter for batchMode: Whether to start processing immediately (true) or wait until the user presses "Convert" (false).
        Parameters:
        newBatchMode - Whether to start processing immediately (true) or wait until the user presses "Convert" (false).
      • getDeserializer

        public abstract GraphDeserializer getDeserializer()
        Gets the deserializer that convert(File) uses.
        Returns:
        The deserializer to use.
      • getSerializer

        public abstract GraphSerializer getSerializer()
        Gets the serializer that convert(File) uses.
        Returns:
        The serializer to use.
      • getLayersToSerialize

        public String[] getLayersToSerialize()
        Specifies which layers should be given to the serializer. The default implementaion returns only the "utterance" layer.
        Returns:
        An array of layer IDs.
      • deserializerConfiguration

        public ParameterSet deserializerConfiguration​(ParameterSet config)
        Adjust the configuration of the deserializer. Implementors can adjust the default configuration before it's applied. This method is invoked once for each input file.
        Parameters:
        config - The default configuration.
        Returns:
        The new configuration.
      • deserializationParameters

        public ParameterSet deserializationParameters​(ParameterSet parameters)
        Adjust the parameters for deserialization. Implementors can adjust the default configuration before it's applied. This method is invoked once for each input file.
        Parameters:
        parameters - The default parameters.
        Returns:
        The new configuration.
      • serializerConfiguration

        public ParameterSet serializerConfiguration​(ParameterSet config)
        Adjust the configuration of the serializer. Implementors can adjust the default configuration before it's applied. This method is invoked once for each input file.
        Parameters:
        config - The default configuration.
        Returns:
        The new configuration.
      • processTranscripts

        public void processTranscripts​(Graph[] transcripts)
        Process the transcripts after they were deserialized, but before they're serialized. Implementors can rename speakers, adjust meta-data, or change the graph in any other way required before serialization.
        Parameters:
        transcripts -
      • getSchema

        public Schema getSchema()
        Specify the schema to used by convert(File).
        Returns:
        The schema.
      • convert

        public void convert​(Vector<File> inputFiles)
                     throws SerializationException,
                            Exception
        Converts all files by deserializing all first, and then serializing all resulting graphs at once. The default implementation uses a default schema, default settings for serializations, and serializes the "utterance" layer only.
        Parameters:
        inputFiles -
        Throws:
        Exception
        SerializationException
      • init

        public void init()
        Overrides:
        init in class Applet
      • start

        public void start()
        Overrides:
        start in class Applet
      • help

        public String help()
        Generates help information.
        Returns:
        The help information for this converter, including general info, and info about the deserializer and serializer.
      • convertFiles

        public void convertFiles()
        Converts the files in the files list.
      • convertBatch

        public void convertBatch​(Vector<File> files)
        Converts a batch of files.
        Parameters:
        files -
      • configureFromCommandLine

        public ParameterSet configureFromCommandLine​(ParameterSet parameters,
                                                     Schema schema)
        Sets any parameter values that might have been specified on the the command line - i.e. that are in the GuiProgram.extraSwitches map.
        Parameters:
        parameters - The parameters to configure.
        schema - The source of any layers specified.
        Returns:
        The given parameter set.
      • setSwitch

        public Converter setSwitch​(String name,
                                   String value)
        Specify the value for an extra switch, which will be passed to the deserializer and serializer.
        Parameters:
        name - The switch name.
        value - The value for the switch.
        Returns:
        A reference to this object, so that calls can be stacked like a builder.