Package de.julielab.genemapper.utils
Class ContextUtils
- java.lang.Object
-
- de.julielab.genemapper.utils.ContextUtils
-
public class ContextUtils extends Object
- Author:
- jwermter
-
-
Field Summary
Fields Modifier and Type Field Description static Set<String>STOPWORD_SETstatic String[]STOPWORDS
-
Constructor Summary
Constructors Constructor Description ContextUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stream<String>filterStopwords(Stream<String> input)static org.apache.lucene.analysis.TokenStreamgetStemmingStream(String input)static StringmakeContext(org.apache.uima.jcas.JCas aJCas, int windowSize, de.julielab.jcore.types.EntityMention entity)static org.apache.lucene.search.BooleanQuerymakeContextQuery(String context)builds the Lucene context query a given textstatic org.apache.lucene.search.BooleanQuerymakeContextQuery(String context, String fieldname)builds the Lucene context query a given textstatic org.apache.lucene.search.BooleanQuerymakeContextQuery(org.apache.uima.jcas.JCas aJCas)makes the context query.static org.apache.lucene.search.BooleanQuerymakeContextQuery(org.apache.uima.jcas.JCas aJCas, int windowSize, de.julielab.jcore.types.EntityMention entity)makes the context query.static Stream<String>makeContextTokens(String context)static StringmakeContextTokenString(String context)static StringmakeContextTypes(String context)
-
-
-
Method Detail
-
getStemmingStream
public static org.apache.lucene.analysis.TokenStream getStemmingStream(String input)
-
makeContextTypes
public static String makeContextTypes(String context) throws IOException
- Throws:
IOException
-
makeContextTokens
public static Stream<String> makeContextTokens(String context) throws IOException
- Throws:
IOException
-
makeContextTokenString
public static String makeContextTokenString(String context) throws IOException
- Throws:
IOException
-
makeContextQuery
public static org.apache.lucene.search.BooleanQuery makeContextQuery(org.apache.uima.jcas.JCas aJCas) throws IOExceptionmakes 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 IOExceptionmakes 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
-
-