public class LuceneSentenceIndex<E extends Pattern> extends SentenceIndex<E>
Constructor and Description |
---|
LuceneSentenceIndex(java.util.Properties props,
java.util.Set<java.lang.String> stopWords,
java.lang.String indexDirStr,
java.util.function.Function<CoreLabel,java.util.Map<java.lang.String,java.lang.String>> transformer) |
Modifier and Type | Method and Description |
---|---|
protected void |
add(java.util.List<CoreLabel> tokens,
java.lang.String sentid,
boolean addProcessedText) |
void |
add(java.util.Map<java.lang.String,DataInstance> sentences,
boolean addProcessedText)
addProcessedText is true when inserting sentences for the first time
|
static LuceneSentenceIndex |
createIndex(java.util.Map<java.lang.String,java.util.List<CoreLabel>> sentences,
java.util.Properties props,
java.util.Set<java.lang.String> stopWords,
java.lang.String indexDiskDir,
java.util.function.Function<CoreLabel,java.util.Map<java.lang.String,java.lang.String>> transformer) |
void |
finishUpdating() |
void |
listAllDocuments() |
static LuceneSentenceIndex |
loadIndex(java.util.Properties props,
java.util.Set<java.lang.String> stopwords,
java.lang.String dir,
java.util.function.Function<CoreLabel,java.util.Map<java.lang.String,java.lang.String>> transformSentenceToString) |
java.util.Map<E,java.util.Set<java.lang.String>> |
queryIndex(java.util.Collection<E> patterns) |
void |
saveIndex(java.lang.String dir) |
void |
update(java.util.List<CoreLabel> tokens,
java.lang.String sentid) |
createIndex, loadIndex, setUp, size
public LuceneSentenceIndex(java.util.Properties props, java.util.Set<java.lang.String> stopWords, java.lang.String indexDirStr, java.util.function.Function<CoreLabel,java.util.Map<java.lang.String,java.lang.String>> transformer)
public void add(java.util.Map<java.lang.String,DataInstance> sentences, boolean addProcessedText)
SentenceIndex
add
in class SentenceIndex<E extends Pattern>
public java.util.Map<E,java.util.Set<java.lang.String>> queryIndex(java.util.Collection<E> patterns)
queryIndex
in class SentenceIndex<E extends Pattern>
public void listAllDocuments() throws java.io.IOException
java.io.IOException
protected void add(java.util.List<CoreLabel> tokens, java.lang.String sentid, boolean addProcessedText)
add
in class SentenceIndex<E extends Pattern>
public void finishUpdating()
finishUpdating
in class SentenceIndex<E extends Pattern>
public void update(java.util.List<CoreLabel> tokens, java.lang.String sentid)
update
in class SentenceIndex<E extends Pattern>
public void saveIndex(java.lang.String dir)
saveIndex
in class SentenceIndex<E extends Pattern>
public static LuceneSentenceIndex createIndex(java.util.Map<java.lang.String,java.util.List<CoreLabel>> sentences, java.util.Properties props, java.util.Set<java.lang.String> stopWords, java.lang.String indexDiskDir, java.util.function.Function<CoreLabel,java.util.Map<java.lang.String,java.lang.String>> transformer)
public static LuceneSentenceIndex loadIndex(java.util.Properties props, java.util.Set<java.lang.String> stopwords, java.lang.String dir, java.util.function.Function<CoreLabel,java.util.Map<java.lang.String,java.lang.String>> transformSentenceToString)