/** * Constructs a new instance using the provided properties for * configuration. */ public HyperspaceAnalogueToLanguage(Properties properties) { cooccurrenceMatrix = new AtomicGrowingSparseHashMatrix(); reduced = null; termToIndex = new ConcurrentHashMap<String,Integer>(); wordIndexCounter = 0; String windowSizeProp = properties.getProperty(WINDOW_SIZE_PROPERTY); windowSize = (windowSizeProp != null) ? Integer.parseInt(windowSizeProp) : DEFAULT_WINDOW_SIZE; String weightFuncProp = properties.getProperty(WEIGHTING_FUNCTION_PROPERTY); weighting = (weightFuncProp == null) ? DEFAULT_WEIGHTING : loadWeightingFunction(weightFuncProp); }
double columnThreshold, int retainColumns) { this.cooccurrenceMatrix = new AtomicGrowingSparseHashMatrix(); this.termToIndex = basis; this.windowSize = windowSize;
/** * Creates a new {@link OccurrenceCounter}. */ public OccurrenceCounter(Transform transform, int bound, int windowSize) { cooccurrenceMatrix = new AtomicGrowingSparseHashMatrix(); basis = new StringBasisMapping(); wordScores = new BoundedSortedMap<String, Double>(bound); weighting = new LinearWeighting(); this.transform = transform; this.windowSize = windowSize; }
/** * Creates a new {@link OccurrenceCounter}. */ public OccurrenceCounter(Transform transform, int bound, int windowSize) { cooccurrenceMatrix = new AtomicGrowingSparseHashMatrix(); basis = new StringBasisMapping(); wordScores = new BoundedSortedMap<String, Double>(bound); weighting = new LinearWeighting(); this.transform = transform; this.windowSize = windowSize; }
/** * Creates a new {@link OccurrenceCounter}. */ public OccurrenceCounter(Transform transform, int bound, DependencyPathAcceptor acceptor, DependencyPathWeight weighter, int pathLength) { cooccurrenceMatrix = new AtomicGrowingSparseHashMatrix(); basis = new StringBasisMapping(); wordScores = new BoundedSortedMap<String, Double>(bound); extractor = DependencyExtractorManager.getDefaultExtractor(); this.transform = transform; this.acceptor = acceptor; this.weighter = weighter; this.pathLength = pathLength; }
/** * Creates a new {@link OccurrenceCounter}. */ public OccurrenceCounter(Transform transform, int bound, DependencyPathAcceptor acceptor, DependencyPathWeight weighter, int pathLength) { cooccurrenceMatrix = new AtomicGrowingSparseHashMatrix(); basis = new StringBasisMapping(); wordScores = new BoundedSortedMap<String, Double>(bound); extractor = DependencyExtractorManager.getDefaultExtractor(); this.transform = transform; this.acceptor = acceptor; this.weighter = weighter; this.pathLength = pathLength; }