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

edu.berkeley.nlp.mapper.MapWorkerFactory 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.mapper;

import java.util.List;

public interface MapWorkerFactory {
	public MapWorker newMapWorker();
	
	public static class DefaultFactory implements MapWorkerFactory  {

		private Class c;
		
		public DefaultFactory(Class c) {
			this.c = c;
		}
		
		public MapWorker newMapWorker() {
			// TODO Auto-generated method stub
			try {
				Object o = c.newInstance();
				return (MapWorker) o;
			} catch (Exception e) {
				e.printStackTrace();
			}
			throw new RuntimeException();
		}
				
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy