Class ContextUtils


  • public class ContextUtils
    extends java.lang.Object
    Author:
    jwermter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String[] STOPWORDS  
    • Constructor Summary

      Constructors 
      Constructor Description
      ContextUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.lucene.analysis.TokenStream getStemmingStream​(java.lang.String input)  
      static java.lang.String makeContext​(org.apache.uima.jcas.JCas aJCas, int windowSize, de.julielab.jcore.types.EntityMention entity)  
      static org.apache.lucene.search.BooleanQuery makeContextQuery​(java.lang.String context)
      builds the Lucene context query a given text
      static org.apache.lucene.search.BooleanQuery makeContextQuery​(org.apache.uima.jcas.JCas aJCas)
      makes the context query.
      static org.apache.lucene.search.BooleanQuery makeContextQuery​(org.apache.uima.jcas.JCas aJCas, int windowSize, de.julielab.jcore.types.EntityMention entity)
      makes the context query.
      static java.lang.String makeContextTokens​(java.lang.String context)  
      static java.lang.String makeContextTypes​(java.lang.String context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • STOPWORDS

        public static final java.lang.String[] STOPWORDS
    • Constructor Detail

      • ContextUtils

        public ContextUtils()
    • Method Detail

      • getStemmingStream

        public static org.apache.lucene.analysis.TokenStream getStemmingStream​(java.lang.String input)
      • makeContextTypes

        public static java.lang.String makeContextTypes​(java.lang.String context)
                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • makeContextTokens

        public static java.lang.String makeContextTokens​(java.lang.String context)
                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • makeContextQuery

        public static org.apache.lucene.search.BooleanQuery makeContextQuery​(org.apache.uima.jcas.JCas aJCas)
                                                                      throws java.io.IOException
        makes the context query. Returns null if no context was found.
        Parameters:
        aJCas -
        Returns:
        a boolean query to be processed by Lucene
        Throws:
        java.io.IOException
      • makeContextQuery

        public static org.apache.lucene.search.BooleanQuery makeContextQuery​(org.apache.uima.jcas.JCas aJCas,
                                                                             int windowSize,
                                                                             de.julielab.jcore.types.EntityMention entity)
                                                                      throws java.io.IOException
        makes the context query. Returns null if no context was found.
        Parameters:
        aJCas -
        Returns:
        a boolean query to be processed by Lucene
        Throws:
        java.io.IOException
      • makeContext

        public static java.lang.String makeContext​(org.apache.uima.jcas.JCas aJCas,
                                                   int windowSize,
                                                   de.julielab.jcore.types.EntityMention entity)
      • makeContextQuery

        public static org.apache.lucene.search.BooleanQuery makeContextQuery​(java.lang.String context)
                                                                      throws java.io.IOException
        builds the Lucene context query a given text
        Parameters:
        context - the document text
        Returns:
        Throws:
        java.io.IOException