Class Pipe

    • Constructor Detail

      • Pipe

        public Pipe()
        Construct a pipe with no data and target dictionaries
      • Pipe

        public Pipe​(Alphabet dataDict,
                    Alphabet targetDict)
        Construct pipe with data and target dictionaries. Note that, since the default values of the dataDictClass and targetDictClass are null, that if you specify null for one of the arguments here, this pipe step will not ever create any corresponding dictionary for the argument.
        dataDict - Alphabet that will be used as the data dictionary.
        targetDict - Alphabet that will be used as the target dictionary.
    • Method Detail

      • precondition

        public boolean precondition​(Instance inst)
        Each instance processed is tested by this method. If it returns true, then the instance by-passes processing by this Pipe. Common usage is to override this method in an anonymous inner sub-class of Pipe. SerialPipes sp = new SerialPipes (new Pipe[] { new CharSequence2TokenSequence() { public boolean precondition (Instance inst) { return inst instanceof CharSequence; } }, new TokenSequence2FeatureSequence(), });
      • pipe

        public Instance pipe​(Instance inst)
        Really this should be 'protected', but isn't for historical reasons.
      • newIteratorFrom

        public java.util.Iterator<Instance> newIteratorFrom​(java.util.Iterator<Instance> source)
        Given an InstanceIterator, return a new InstanceIterator whose instances have also been processed by this pipe. If you override this method, be sure to check and obey this pipe's skipIfFalse(Instance) method.
      • instancesFrom

        public Instance[] instancesFrom​(java.util.Iterator<Instance> source)
        A convenience method that will pull all instances from source through this pipe, and return the results as an array.
      • setTargetProcessing

        public void setTargetProcessing​(boolean lookForAndProcessTarget)
        Set whether input is taken from target field of instance during processing. If argument is false, don't expect to find input material for the target. By default, this is true.
      • isTargetProcessing

        public boolean isTargetProcessing()
        Return true iff this pipe expects and processes information in the target slot.
      • getDataAlphabet

        public Alphabet getDataAlphabet()
      • getTargetAlphabet

        public Alphabet getTargetAlphabet()
      • setDataAlphabet

        public void setDataAlphabet​(Alphabet dDict)
      • isDataAlphabetSet

        public boolean isDataAlphabetSet()
      • setOrCheckDataAlphabet

        public void setOrCheckDataAlphabet​(Alphabet a)
      • setTargetAlphabet

        public void setTargetAlphabet​(Alphabet tDict)
      • setOrCheckTargetAlphabet

        public void setOrCheckTargetAlphabet​(Alphabet a)
      • preceedingPipeDataAlphabetNotification

        protected void preceedingPipeDataAlphabetNotification​(Alphabet a)
      • preceedingPipeTargetAlphabetNotification

        protected void preceedingPipeTargetAlphabetNotification​(Alphabet a)
      • getInstanceId

        public java.util.UUID getInstanceId()
      • readResolve

        public java.lang.Object readResolve()
        This gets called after readObject; it lets the object decide whether to return itself or return a previously read in version. We use a hashMap of instanceIds to determine if we have already read in this object.