Hi danial,

               i think i am doing simailar to u.i need help from u.i will
tell u what i have done and what i want to achive.

                    till now i have done one sample program similar to hello
world,ie look for string in mutiple files ie is done.here every thing is
hard coded.so what ihave done is i have strted using the parameters in
analysisengine descriptor.here i am getting an error saying that

"alysis_engine.analysisEngineProcessException:Annotator processing failed
caused by :java.lang.illegalStateException:no match avilable"".

i think error is there in annotator java class.here i will give u the code
for it can u help me back...

i am attching file which contain javaclass


On 8/31/07, Danai Wiriyayanyongsuk <[EMAIL PROTECTED]> wrote:
>
> Thanks Michael. Yes, I have my primitive engines available as PEAR files.
> I
> also have the auto-generated PEAR descriptors.
>
> Michael's Quote: "This descriptor have to be used in the aggregate to
> refer
> to the primitive AEs."
> Question: How to refer the PEAR descriptors to their primitive AEs in the
> aggregate? Is it documented somewhere? In the aggregate AE description, I
> tried to specify the location of the PEAR descriptors in
> "delegateAnalysisEngine/import" but didn't work.
>
> Thanks,
> Danai Wiriyayanyongsuk
>
>
> On 8/30/07, Michael Baessler <[EMAIL PROTECTED]> wrote:
> >
> > Are your primitive engines available as PEAR files? That is needed since
> > only if you have them as PEAR files
> > you can use the PEAR descriptor.
> >
> > After you have installed the PEAR files a PEAR descriptor is
> > automatically generated (located in the install directory). This
> > descriptor have to
> > be used in the aggregate to refer to the primitive AEs.
> >
> > -- Michael
> >
> > Danai Wiriyayanyongsuk wrote:
> > > Thanks Marshall for the information and for asking :)
> > >
> > > What I have tried is that I have a description of an aggregate
> analysis
> > > engine which has 4 primitive analysis engine defined. Those primitive
> AE
> > > descriptions are all fully defined (no imports) under the
> > > "delegateAnalysisEngine/analysisEngineDescription" tag. I do this
> > because
> > > those primitive AE descriptions are generated on the fly. For one
> thing,
> > > each primitive AE has its own PEAR-compliant directory. In this case,
> I
> > > could not figure out how to tell UIMA the location those directories.
> > >
> > > Excerpt from section 5.8 in the UIMA References page:
> > > "As of version 2.2, the framework supports component descriptors which
> > are
> > > PEAR descriptors. These descriptors define components plus include
> > > information on the class path needed to run them."
> > > Question: To get the individual class loader for each primitive AE
> > defined
> > > in an aggregate AE, do we have to specify/map the PEAR descriptor
> > > (<componentID>_pear.xml?) for each of every primitive AE? If so, where
> > and
> > > how to do it?
> > >
> > > Any comments/recommendations would be appreciated.
> > >
> > > Thanks,
> > > Danai Wiriyayanyongsuk
> > >
> > >
> > >
> > > On 8/29/07, Marshall Schor < [EMAIL PROTECTED]> wrote:
> > >
> > >> Version 2.2 includes support for aggregates composed of PEAR
> > >> descriptors, which include the class path information.
> > >>
> > >> This should allow you to run a pipeline where each annotator could
> have
> > >> different versions of classes.
> > >> See
> > >>
> > >>
> >
> http://incubator.apache.org/uima/downloads/releaseDocs/2.2.0-incubating/docs/html/references/references.html#ugr.ref.jcas.pear_support
> > >>
> > >> Is that what you're trying to do?
> > >>
> > >> -Marshall
> > >>
> > >> Danai Wiriyayanyongsuk wrote:
> > >>
> > >>> Hi Guys,
> > >>>
> > >>> I'd like to ask a couple of questions regarding the classloader in
> > UIMA
> > >>>
> > >> 2.2.
> > >>
> > >>> For an aggregate analysis engine, is there a way to have/set
> different
> > >>>
> > >> class
> > >>
> > >>> loaders for each aggregated primitive analysis engines, so that the
> > >>>
> > >> classes
> > >>
> > >>> won't interfere each others?
> > >>>
> > >>> If there is so, could you please shed some light how to do it? I've
> > >>>
> > >> looked
> > >>
> > >>> into the source code and documentation but no luck :(
> > >>>
> > >>> Many Thanks,
> > >>> Danai Wiriyayanyongsuk
> > >>>
> > >>>
> > >>>
> > >>
> > >
> > >
> >
> >
>
public class SampleAnnotator extends JCasAnnotator_ImplBase {
        
        
          private Pattern[] mPatterns;
          
          private String [] mLocations;
          
          /**
           * @see AnalysisComponent#initialize(UimaContext)
           */
          public void initialize(UimaContext aContext)
            throws ResourceInitializationException
          {
            super.initialize(aContext);
            //Get config. parameter values
            String[] patternStrings = 
              (String[])aContext.getConfigParameterValue("patterns");
            //String[] patternStrings = 
                      //(String[])aContext.getConfigParameterValue("Locations");
            mLocations = (String[])aContext.getConfigParameterValue("patterns");
            mLocations = 
(String[])aContext.getConfigParameterValue("Locations");
            
            mPatterns = new Pattern[patternStrings.length];
            for (int i = 0; i < patternStrings.length; i++)
            {
              mPatterns[i] = Pattern.compile(patternStrings[i]);  
            }
              mPatterns = new Pattern[patternStrings.length];
                    for (int j = 0; j < patternStrings.length; j++)
                    {
                      mPatterns[j] = Pattern.compile(patternStrings[j]);  
                    }    
             
           
           
          }

          /**
           * @see JCasAnnotator_ImplBase#process(JCas)
           */
          public void process(JCas aJCas)
            throws AnalysisEngineProcessException
          {
            //get document text
            String docText = aJCas.getDocumentText();
            
            //loop over patterns
            for (int i = 0; i < mPatterns.length; i++)
            {
              Matcher matcher = mPatterns[i].matcher(docText);
              int pos = 0;
              while (matcher.find(pos))
              {
                //found one - creation annotation
                TestType annotation = new TestType(aJCas);
                annotation.setBegin(matcher.start());
                annotation.setEnd(matcher.end());
                annotation.addToIndexes();
                annotation.setTestType(mLocations[i]);
               
                pos = matcher.end();
                getContext().getLogger().log(Level.FINEST,"Found: " + 
annotation);
              }
              for (int j = 0; i < mPatterns.length; i++)
                    {
                      Matcher matcher1 = mPatterns[j].matcher(docText);
                      int pos1 = 0;
                      while (matcher.find(pos1))
                      {
                        //found one - creation annotation
                        TestType annotation = new TestType(aJCas);
                        annotation.setBegin(matcher1.start());
                        annotation.setEnd(matcher1.end());
                        annotation.addToIndexes();
                        annotation.setTestType(mLocations[j]);
                       
                        pos1 = matcher.end();
                        getContext().getLogger().log(Level.FINEST,"Found: " + 
annotation);
                      }
            }  
          }

          }
          }

Reply via email to