![JAR search and dependency download from the Maven repository](/logo.png)
edu.berkeley.nlp.util.Freezer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of berkeleyparser Show documentation
Show all versions of berkeleyparser Show documentation
The Berkeley parser analyzes the grammatical structure of natural language using probabilistic context-free grammars (PCFGs).
The newest version!
package edu.berkeley.nlp.util;
import java.io.Serializable;
public class Freezer implements Serializable {
private static final long serialVersionUID = 1L;
private boolean frozen = false;
private String owner;
public Freezer(Object owner) {
this.owner = owner.toString();
}
public void freeze() {
frozen = true;
}
public boolean checkEasy() {
return frozen;
}
public void checkHard() {
if (frozen) {
throw new RuntimeException("Attempt to edit "+owner+" while it was frozen.");
}
}
public void check() {
checkHard();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy