Class ContextUtils


  • public class ContextUtils
    extends Object
    Author:
    jwermter
    • Field Detail

      • STOPWORDS

        public static final String[] STOPWORDS
      • STOPWORD_SET

        public static final Set<String> STOPWORD_SET
    • Constructor Detail

      • ContextUtils

        public ContextUtils()
    • Method Detail

      • getStemmingStream

        public static org.apache.lucene.analysis.TokenStream getStemmingStream​(String input)
      • makeContextQuery

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

        public static 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​(String context,
                                                                             String fieldname)
                                                                      throws IOException
        builds the Lucene context query a given text
        Parameters:
        context - the document text
        Returns:
        Throws:
        IOException
      • makeContextQuery

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