Package org.carrot2.core

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


        /*
         * We need to refer to the Lucene component by its identifier we set during
         * initialization. As we've not assigned any identifier to the
         * LingoClusteringAlgorithm we want to use, we can its fully qualified class name.
         */
        ProcessingResult process = controller.process(processingAttributes, "lucene",
            LingoClusteringAlgorithm.class.getName());
       
        ConsoleFormatter.displayResults(process);
    }
}
View Full Code Here


        final Map<String, Object> attributes;
        attributes = new HashMap<String, Object>();
        CommonAttributesDescriptor.attributeBuilder(attributes).query("data mining");

        start = System.currentTimeMillis();
        result = controller.process(attributes, Bing3WebDocumentSource.class,
            LingoClusteringAlgorithm.class);
        duration = System.currentTimeMillis() - start;
        System.out.println(duration + " ms (empty cache)");

        start = System.currentTimeMillis();
View Full Code Here

            LingoClusteringAlgorithm.class);
        duration = System.currentTimeMillis() - start;
        System.out.println(duration + " ms (empty cache)");

        start = System.currentTimeMillis();
        result = controller.process(attributes, Bing3WebDocumentSource.class,
            LingoClusteringAlgorithm.class);
        duration = System.currentTimeMillis() - start;
        System.out.println(duration + " ms (documents and clusters from cache)");
        // [[[end:using-caching-controller]]]
    }
View Full Code Here

                .caseSensitive(false);

            /*
             * Invoke processing on the controller and display the result.
             */
            final ProcessingResult result = controller.process(params,
                ModuloDocumentSource.class,
                ByFirstTitleLetterClusteringAlgorithm.class);

            ConsoleFormatter.displayResults(result);
        } finally {
View Full Code Here

        final ILexicalData lexicalData2;

        // Use ctrl1
        {
            final Controller ctrl = ControllerFactory.createPooling();
            final ProcessingResult result = ctrl.process(
                Collections.<String, Object> emptyMap(), TestComponent.class);

            lexicalData1 = result.getAttribute("english");
        }
View Full Code Here

        }

        // Use ctrl1
        {
            final Controller ctrl = ControllerFactory.createPooling();
            final ProcessingResult result = ctrl.process(
                Collections.<String, Object> emptyMap(), TestComponent.class);

            lexicalData2 = result.getAttribute("english");
        }
View Full Code Here

        {
            ctrl1.init(ImmutableMap.<String, Object> of(
                resourceLookupKey,
                new ResourceLookup(new DirLocator(tempDir1), classpathLocator)));

            final ProcessingResult result = ctrl1.process(
                Collections.<String, Object> emptyMap(), TestComponent.class);

            data1 = result.getAttribute("english");
            assertTrue(data1.isCommonWord(new MutableCharArray("uniquea")));
        }
View Full Code Here

        {
            ctrl2.init(ImmutableMap.<String, Object> of(
                resourceLookupKey,
                new ResourceLookup(new DirLocator(tempDir1), classpathLocator)));

            final ProcessingResult result = ctrl2.process(
                Collections.<String, Object> emptyMap(), TestComponent.class);

            data2 = result.getAttribute("english");
            assertTrue(data2.isCommonWord(new MutableCharArray("uniquea")));
View Full Code Here

        /*
         * But since it's the same location, all other controllers should now see updated resources
         * (and share the same lexical data).
         */
        final ILexicalData data4 = ctrl2.process(
            Collections.<String, Object> emptyMap(), TestComponent.class).getAttribute("english");

        assertSame(data3, data4);
    }

View Full Code Here

        final Controller controller = ControllerFactory.createSimple();
        try
        {
            controller.init(attrs);
            ProcessingResult result = controller.process(
                Lists.newArrayList(document),
                query,
                QueryWordHighlighter.class);
           
            final Document highlightedDocument = result.getDocuments().get(0);
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.