Package org.apache.uima.collection

Examples of org.apache.uima.collection.CollectionProcessingManager


        catch (ResourceInitializationException e)
        {
            throw new InvocationTargetException(e);
        }
       
        CollectionProcessingManager collectionProcessingEngine = UIMAFramework
                .newCollectionProcessingManager();
       
        try
        {
            collectionProcessingEngine.setAnalysisEngine(textAnalysisEngine);
        }
        catch (ResourceConfigurationException e)
        {
            throw new InvocationTargetException(e);
        }
       
        try
        {
            collectionProcessingEngine.addCasConsumer(mConfiguration
                    .createConsumer());
        }
        catch (ResourceConfigurationException e)
        {
            throw new InvocationTargetException(e);
        }
       
        collectionProcessingEngine.setPauseOnException(false);
       
        collectionProcessingEngine.addStatusCallbackListener(
                new StatusCallbackListener(){
           
            public void entityProcessComplete(CAS cas,
                    EntityProcessStatus status)
            {
                // not implemented
            }
           
            public void aborted()
            {
                finishProcessing();
            }
           
            public void batchProcessComplete()
            {
                // not implemented
            }
           
            public void collectionProcessComplete()
            {
                finishProcessing();
            }
           
            public void initializationComplete()
            {
                // not implemented
            }
           
            public void paused()
            {
                // not implemented
            }
           
            public void resumed()
            {
                // not implemented
            }
           
            private void finishProcessing()
            {
                synchronized (ConsumerActionRunnable.this)
                {
                    mIsProcessing = false;
                    ConsumerActionRunnable.this.notifyAll();
                }
            }
        });
       
        monitor.subTask("Feeding comsumer, please stand by.");

        try
        {
            collectionProcessingEngine.process(collectionReader);
        }
        catch (ResourceInitializationException e)
        {
            throw new InvocationTargetException(e);
        }
View Full Code Here


        catch (ResourceInitializationException e)
        {
            throw new InvocationTargetException(e);
        }

        CollectionProcessingManager collectionProcessingEngine = UIMAFramework
                .newCollectionProcessingManager();

        try
        {
            collectionProcessingEngine.setAnalysisEngine(textAnalysisEngine);
        }
        catch (ResourceConfigurationException e)
        {
            throw new InvocationTargetException(e);
        }

        try
        {
            collectionProcessingEngine.addCasConsumer(mConfiguration
                    .createConsumer());
        }
        catch (ResourceConfigurationException e)
        {
            throw new InvocationTargetException(e);
        }

        collectionProcessingEngine.setPauseOnException(false);

        collectionProcessingEngine.addStatusCallbackListener(
                new StatusCallbackListener(){

            public void entityProcessComplete(CAS cas,
                    EntityProcessStatus status)
            {
                // not implemented
            }

            public void aborted()
            {
                finishProcessing();
            }

            public void batchProcessComplete()
            {
                // not implemented
            }

            public void collectionProcessComplete()
            {
                finishProcessing();
            }

            public void initializationComplete()
            {
                // not implemented
            }

            public void paused()
            {
                // not implemented
            }

            public void resumed()
            {
                // not implemented
            }

            private void finishProcessing()
            {
                synchronized (ConsumerActionRunnable.this)
                {
                    mIsProcessing = false;
                    ConsumerActionRunnable.this.notifyAll();
                }
            }
        });

        monitor.subTask("Feeding comsumer, please stand by.");

        try
        {
            collectionProcessingEngine.process(collectionReader);
        }
        catch (ResourceInitializationException e)
        {
            throw new InvocationTargetException(e);
        }
View Full Code Here

TOP

Related Classes of org.apache.uima.collection.CollectionProcessingManager

Copyright © 2018 www.massapicom. 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.