All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.berkeley.nlp.util.functional.Function Maven / Gradle / Ivy

Go to download

The Berkeley parser analyzes the grammatical structure of natural language using probabilistic context-free grammars (PCFGs).

The newest version!
package edu.berkeley.nlp.util.functional;

/**
 * Created by IntelliJ IDEA.
* User: aria42
* Date: Oct 9, 2008
* Time: 6:31:23 PM
*/
public interface Function {
	public O apply(I input);

  public static class ConstantFunction implements Function
  {

    private O c;

    public ConstantFunction(O c) {
      this.c = c;  
    }

    public O apply(I input) {
      return  c;
    }
  }

	public static class IdentityFunction implements Function
	{

		public I apply(I input)
		{
			return input;
		}
	}
  
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy