Package org.carrot2.core

Examples of org.carrot2.core.Controller.process()


                resourceLookupKey,
                new ResourceLookup(new DirLocator(tempDir1.getPath()), classpathLocator),
                resourceReloadKey,
                true));
   
            final ProcessingResult result = ctrl1.process(
                Collections.<String, Object> emptyMap(), TestComponent.class);
            final ILexicalData data = result.getAttribute("english");

            assertTrue(data.isCommonWord(new MutableCharArray("uniquea")));
            assertFalse(data.isCommonWord(new MutableCharArray("uniqueb")));
View Full Code Here


        final Controller ctrl2 = ControllerFactory.createPooling();
        {
            ctrl2.init(ImmutableMap.<String, Object> of(resourceLookupKey,
                new ResourceLookup(new DirLocator(tempDir2.getPath()), classpathLocator)));
   
            final ProcessingResult result = ctrl2.process(
                Collections.<String, Object> emptyMap(), TestComponent.class);
            final ILexicalData data = result.getAttribute("english");

            assertFalse(data.isCommonWord(new MutableCharArray("uniquea")));
            assertTrue(data.isCommonWord(new MutableCharArray("uniqueb")));
View Full Code Here

        final Controller controller = getCachingController(initAttributes, IClusteringAlgorithm.class);

        final Map<String, Object> processingAttributes = ImmutableMap.of(
            AttributeNames.DOCUMENTS, (Object) DOCUMENTS_DATA_MINING);

        controller.process(processingAttributes, getComponentClass());
        controller.process(processingAttributes, getComponentClass());

        controller.dispose();
    }
View Full Code Here

        final Map<String, Object> processingAttributes = ImmutableMap.of(
            AttributeNames.DOCUMENTS, (Object) DOCUMENTS_DATA_MINING);

        controller.process(processingAttributes, getComponentClass());
        controller.process(processingAttributes, getComponentClass());

        controller.dispose();
    }

    /**
 
View Full Code Here

                {
                    Map<String, Object> localAttributes = Maps.newHashMap();
                    localAttributes.put(AttributeNames.DOCUMENTS, SampleDocumentData.ALL
                        .get(dataSetIndex % SampleDocumentData.ALL.size()));
                    localAttributes.put("dataSetIndex", dataSetIndex);
                    return controller.process(localAttributes, getComponentClass());
                }
            });
        }

        try
View Full Code Here

    public ProcessingResult cluster(Collection<Document> documents)
    {
        processingAttributes.put(AttributeNames.DOCUMENTS, documents);
        Controller controller = getSimpleController(initAttributes);
        try {
            ProcessingResult process = controller.process(processingAttributes, getComponentClass());
            return process;
        } finally {
            controller.dispose();
            super.simpleController = null;
        }
View Full Code Here

                callables.add(new Callable<ProcessingResult>()
                {
                    public ProcessingResult call() throws Exception
                    {
                        Map<String, Object> localAttributes = Maps.newHashMap(attributes);
                        return controller.process(localAttributes, getComponentClass());
                    }
                });
            }
   
            final List<Future<ProcessingResult>> results = executorService.invokeAll(callables);
View Full Code Here

                        CommonAttributesDescriptor.attributeBuilder(processingAttrs)
                            .documents(prepareDocumentsForClustering(clusteringRequest, response))
                            .query(clusteringRequest.getQueryHint());
       
                        final long tsClusteringStart = System.nanoTime();
                        final ProcessingResult result = controller.process(processingAttrs, algorithmId);
                        final DocumentGroup[] groups = adapt(result.getClusters());
                        final long tsClusteringEnd = System.nanoTime();

                        final Map<String,String> info = ImmutableMap.<String,String> builder()
                                .put(ClusteringActionResponse.Fields.Info.ALGORITHM, algorithmId)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.