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

edu.berkeley.nlp.util.Maxer 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;


public class Maxer {
	private double max = Double.NEGATIVE_INFINITY;
	private T argMax = null;

	public String toString() {
		return argMax.toString() + ": " + Fmt.D(max);
	}
	
	public void observe(T t, double val) {
		if (val > max) {
			max = val;
			argMax = t;
		}
	}

	public double getMax() {
		return max;
	}

	public T argMax() {
		return argMax;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy