Package weka.filters

Class RenameRelation

    • Constructor Detail

      • RenameRelation

        public RenameRelation()
    • Method Detail

      • globalInfo

        public java.lang.String globalInfo()
        Returns a string describing this filter
        Returns:
        a description of the filter suitable for displaying in the explorer/experimenter gui
      • getModificationText

        public java.lang.String getModificationText()
        Get the modification text to apply
        Returns:
        the modification text
      • getModType

        public weka.filters.RenameRelation.ModType getModType()
        Get the modification type to apply
        Returns:
        the modification type to apply
      • getRegexMatch

        public java.lang.String getRegexMatch()
        Get the match string for regex modifications
        Returns:
        the regular expression to apply for matching
      • getReplaceAll

        public boolean getReplaceAll()
        Get whether to replace all regular expression matches, or just the first.
        Returns:
        true to replace all regex matches
      • setInputFormat

        public boolean setInputFormat​(Instances instanceInfo)
                               throws java.lang.Exception
        Sets the format of the input instances.
        Overrides:
        setInputFormat in class Filter
        Parameters:
        instanceInfo - an Instances object containing the input instance structure (any instances contained in the object are ignored - only the structure is required).
        Returns:
        true if the outputFormat may be collected immediately
        Throws:
        java.lang.Exception - if something goes wrong
      • input

        public boolean input​(Instance instance)
        Description copied from class: Filter
        Input an instance for filtering. Ordinarily the instance is processed and made available for output immediately. Some filters require all instances be read before producing output, in which case output instances should be collected after calling batchFinished(). If the input marks the start of a new batch, the output queue is cleared. This default implementation assumes all instance conversion will occur when batchFinished() is called.
        Overrides:
        input in class Filter
        Parameters:
        instance - the input instance
        Returns:
        true if the filtered instance may now be collected with output().
      • main

        public static void main​(java.lang.String[] argv)
        Main method for testing this class.
        Parameters:
        argv - should contain arguments to the filter: use -h for help