![JAR search and dependency download from the Maven repository](/logo.png)
edu.berkeley.nlp.util.IterableAdapter 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.util.Iterator;
public class IterableAdapter {
public static interface Convertor { public T convert(S s); }
public static Iterable adapt(final Iterable iterable, final Convertor convertor) {
return new Iterable() {
public Iterator iterator() {
final Iterator origIt = iterable.iterator();
return new Iterator() {
public boolean hasNext() {
return origIt.hasNext();
}
public T next() {
// TODO Auto-generated method stub
return convertor.convert(origIt.next());
}
public void remove() {
// TODO Auto-generated method stub
origIt.remove();
}
};
}
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy