2011-05-15 15 views

Respuesta

3

Sí, hay ejemplos en UIMA SDK. Debe leer la guía de desarrolladores aquí para ver la fuente en Eclipse. UIMA Tutorial and Dev Guide. Consulte la sección 1.1.3 y el Capítulo 3.

6

Si desea utilizar UIMA directamente en el código de Java, es posible que desee echarle un vistazo a uimafit, porque facilita el uso de UIMA desde Java. Aquí está un ejemplo rápido de usar Annotator ejemplo (source)

public class RoomNumberAnnotatorPipeline { 

     public static void main(String[] args) throws UIMAException { 
       String text = "The meeting was moved from Yorktown 01-144 to Hawthorne 1S-W33."; 
       TypeSystemDescription tsd = createTypeSystemDescription(
           "org.uimafit.examples.tutorial.type.RoomNumber"); 
       JCas jCas = createJCas(tsd); 
       jCas.setDocumentText(text); 

       AnalysisEngine analysisEngine = createPrimitive(RoomNumberAnnotator.class, tsd); 
       analysisEngine.process(jCas); 

       for (RoomNumber roomNumber : select(jCas, RoomNumber.class)) { 
         System.out.println(roomNumber.getCoveredText() + "\tbuilding = " 
             + roomNumber.getBuilding()); 
       } 
     } 
} 
+0

un poco tarde, pero una desventaja es uimafit no es compatible con paquetes de pera. – goh

+0

@goh try con https://groups.google.com/forum/?fromgroups=#!topic/uimafit-users/daWLysnrfHI – Renaud

Cuestiones relacionadas