public void setup(AInferState inferState, boolean debug, ModelType modelType, boolean allowEmptyNodes, int K, NgramModel ngramModel, NgramModel secondaryNgramModel, int M, Options.ReorderType reorderType, boolean allowConsecutiveEvents, boolean oracleReranker, boolean useDependencies, double interpolationFactor, boolean posAtSurfaceLevel, String tagDelimiter, int NUM, int ELIDED_SYMBOL, boolean numbersAsSymbol, Indexer<String> wordIndexer, Example ex, Graph graph) { this.inferState = inferState; discriminative = this.inferState instanceof DiscriminativeInferState; this.debug = debug; // Need this because the pc sets might be inconsistent with the types this.allowEmptyNodes = allowEmptyNodes; this.modelType = modelType; this.K = K; this.M = M; this.ngramModel = ngramModel; this.secondaryNgramModel = secondaryNgramModel; this.reorderType = reorderType; this.allowConsecutiveEvents = allowConsecutiveEvents; this.oracleReranker = oracleReranker; this.useDependencies = useDependencies; this.interpolationFactor = interpolationFactor; this.posAtSurfaceLevel = posAtSurfaceLevel; this.tagDelimiter = tagDelimiter; /*add NUM category and ELIDED_SYMBOL to word vocabulary. Useful for the LM calculations*/ this.NUM = NUM; this.ELIDED_SYMBOL = ELIDED_SYMBOL; this.numbersAsSymbol = numbersAsSymbol; this.vocabulary = wordIndexer; this.ex = ex; this.graph = graph; if(graph != null) graph.addVertex(startNode); // cache = Collections.synchronizedMap(new LRUMap<List<Integer>, Double>(1000)); cache = new LRUMap<List<Integer>, Double>(1000); }
public InterpolatingElevationCache(ElevationProvider provider, Coordinate origin, Coordinate gridScale) { lattice = new Lattice(origin, gridScale); this.provider = provider; prefetchStack = new LRUMap<Point,Object>(); cache = new LRUMap<Point,Double>(MAX_CACHE_SIZE); prefetchStack = new LRUMap<Point, Object>(MAX_PREFETCH_SIZE); }